Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #27627 - Check the TCP CFR status lazily
Browse files Browse the repository at this point in the history
Use lazyFeatureFlagPreference as a quick small way to avoid a race between
initializing the value and the Nimbus initialization based on which the value
should be calculated.
This is the same flow that the other MR experiments use.

(cherry picked from commit 50c8e56)
  • Loading branch information
Mugurell authored and rvandermeulen committed Nov 1, 2022
1 parent 7e3f2e6 commit fe4cd77
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/src/main/java/org/mozilla/fenix/utils/Settings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -611,9 +611,10 @@ class Settings(private val appContext: Context) : PreferencesHolder {
/**
* Indicates if the total cookie protection CRF should be shown.
*/
var shouldShowTotalCookieProtectionCFR by booleanPreference(
var shouldShowTotalCookieProtectionCFR by lazyFeatureFlagPreference(
appContext.getPreferenceKey(R.string.pref_key_should_show_total_cookie_protection_popup),
default = mr2022Sections[Mr2022Section.TCP_CFR] == true,
featureFlag = true,
default = { mr2022Sections[Mr2022Section.TCP_CFR] == true },
)

val blockCookiesSelectionInCustomTrackingProtection by stringPreference(
Expand Down

0 comments on commit fe4cd77

Please sign in to comment.