2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/25933 - Ensure sponsored tiles are enable if enrolled in active experiment

This commit is contained in:
Gabriel Luong 2022-07-07 14:40:17 -04:00 committed by mergify[bot]
parent 8f8580255d
commit e0864dda85
3 changed files with 3 additions and 9 deletions

View File

@ -428,8 +428,6 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
onNimbusStartupAndUpdate()
}
})
onNimbusStartupAndUpdate()
}
private fun onNimbusStartupAndUpdate() {

View File

@ -26,15 +26,12 @@ fun featureFlagPreference(key: String, default: Boolean, featureFlag: Boolean) =
private class LazyPreference(val key: String, val default: () -> Boolean) :
ReadWriteProperty<PreferencesHolder, Boolean> {
private val property: ReadWriteProperty<PreferencesHolder, Boolean> by lazy {
booleanPreference(key, default())
}
override fun getValue(thisRef: PreferencesHolder, property: KProperty<*>) =
this.property.getValue(thisRef, property)
thisRef.preferences.getBoolean(key, default())
override fun setValue(thisRef: PreferencesHolder, property: KProperty<*>, value: Boolean) =
this.property.setValue(thisRef, property, value)
thisRef.preferences.edit().putBoolean(key, value).apply()
}
/**

View File

@ -1233,9 +1233,8 @@ class Settings(private val appContext: Context) : PreferencesHolder {
default = false
)
private val homescreenSections: Map<HomeScreenSection, Boolean> by lazy {
private val homescreenSections: Map<HomeScreenSection, Boolean> get() =
FxNimbus.features.homescreen.value().sectionsEnabled
}
var historyMetadataUIFeature by lazyFeatureFlagPreference(
appContext.getPreferenceKey(R.string.pref_key_history_metadata_feature),