From c3250f583fec4a366d8368f4561f71028ee6559d Mon Sep 17 00:00:00 2001 From: Zac McKenney Date: Fri, 30 Dec 2022 10:16:48 -0800 Subject: [PATCH] [fenix] For bug 1807716: Move engine warmup above Glean initialization to fix crash at launch --- app/src/main/java/org/mozilla/fenix/FenixApplication.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt index 537bf9bb08..46e3b0da1e 100644 --- a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt +++ b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt @@ -203,6 +203,11 @@ open class FenixApplication : LocaleAwareApplication(), Provider { ProfilerMarkerFactProcessor.create { components.core.engine.profiler }.register() run { + // Make sure the engine is initialized and ready to use. + components.strictMode.resetAfter(StrictMode.allowThreadDiskReads()) { + components.core.engine.warmUp() + } + // We need to always initialize Glean and do it early here. initializeGlean() @@ -213,10 +218,6 @@ open class FenixApplication : LocaleAwareApplication(), Provider { components.strictMode.enableStrictMode(true) warmBrowsersCache() - // Make sure the engine is initialized and ready to use. - components.strictMode.resetAfter(StrictMode.allowThreadDiskReads()) { - components.core.engine.warmUp() - } initializeWebExtensionSupport() if (FeatureFlags.storageMaintenanceFeature) { // Make sure to call this function before registering a storage worker