From 12202411d3cbdb2c477147555842a78a050c10d0 Mon Sep 17 00:00:00 2001 From: Sachin Date: Tue, 28 Jul 2020 16:26:18 -0700 Subject: [PATCH] [fenix] for https://github.com/mozilla-mobile/fenix/issues/11698 added on demand workmanager initialization (https://github.com/mozilla-mobile/fenix/pull/12739) --- app/src/main/AndroidManifest.xml | 5 +++++ app/src/main/java/org/mozilla/fenix/FenixApplication.kt | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d523a44c5d..c2dbb8fbe3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -282,6 +282,11 @@ + + diff --git a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt index ec45fd0581..201ba43d12 100644 --- a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt +++ b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt @@ -8,9 +8,12 @@ import android.annotation.SuppressLint import android.os.Build import android.os.Build.VERSION.SDK_INT import android.os.StrictMode +import android.util.Log.INFO import androidx.annotation.CallSuper import androidx.appcompat.app.AppCompatDelegate import androidx.core.content.getSystemService +import androidx.work.Configuration.Provider +import androidx.work.Configuration.Builder import kotlinx.coroutines.Deferred import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope @@ -53,7 +56,7 @@ import org.mozilla.fenix.utils.BrowsersCache * Installs [CrashReporter], initializes [Glean] in fenix builds and setup Megazord in the main process. */ @Suppress("Registered", "TooManyFunctions", "LargeClass") -open class FenixApplication : LocaleAwareApplication() { +open class FenixApplication : LocaleAwareApplication(), Provider { init { recordOnInit() // DO NOT MOVE ANYTHING ABOVE HERE: the timing of this measurement is critical. } @@ -420,4 +423,6 @@ open class FenixApplication : LocaleAwareApplication() { companion object { private const val KINTO_ENDPOINT_PROD = "https://firefox.settings.services.mozilla.com/v1" } + + override fun getWorkManagerConfiguration() = Builder().setMinimumLoggingLevel(INFO).build() }