2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00
This commit is contained in:
Emily Kager 2019-08-27 15:56:16 -04:00 committed by Jeff Boek
parent dc70e530cc
commit d3cbb93b88
5 changed files with 23 additions and 5 deletions

View File

@ -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

View File

@ -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()
}
} }
} }

View File

@ -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

View File

@ -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>

View File

@ -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>