From e68c318f1f56c718df8402af3cf2ed24e31cff20 Mon Sep 17 00:00:00 2001 From: mcarare Date: Mon, 23 Nov 2020 12:06:42 +0200 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/16353: Avoid strict mode death on reading onboarding preference. --- .../java/org/mozilla/fenix/browser/BaseBrowserFragment.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt b/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt index 9727a86840..de85e69f45 100644 --- a/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt @@ -223,8 +223,10 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, observeTabSelection(requireComponents.core.store) - if (!onboarding.userHasBeenOnboarded()) { - observeTabSource(requireComponents.core.store) + lifecycleScope.launch(IO) { + if (!onboarding.userHasBeenOnboarded()) { + observeTabSource(requireComponents.core.store) + } } requireContext().accessibilityManager.addAccessibilityStateChangeListener(this)