For #27627 - Check the TCP CFR status lazily

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.
This commit is contained in:
Mugurell 2022-10-31 18:39:06 +02:00 committed by mergify[bot]
parent bc76907605
commit 50c8e56bd2
1 changed files with 3 additions and 2 deletions

View File

@ -610,9 +610,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(