mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-19 09:25:34 +00:00
[fenix] For https://github.com/mozilla-mobile/fenix/issues/4295 - Adds Experiments Pref to Data Collection Settings (https://github.com/mozilla-mobile/fenix/pull/4915)
This commit is contained in:
parent
dc70e530cc
commit
d3cbb93b88
@ -74,12 +74,14 @@ open class FenixApplication : Application() {
|
|||||||
experimentLoader = loadExperiments()
|
experimentLoader = loadExperiments()
|
||||||
|
|
||||||
// Enable the service-experiments component
|
// Enable the service-experiments component
|
||||||
|
if (Settings.getInstance(this).isExperimentationEnabled) {
|
||||||
Experiments.initialize(
|
Experiments.initialize(
|
||||||
applicationContext,
|
applicationContext,
|
||||||
mozilla.components.service.experiments.Configuration(
|
mozilla.components.service.experiments.Configuration(
|
||||||
httpClient = lazy(LazyThreadSafetyMode.NONE) { components.core.client }
|
httpClient = lazy(LazyThreadSafetyMode.NONE) { components.core.client }
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// When the `fenix-test-2019-08-05` experiment is active, record its branch in Glean
|
// When the `fenix-test-2019-08-05` experiment is active, record its branch in Glean
|
||||||
// telemetry. This will be used to validate that the experiment system correctly enrolls
|
// telemetry. This will be used to validate that the experiment system correctly enrolls
|
||||||
|
@ -63,5 +63,10 @@ class DataChoicesFragment : PreferenceFragmentCompat() {
|
|||||||
|
|
||||||
onPreferenceChangeListener = SharedPreferenceUpdater()
|
onPreferenceChangeListener = SharedPreferenceUpdater()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
findPreference<SwitchPreference>(getPreferenceKey(R.string.pref_key_experimentation))?.apply {
|
||||||
|
isChecked = Settings.getInstance(context).isExperimentationEnabled
|
||||||
|
onPreferenceChangeListener = SharedPreferenceUpdater()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,6 +90,11 @@ class Settings private constructor(
|
|||||||
default = true
|
default = true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val isExperimentationEnabled by booleanPreference(
|
||||||
|
appContext.getPreferenceKey(R.string.pref_key_experimentation),
|
||||||
|
default = true
|
||||||
|
)
|
||||||
|
|
||||||
val shouldAutoBounceQuickActionSheet: Boolean
|
val shouldAutoBounceQuickActionSheet: Boolean
|
||||||
get() = autoBounceQuickActionSheetCount < autoBounceMaximumCount
|
get() = autoBounceQuickActionSheetCount < autoBounceMaximumCount
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
<string name="pref_key_theme" translatable="false">pref_key_theme</string>
|
<string name="pref_key_theme" translatable="false">pref_key_theme</string>
|
||||||
<string name="pref_key_leakcanary" translatable="false">pref_key_leakcanary</string>
|
<string name="pref_key_leakcanary" translatable="false">pref_key_leakcanary</string>
|
||||||
<string name="pref_key_remote_debugging" translatable="false">pref_key_remote_debugging</string>
|
<string name="pref_key_remote_debugging" translatable="false">pref_key_remote_debugging</string>
|
||||||
|
<string name="pref_key_experimentation" translatable="false">pref_key_experimentation</string>
|
||||||
|
|
||||||
<!-- Data Choices -->
|
<!-- Data Choices -->
|
||||||
<string name="pref_key_telemetry" translatable="false">pref_key_telemetry</string>
|
<string name="pref_key_telemetry" translatable="false">pref_key_telemetry</string>
|
||||||
|
@ -9,4 +9,9 @@
|
|||||||
android:summary="@string/preferences_usage_data_description"
|
android:summary="@string/preferences_usage_data_description"
|
||||||
android:title="@string/preference_usage_data"
|
android:title="@string/preference_usage_data"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
<androidx.preference.SwitchPreference
|
||||||
|
android:key="@string/pref_key_experimentation"
|
||||||
|
android:summary="@string/preference_experiments_summary"
|
||||||
|
android:title="@string/preference_experiments"
|
||||||
|
app:iconSpaceReserved="false" />
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
Loading…
Reference in New Issue
Block a user