[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-128.2.0esr-14.0-1] fixup! [android] Disable features and functionality

Pier Angelo Vendrame (@pierov) git at gitlab.torproject.org
Thu Sep 5 12:23:28 UTC 2024



Pier Angelo Vendrame pushed to branch tor-browser-128.2.0esr-14.0-1 at The Tor Project / Applications / Tor Browser


Commits:
a1b5c671 by clairehurst at 2024-09-05T12:23:07+00:00
fixup! [android] Disable features and functionality

- - - - -


3 changed files:

- mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/search/SearchEngineFragment.kt
- mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
- mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml


Changes:

=====================================
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/search/SearchEngineFragment.kt
=====================================
@@ -34,15 +34,15 @@ class SearchEngineFragment : PreferenceFragmentCompat() {
             rootKey,
         )
 
-        requirePreference<SwitchPreference>(R.string.pref_key_show_sponsored_suggestions).apply {
-            isVisible = context.settings().enableFxSuggest
-        }
-        requirePreference<SwitchPreference>(R.string.pref_key_show_nonsponsored_suggestions).apply {
-            isVisible = context.settings().enableFxSuggest
-        }
-        requirePreference<Preference>(R.string.pref_key_learn_about_fx_suggest).apply {
-            isVisible = context.settings().enableFxSuggest
-        }
+//        requirePreference<SwitchPreference>(R.string.pref_key_show_sponsored_suggestions).apply {
+//            isVisible = context.settings().enableFxSuggest
+//        }
+//        requirePreference<SwitchPreference>(R.string.pref_key_show_nonsponsored_suggestions).apply {
+//            isVisible = context.settings().enableFxSuggest
+//        }
+//        requirePreference<Preference>(R.string.pref_key_learn_about_fx_suggest).apply {
+//            isVisible = context.settings().enableFxSuggest
+//        }
 
         view?.hideKeyboard()
     }
@@ -83,10 +83,10 @@ class SearchEngineFragment : PreferenceFragmentCompat() {
                 isChecked = context.settings().shouldShowBookmarkSuggestions
             }
 
