Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #24593 - Initialize Glean on all builds. Avoid Fennec check.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Mugurell authored and mergify[bot] committed Apr 5, 2022
1 parent 6136748 commit 526b9a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
17 changes: 0 additions & 17 deletions app/src/main/java/org/mozilla/fenix/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -72,8 +60,3 @@ object Config {
}
}
}

private val fennecChannels: List<ReleaseChannel> = listOf(
ReleaseChannel.Beta,
ReleaseChannel.Release
)
11 changes: 3 additions & 8 deletions app/src/main/java/org/mozilla/fenix/FenixApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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,
Expand Down

0 comments on commit 526b9a1

Please sign in to comment.