2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

Integrate service-experiments component (#4098)

This commit is contained in:
Travis Long 2019-08-05 11:14:42 -05:00 committed by Colin Lee
parent a526e0fad3
commit 51218bc93e
3 changed files with 11 additions and 0 deletions

View File

@ -332,6 +332,7 @@ dependencies {
implementation Deps.mozilla_service_firefox_accounts
implementation Deps.mozilla_service_fretboard
implementation Deps.mozilla_service_glean
implementation Deps.mozilla_service_experiments
implementation Deps.mozilla_support_ktx
implementation Deps.mozilla_support_rustlog

View File

@ -18,6 +18,7 @@ import kotlinx.coroutines.async
import kotlinx.coroutines.runBlocking
import mozilla.appservices.Megazord
import mozilla.components.concept.push.PushProcessor
import mozilla.components.service.experiments.Experiments
import mozilla.components.service.fretboard.Fretboard
import mozilla.components.service.fretboard.source.kinto.KintoExperimentSource
import mozilla.components.service.fretboard.storage.flatfile.FlatFileExperimentStorage
@ -71,6 +72,14 @@ open class FenixApplication : Application() {
// on the main process, as it uses Gecko to fetch experiments from the server.
experimentLoader = loadExperiments()
// Enable the service-experiments component
Experiments.initialize(
applicationContext,
mozilla.components.service.experiments.Configuration(
httpClient = lazy(LazyThreadSafetyMode.NONE) { components.core.client }
)
)
setupLeakCanary()
if (Settings.getInstance(this).isTelemetryEnabled) {
components.analytics.metrics.start()

View File

@ -128,6 +128,7 @@ object Deps {
const val mozilla_service_firefox_accounts = "org.mozilla.components:service-firefox-accounts:${Versions.mozilla_android_components}"
const val mozilla_service_fretboard = "org.mozilla.components:service-fretboard:${Versions.mozilla_android_components}"
const val mozilla_service_glean = "org.mozilla.components:service-glean:${Versions.mozilla_android_components}"
const val mozilla_service_experiments = "org.mozilla.components:service-experiments:${Versions.mozilla_android_components}"
const val mozilla_ui_colors = "org.mozilla.components:ui-colors:${Versions.mozilla_android_components}"
const val mozilla_ui_icons = "org.mozilla.components:ui-icons:${Versions.mozilla_android_components}"