-        val showSyncedTabsSuggestions =
-            requirePreference<SwitchPreference>(R.string.pref_key_search_synced_tabs).apply {
-                isChecked = context.settings().shouldShowSyncedTabsSuggestions
-            }
+//        val showSyncedTabsSuggestions =
+//            requirePreference<SwitchPreference>(R.string.pref_key_search_synced_tabs).apply {
+//                isChecked = context.settings().shouldShowSyncedTabsSuggestions
+//            }
 
         val showClipboardSuggestions =
             requirePreference<SwitchPreference>(R.string.pref_key_show_clipboard_suggestions).apply {
@@ -98,28 +98,28 @@ class SearchEngineFragment : PreferenceFragmentCompat() {
                 isChecked = context.settings().shouldShowVoiceSearch
             }
 
-        val showSponsoredSuggestionsPreference =
-            requirePreference<SwitchPreference>(R.string.pref_key_show_sponsored_suggestions).apply {
-                isChecked = context.settings().showSponsoredSuggestions
-                summary = getString(
-                    R.string.preferences_show_sponsored_suggestions_summary,
-                    getString(R.string.app_name),
-                )
-            }
-
-        val showNonSponsoredSuggestionsPreference =
-            requirePreference<SwitchPreference>(R.string.pref_key_show_nonsponsored_suggestions).apply {
-                isChecked = context.settings().showNonSponsoredSuggestions
-                title = getString(
-                    R.string.preferences_show_nonsponsored_suggestions,
-                    getString(R.string.app_name),
-                )
-            }
+//        val showSponsoredSuggestionsPreference =
+//            requirePreference<SwitchPreference>(R.string.pref_key_show_sponsored_suggestions).apply {
+//                isChecked = context.settings().showSponsoredSuggestions
+//                summary = getString(
+//                    R.string.preferences_show_sponsored_suggestions_summary,
+//                    getString(R.string.app_name),
+//                )
+//            }
+//
+//        val showNonSponsoredSuggestionsPreference =
+//            requirePreference<SwitchPreference>(R.string.pref_key_show_nonsponsored_suggestions).apply {
+//                isChecked = context.settings().showNonSponsoredSuggestions
+//                title = getString(
+//                    R.string.preferences_show_nonsponsored_suggestions,
+//                    getString(R.string.app_name),
+//                )
+//            }
 
         searchSuggestionsPreference.onPreferenceChangeListener = SharedPreferenceUpdater()
         showHistorySuggestions.onPreferenceChangeListener = SharedPreferenceUpdater()
         showBookmarkSuggestions.onPreferenceChangeListener = SharedPreferenceUpdater()
-        showSyncedTabsSuggestions.onPreferenceChangeListener = SharedPreferenceUpdater()
+//        showSyncedTabsSuggestions.onPreferenceChangeListener = SharedPreferenceUpdater()
         showClipboardSuggestions.onPreferenceChangeListener = SharedPreferenceUpdater()
         searchSuggestionsInPrivatePreference.onPreferenceChangeListener = SharedPreferenceUpdater()
         showVoiceSearchPreference.onPreferenceChangeListener = object : Preference.OnPreferenceChangeListener {
@@ -142,8 +142,8 @@ class SearchEngineFragment : PreferenceFragmentCompat() {
             true
         }
 
-        showSponsoredSuggestionsPreference.onPreferenceChangeListener = SharedPreferenceUpdater()
-        showNonSponsoredSuggestionsPreference.onPreferenceChangeListener = SharedPreferenceUpdater()
+//        showSponsoredSuggestionsPreference.onPreferenceChangeListener = SharedPreferenceUpdater()
+//        showNonSponsoredSuggestionsPreference.onPreferenceChangeListener = SharedPreferenceUpdater()
     }
 
     override fun onPreferenceTreeClick(preference: Preference): Boolean {


=====================================
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
=====================================
@@ -428,7 +428,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
 
     val shouldShowSyncedTabsSuggestions by booleanPreference(
         appContext.getPreferenceKey(R.string.pref_key_search_synced_tabs),
-        default = true,
+        default = false,
     )
 
     val shouldShowClipboardSuggestions by booleanPreference(
@@ -2002,7 +2002,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
      */
     var enableFxSuggest by lazyFeatureFlagPreference(
         key = appContext.getPreferenceKey(R.string.pref_key_enable_fxsuggest),
-        default = { FxNimbus.features.fxSuggest.value().enabled },
+        default = { false }, // { FxNimbus.features.fxSuggest.value().enabled },
         featureFlag = FeatureFlags.fxSuggest,
     )
 


=====================================
mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml
=====================================
@@ -39,52 +39,52 @@
             app:iconSpaceReserved="false" />
     </PreferenceCategory>
 
+<!--    <PreferenceCategory-->
+<!--        android:title="@string/preference_search_address_bar_fx_suggest"-->
+<!--        android:selectable="false"-->
+<!--        app:iconSpaceReserved="false"-->
+<!--        android:layout="@layout/preference_category_no_icon_style">-->
+<!--        <SwitchPreference-->
+<!--            app:iconSpaceReserved="false"-->
+<!--            android:defaultValue="true"-->
+<!--            android:key="@string/pref_key_search_synced_tabs"-->
+<!--            android:title='@string/preferences_search_synced_tabs' />-->
+<!--        <SwitchPreference-->
+<!--            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" />-->
+<!--        <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" />-->
+<!--        <Preference-->
+<!--            app:iconSpaceReserved="false"-->
+<!--            android:key="@string/pref_key_learn_about_fx_suggest"-->
+<!--            android:title="@string/preference_search_learn_about_fx_suggest" />-->
+<!--    </PreferenceCategory>-->
+
     <PreferenceCategory
-        android:title="@string/preference_search_address_bar_fx_suggest"
+        android:title="@string/preferences_settings_address_bar"
         android:selectable="false"
         app:iconSpaceReserved="false"
         android:layout="@layout/preference_category_no_icon_style">
-         <SwitchPreference
-            app:iconSpaceReserved="false"
-            android:defaultValue="true"
-            android:key="@string/pref_key_search_browsing_history"
-            android:title='@string/preferences_search_browsing_history' />
         <SwitchPreference
             app:iconSpaceReserved="false"
             android:defaultValue="true"
-            android:key="@string/pref_key_search_bookmarks"
-            android:title='@string/preferences_search_bookmarks' />
+            android:key="@string/pref_key_show_clipboard_suggestions"
+            android:title="@string/preferences_show_clipboard_suggestions" />
         <SwitchPreference
             app:iconSpaceReserved="false"
             android:defaultValue="true"
-            android:key="@string/pref_key_search_synced_tabs"
-            android:title='@string/preferences_search_synced_tabs' />
-        <SwitchPreference
-            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" />
-        <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" />
-        <Preference
-            app:iconSpaceReserved="false"
-            android:key="@string/pref_key_learn_about_fx_suggest"
-            android:title="@string/preference_search_learn_about_fx_suggest" />
-    </PreferenceCategory>
-
-    <PreferenceCategory
-        android:title="@string/preferences_settings_address_bar"
-        android:selectable="false"
-        app:iconSpaceReserved="false"
-        android:layout="@layout/preference_category_no_icon_style">
+            android:key="@string/pref_key_search_browsing_history"
+            android:title='@string/preferences_search_browsing_history' />
         <SwitchPreference
             app:iconSpaceReserved="false"
             android:defaultValue="true"
-            android:key="@string/pref_key_show_clipboard_suggestions"
-            android:title="@string/preferences_show_clipboard_suggestions" />
+            android:key="@string/pref_key_search_bookmarks"
+            android:title='@string/preferences_search_bookmarks' />
         <SwitchPreference
             app:iconSpaceReserved="false"
             android:defaultValue="true"



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/a1b5c6718448b2c501d80c7f85b872da7334f48d

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/a1b5c6718448b2c501d80c7f85b872da7334f48d
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-commits/attachments/20240905/82e8387f/attachment-0001.htm>


More information about the tor-commits mailing list