Files
IronFox/patches/disable-firefox-suggest.patch

167 lines
8.3 KiB
Diff

diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
index aafe4dbe47..828ad9a5dd 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
@@ -118,7 +118,8 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<SwitchPreference>(R.string.pref_key_pocket_content_recommendations).apply {
- isChecked = context.settings().showContentRecommendations
+ isVisible = false
+ isChecked = false
onPreferenceChangeListener = object : SharedPreferenceUpdater() {
override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
activity?.recreate()
@@ -134,8 +135,8 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<SwitchPreference>(R.string.pref_key_enable_trending_searches).apply {
- isVisible = true
- isChecked = context.settings().isTrendingSearchesVisible
+ isVisible = false
+ isChecked = false
onPreferenceChangeListener = SharedPreferenceUpdater()
}
@@ -152,8 +153,8 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<SwitchPreference>(R.string.pref_key_enable_fxsuggest).apply {
- isVisible = FeatureFlags.FX_SUGGEST
- isChecked = context.settings().enableFxSuggest
+ isVisible = false
+ isChecked = false
onPreferenceChangeListener = object : Preference.OnPreferenceChangeListener {
override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
val newBooleanValue = newValue as? Boolean ?: return false
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 86d2ecf1dc..4b56e9d33f 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -1170,10 +1170,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
* Indicates if the user have enabled trending search in search suggestions.
*/
@VisibleForTesting
- internal var trendingSearchSuggestionsEnabled by booleanPreference(
- appContext.getPreferenceKey(R.string.pref_key_show_trending_search_suggestions),
- default = true,
- )
+ internal var trendingSearchSuggestionsEnabled = false
/**
* Indicates if the user have enabled recent search in the search suggestions setting preference.
@@ -1775,11 +1772,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
/**
* Indicates if Merino content recommendations should be shown.
*/
- var showContentRecommendations by lazyFeatureFlagPreference(
- key = appContext.getPreferenceKey(R.string.pref_key_pocket_content_recommendations),
- default = { FxNimbus.features.merinoRecommendations.value().enabled },
- featureFlag = true,
- )
+ var showContentRecommendations = false
/**
* Whether or not to display the Pocket sponsored stories parameter secret settings.
@@ -2048,11 +2041,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
/**
* Indicates if Trending Search Suggestions are enabled.
*/
- var isTrendingSearchesVisible by lazyFeatureFlagPreference(
- key = appContext.getPreferenceKey(R.string.pref_key_enable_trending_searches),
- default = { FxNimbus.features.trendingSearches.value().enabled },
- featureFlag = true,
- )
+ var isTrendingSearchesVisible = false
/**
* Indicates if Recent Search Suggestions are enabled.
@@ -2118,17 +2107,12 @@ class Settings(private val appContext: Context) : PreferencesHolder {
/**
* Indicates if Firefox Suggest is enabled.
*/
- var enableFxSuggest by lazyFeatureFlagPreference(
- key = appContext.getPreferenceKey(R.string.pref_key_enable_fxsuggest),
- default = { FxNimbus.features.fxSuggest.value().enabled },
- featureFlag = FeatureFlags.FX_SUGGEST,
- )
+ var enableFxSuggest = false
/**
* Indicates if boosting AMP/wiki suggestions is enabled.
*/
- val boostAmpWikiSuggestions: Boolean
- get() = FxNimbus.features.fxSuggest.value().boostAmpWiki
+ val boostAmpWikiSuggestions: Boolean = false
/**
* Indicates first time engaging with signup
@@ -2142,22 +2126,14 @@ class Settings(private val appContext: Context) : PreferencesHolder {
* Indicates if the user has chosen to show sponsored search suggestions in the awesomebar.
* The default value is computed lazily, and based on whether Firefox Suggest is enabled.
*/
- var showSponsoredSuggestions by lazyFeatureFlagPreference(
- key = appContext.getPreferenceKey(R.string.pref_key_show_sponsored_suggestions),
- default = { enableFxSuggest },
- featureFlag = FeatureFlags.FX_SUGGEST,
- )
+ var showSponsoredSuggestions = false
/**
* Indicates if the user has chosen to show search suggestions for web content in the
* awesomebar. The default value is computed lazily, and based on whether Firefox Suggest
* is enabled.
*/
- var showNonSponsoredSuggestions by lazyFeatureFlagPreference(
- key = appContext.getPreferenceKey(R.string.pref_key_show_nonsponsored_suggestions),
- default = { enableFxSuggest },
- featureFlag = FeatureFlags.FX_SUGGEST,
- )
+ var showNonSponsoredSuggestions = false
/**
* Indicates that the user does not want warned of a translations
diff --git a/mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml b/mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml
index f7ca109331..0c88b25fb5 100644
--- a/mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml
+++ b/mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml
@@ -38,12 +38,13 @@
android:title="@string/preferences_show_search_suggestions_in_private"
app:iconSpaceReserved="false" />
<CheckBoxPreference
- android:defaultValue="true"
+ android:defaultValue="false"
android:dependency="@string/pref_key_show_search_suggestions"
android:key="@string/pref_key_show_trending_search_suggestions"
android:layout="@layout/checkbox_left_preference"
android:title="@string/preferences_show_trending_search_suggestions"
- app:iconSpaceReserved="false" />
+ app:iconSpaceReserved="false"
+ app:isPreferenceVisible="false" />
<SwitchPreference
app:iconSpaceReserved="false"
android:defaultValue="true"
@@ -80,16 +81,19 @@
app:iconSpaceReserved="false"
android:key="@string/pref_key_show_nonsponsored_suggestions"
android:title="@string/preferences_show_nonsponsored_suggestions"
- android:summary="@string/preferences_show_nonsponsored_suggestions_summary" />
+ android:summary="@string/preferences_show_nonsponsored_suggestions_summary"
+ app:isPreferenceVisible="false" />
<SwitchPreference
app:iconSpaceReserved="false"
android:key="@string/pref_key_show_sponsored_suggestions"
android:title="@string/preferences_show_sponsored_suggestions"
- android:summary="@string/preferences_show_sponsored_suggestions_summary" />
+ android:summary="@string/preferences_show_sponsored_suggestions_summary"
+ app:isPreferenceVisible="false" />
<Preference
app:iconSpaceReserved="false"
android:key="@string/pref_key_learn_about_fx_suggest"
- android:title="@string/preference_search_learn_about_fx_suggest" />
+ android:title="@string/preference_search_learn_about_fx_suggest"
+ app:isPreferenceVisible="false" />
</PreferenceCategory>
<PreferenceCategory