Move experiments initialization and fix ktlint errors
parent
43e8e3aab4
commit
cf05840c0f
|
@ -40,10 +40,9 @@ object GeckoProvider {
|
|||
.debugLogging(Config.channel.isDebug)
|
||||
.build()
|
||||
|
||||
Experiments.withExperiment("webrender-performance-comparison-experiment") {
|
||||
branchName ->
|
||||
Experiments.withExperiment("webrender-performance-comparison-experiment") { branchName ->
|
||||
if (branchName == "disable_webrender") {
|
||||
runtimeSettings.extras.putInt("forcedisablewebrender", 1)
|
||||
runtimeSettings.extras.putInt("forcedisablewebrender", 1)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -82,6 +82,16 @@ open class FenixApplication : LocaleAwareApplication() {
|
|||
setDayNightTheme()
|
||||
enableStrictMode()
|
||||
|
||||
// Enable the service-experiments component
|
||||
if (settings().isExperimentationEnabled && Config.channel.isReleaseOrBeta) {
|
||||
Experiments.initialize(
|
||||
applicationContext,
|
||||
mozilla.components.service.experiments.Configuration(
|
||||
httpClient = lazy(LazyThreadSafetyMode.NONE) { components.core.client }
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// Make sure the engine is initialized and ready to use.
|
||||
components.core.engine.warmUp()
|
||||
|
||||
|
@ -97,16 +107,6 @@ open class FenixApplication : LocaleAwareApplication() {
|
|||
// on the main process, as it uses Gecko to fetch experiments from the server.
|
||||
experimentLoader = loadExperiments()
|
||||
|
||||
// Enable the service-experiments component
|
||||
if (settings().isExperimentationEnabled && Config.channel.isReleaseOrBeta) {
|
||||
Experiments.initialize(
|
||||
applicationContext,
|
||||
mozilla.components.service.experiments.Configuration(
|
||||
httpClient = lazy(LazyThreadSafetyMode.NONE) { components.core.client }
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// When the `fenix-test-2019-08-05` experiment is active, record its branch in Glean
|
||||
// telemetry. This will be used to validate that the experiment system correctly enrolls
|
||||
// clients and segments them into branches. Note that this will not take effect the first
|
||||
|
|
Loading…
Reference in New Issue