From 6c2115cf4aba61b28fd1a5dda74d40a5cbdef3f0 Mon Sep 17 00:00:00 2001 From: Marc Leclair Date: Mon, 21 Jun 2021 17:08:16 -0400 Subject: [PATCH] [fenix] For 19804:Fixed call order in the --- app/src/main/java/org/mozilla/fenix/utils/Settings.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/app/src/main/java/org/mozilla/fenix/utils/Settings.kt index c3de3cfd24..1a722a49f8 100644 --- a/app/src/main/java/org/mozilla/fenix/utils/Settings.kt +++ b/app/src/main/java/org/mozilla/fenix/utils/Settings.kt @@ -476,9 +476,10 @@ class Settings(private val appContext: Context) : PreferencesHolder { */ fun checkDefaultBrowserAndSet(): Boolean { val prefKey = appContext.getPreferenceKey(R.string.pref_key_default_browser) - val isDefaultBrowser = isDefaultBrowser() - this.preferences.edit().putBoolean(prefKey, isDefaultBrowser).apply() - return this.preferences.getBoolean(prefKey, isDefaultBrowser) != isDefaultBrowser + val isDefaultBrowserNow = isDefaultBrowser() + val isDefaultBrowserBefore = this.preferences.getBoolean(prefKey, isDefaultBrowserNow) + this.preferences.edit().putBoolean(prefKey, isDefaultBrowserNow).apply() + return isDefaultBrowserNow != isDefaultBrowserBefore } /**