2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-17 15:26:23 +00:00

[fenix] Disable send tab for non-nightly, non-debug builds (https://github.com/mozilla-mobile/fenix/pull/3542)

* Put deviceCapabilities list behind a SEND_TAB_ENABLED flag

* Disable SEND_TAB for non-debug, non-nightly builds
This commit is contained in:
Grisha Kruglov 2019-06-18 16:37:51 -07:00 committed by Stefan Arentz
parent 2ab8575951
commit 717d7f0424
2 changed files with 14 additions and 2 deletions

View File

@ -258,7 +258,9 @@ android.applicationVariants.all { variant ->
// -------------------------------------------------------------------------------------------------
// Feature build flags
// -------------------------------------------------------------------------------------------------
buildConfigField 'Boolean', 'SEND_TAB_ENABLED', (true).toString()
// NB: flipping SEND_TAB_ENABLED flag back and worth is currently not well supported and may need hand-holding.
// Consult with the android-components peers before changing.
buildConfigField 'Boolean', 'SEND_TAB_ENABLED', (buildType == "nightly" || isDebug).toString()
buildConfigField 'Boolean', 'PULL_TO_REFRESH_ENABLED', (false).toString()
}

View File

@ -22,6 +22,7 @@ import mozilla.components.service.fxa.Config
import mozilla.components.service.fxa.manager.DeviceTuple
import mozilla.components.service.fxa.manager.FxaAccountManager
import mozilla.components.support.base.log.logger.Logger
import org.mozilla.fenix.BuildConfig
import org.mozilla.fenix.Experiments
import org.mozilla.fenix.R
import org.mozilla.fenix.isInExperiment
@ -77,11 +78,20 @@ class BackgroundServices(
}
}
// NB: flipping this flag back and worth is currently not well supported and may need hand-holding.
// Consult with the android-components peers before changing.
// See https://github.com/mozilla/application-services/issues/1308
private val deviceCapabilities = if (BuildConfig.SEND_TAB_ENABLED) {
listOf(DeviceCapability.SEND_TAB)
} else {
emptyList()
}
val accountManager = FxaAccountManager(
context,
config,
scopes,
DeviceTuple(context.getString(R.string.app_name), DeviceType.MOBILE, listOf(DeviceCapability.SEND_TAB)),
DeviceTuple(context.getString(R.string.app_name), DeviceType.MOBILE, deviceCapabilities),
syncManager
).also {
it.registerForDeviceEvents(deviceEventObserver, ProcessLifecycleOwner.get(), true)