From 3d387e2dde9bf2f0265c9467a1d9e04c683c3144 Mon Sep 17 00:00:00 2001 From: Jonathan Almeida Date: Wed, 11 Mar 2020 21:11:33 -0400 Subject: [PATCH] Add nightly-only feature flag for WebPush integration --- app/src/main/java/org/mozilla/fenix/FeatureFlags.kt | 9 +++++++++ app/src/main/java/org/mozilla/fenix/FenixApplication.kt | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt b/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt index 71fa82582..3b67e9423 100644 --- a/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt +++ b/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt @@ -58,4 +58,13 @@ object FeatureFlags { * Enables deleting individual tracking protection exceptions. */ val deleteIndividualTrackingProtectionExceptions = Config.channel.isNightlyOrDebug + + /** + * Integration of push support provided by `feature-push` component into the Gecko engine. + * + * Behind nightly flag until all fatal bugs are resolved. + * + * https://github.com/mozilla-mobile/fenix/issues/9059 + */ + val webPushIntegration = Config.channel.isNightlyOrDebug } diff --git a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt index 25d4c8fb4..1cfe0611f 100644 --- a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt +++ b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt @@ -33,6 +33,7 @@ import mozilla.components.support.locale.LocaleAwareApplication import mozilla.components.support.rusthttp.RustHttpConfig import mozilla.components.support.rustlog.RustLog import mozilla.components.support.webextensions.WebExtensionSupport +import org.mozilla.fenix.FeatureFlags.webPushIntegration import org.mozilla.fenix.components.Components import org.mozilla.fenix.components.metrics.MetricServiceType import org.mozilla.fenix.ext.settings @@ -183,8 +184,10 @@ open class FenixApplication : LocaleAwareApplication() { // Install the AutoPush singleton to receive messages. PushProcessor.install(it) - // WebPush integration to observe and deliver push messages to engine. - WebPushEngineIntegration(components.core.engine, it).start() + if (webPushIntegration) { + // WebPush integration to observe and deliver push messages to engine. + WebPushEngineIntegration(components.core.engine, it).start() + } // Perform a one-time initialization of the account manager if a message is received. PushFxaIntegration(it, lazy { components.backgroundServices.accountManager }).launch()