From 526b9a17d79d05b1e9d16d843ea47b8f286a6e52 Mon Sep 17 00:00:00 2001 From: Mugurell Date: Tue, 5 Apr 2022 13:36:17 +0300 Subject: [PATCH] For #24593 - Initialize Glean on all builds. Avoid Fennec check. This completes the work for removing the Fennec migration support. Before that, for Fenix release and beta, apps to which users might update to from old Fennec builds the Glean initialization was done separately in MigratingFenixApplication to allow time to first migrate user's telemetry setting. With the removal of the migration support it is now safe to initialize Glean in the same way for all builds and remove that Fennec check. --- app/src/main/java/org/mozilla/fenix/Config.kt | 17 ----------------- .../java/org/mozilla/fenix/FenixApplication.kt | 11 +++-------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/Config.kt b/app/src/main/java/org/mozilla/fenix/Config.kt index 702bb532a052..114eab81230e 100644 --- a/app/src/main/java/org/mozilla/fenix/Config.kt +++ b/app/src/main/java/org/mozilla/fenix/Config.kt @@ -41,18 +41,6 @@ enum class ReleaseChannel { val isNightlyOrDebug: Boolean get() = this == Debug || this == Nightly - /** - * Is this a build for a release channel that we used to ship Fennec on? - */ - val isFennec: Boolean - get() = this in fennecChannels - - /** - * Is this build for a "pure" Fenix channel that we never shipped Fennec on? - */ - val isFenix: Boolean - get() = !isFennec - /** * Is this a "Mozilla Online" build of Fenix? "Mozilla Online" is the Chinese branch of Mozilla * and this flag will be `true` for builds shipping to Chinese app stores. @@ -72,8 +60,3 @@ object Config { } } } - -private val fennecChannels: List = listOf( - ReleaseChannel.Beta, - ReleaseChannel.Release -) diff --git a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt index 023530b0d131..1def45caf7c7 100644 --- a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt +++ b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt @@ -123,13 +123,8 @@ open class FenixApplication : LocaleAwareApplication(), Provider { return } - if (Config.channel.isFenix) { - // We need to always initialize Glean and do it early here. - // Note that we are only initializing Glean here for "fenix" builds. "fennec" builds - // will initialize in MigratingFenixApplication because we first need to migrate the - // user's choice from Fennec. - initializeGlean() - } + // We need to always initialize Glean and do it early here. + initializeGlean() setupInMainProcessOnly() @@ -142,7 +137,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider { protected open fun initializeGlean() { val telemetryEnabled = settings().isTelemetryEnabled - logger.debug("Initializing Glean (uploadEnabled=$telemetryEnabled, isFennec=${Config.channel.isFennec})") + logger.debug("Initializing Glean (uploadEnabled=$telemetryEnabled})") Glean.initialize( applicationContext = this,