[SDK-246] Change Nimbus `channel` input to use the same method as Glean (#18766) (#18801)

Co-authored-by: Travis Long <tlong@mozilla.com>
Co-authored-by: Gabriel Luong <gabriel.luong@gmail.com>
This commit is contained in:
Janet Dragojevic 2021-04-05 15:10:03 -04:00 committed by GitHub
parent 457dfd0905
commit d6a8728b86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -14,7 +14,7 @@ import mozilla.components.service.nimbus.NimbusAppInfo
import mozilla.components.service.nimbus.NimbusDisabled
import mozilla.components.service.nimbus.NimbusServerSettings
import mozilla.components.support.base.log.logger.Logger
import org.mozilla.fenix.Config
import org.mozilla.fenix.BuildConfig
import org.mozilla.fenix.components.isSentryEnabled
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.settings
@ -47,7 +47,10 @@ fun createNimbus(context: Context, url: String?): NimbusApi =
// https://github.com/mozilla/probe-scraper/blob/master/repositories.yaml
val appInfo = NimbusAppInfo(
appName = "fenix",
channel = Config.channel.toString()
// Note: Using BuildConfig.BUILD_TYPE is important here so that it matches the value
// passed into Glean. `Config.channel.toString()` turned out to be non-deterministic
// and would mostly produce the value `Beta` and rarely would produce `beta`.
channel = BuildConfig.BUILD_TYPE
)
Nimbus(context, appInfo, serverSettings).apply {
// This performs the minimal amount of work required to load branch and enrolment data