For #6219 - Reset default setting if user opts out of experiments
This commit is contained in:
parent
0242b40ce2
commit
6435a503ca
|
@ -10,6 +10,16 @@ import org.mozilla.fenix.ext.components
|
|||
import org.mozilla.fenix.ext.settings
|
||||
|
||||
object ExperimentsManager {
|
||||
fun optOutEtpExperiment(context: Context) {
|
||||
// If a user can see the ETP categories we don't want to change their settings
|
||||
if (FeatureFlags.etpCategories) return
|
||||
// Release user has opted out of ETP experiment, reset them to current default (strict)
|
||||
context.settings().setUseStrictTrackingProtection()
|
||||
context.components.useCases.settingsUseCases.updateTrackingProtection(
|
||||
context.components.core.createTrackingProtectionPolicy()
|
||||
)
|
||||
}
|
||||
|
||||
fun initEtpExperiment(context: Context) {
|
||||
// When the `fenix-etp-5651` experiment is active, set up ETP settings and GV policy.
|
||||
// Note that this will not take effect the first time the application has launched,
|
||||
|
|
|
@ -87,6 +87,10 @@ open class FenixApplication : Application() {
|
|||
httpClient = lazy(LazyThreadSafetyMode.NONE) { components.core.client }
|
||||
)
|
||||
)
|
||||
} else {
|
||||
// We should make a better way to opt out for when we have more experiments
|
||||
// See https://github.com/mozilla-mobile/fenix/issues/6278
|
||||
ExperimentsManager.optOutEtpExperiment(this)
|
||||
}
|
||||
|
||||
// When the `fenix-test-2019-08-05` experiment is active, record its branch in Glean
|
||||
|
|
Loading…
Reference in New Issue
Block a user