Dan Ballard pushed to branch tor-browser-140.3.0esr-15.0-1 at The Tor Project / Applications / Tor Browser

Commits:

4 changed files:

Changes:

  • mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
    ... ... @@ -135,12 +135,6 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
    135 135
                 onPreferenceChangeListener = SharedPreferenceUpdater()
    
    136 136
             }
    
    137 137
     
    
    138
    -        requirePreference<SwitchPreference>(R.string.pref_key_enable_recent_searches).apply {
    
    139
    -            isVisible = true
    
    140
    -            isChecked = context.settings().isRecentSearchesVisible
    
    141
    -            onPreferenceChangeListener = SharedPreferenceUpdater()
    
    142
    -        }
    
    143
    -
    
    144 138
             requirePreference<SwitchPreference>(R.string.pref_key_enable_shortcuts_suggestions).apply {
    
    145 139
                 isVisible = true
    
    146 140
                 isChecked = context.settings().isShortcutSuggestionsVisible
    

  • mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/search/SearchEngineFragment.kt
    ... ... @@ -38,29 +38,6 @@ class SearchEngineFragment : PreferenceFragmentCompat() {
    38 38
                 isVisible = !context.settings().shouldDisableNormalMode
    
    39 39
             }
    
    40 40
     
    
    41
    -        findPreference<SwitchPreference>(getString(R.string.pref_key_search_browsing_history))?.apply {
    
    42
    -            isVisible = !context.settings().shouldDisableNormalMode
    
    43
    -        }
    
    44
    -
    
    45
    -        // requirePreference<SwitchPreference>(R.string.pref_key_show_sponsored_suggestions).apply {
    
    46
    -        //     isVisible = context.settings().enableFxSuggest
    
    47
    -        // }
    
    48
    -        // requirePreference<SwitchPreference>(R.string.pref_key_show_nonsponsored_suggestions).apply {
    
    49
    -        //     isVisible = context.settings().enableFxSuggest
    
    50
    -        // }
    
    51
    -        // requirePreference<Preference>(R.string.pref_key_learn_about_fx_suggest).apply {
    
    52
    -        //     isVisible = context.settings().enableFxSuggest
    
    53
    -        // }
    
    54
    -        // requirePreference<CheckBoxPreference>(R.string.pref_key_show_trending_search_suggestions).apply {
    
    55
    -        //     isVisible = context.settings().isTrendingSearchesVisible
    
    56
    -        // }
    
    57
    -        // requirePreference<SwitchPreference>(R.string.pref_key_show_recent_search_suggestions).apply {
    
    58
    -        //     isVisible = context.settings().isRecentSearchesVisible
    
    59
    -        // }
    
    60
    -        // requirePreference<SwitchPreference>(R.string.pref_key_show_shortcuts_suggestions).apply {
    
    61
    -        //     isVisible = context.settings().isShortcutSuggestionsVisible
    
    62
    -        // }
    
    63
    -
    
    64 41
             view?.hideKeyboard()
    
    65 42
         }
    
    66 43
     
    
    ... ... @@ -80,45 +57,16 @@ class SearchEngineFragment : PreferenceFragmentCompat() {
    80 57
                     isChecked = context.settings().shouldShowSearchSuggestions
    
    81 58
                 }
    
    82 59
     
    
    83
    -        val trendingSearchSuggestionsPreference =
    
    84
    -            requirePreference<CheckBoxPreference>(R.string.pref_key_show_trending_search_suggestions).apply {
    
    85
    -                isVisible = context.settings().isTrendingSearchesVisible
    
    86
    -                isEnabled = requireContext().components.core.store.state.search
    
    87
    -                    .selectedOrDefaultSearchEngine?.trendingUrl != null &&
    
    88
    -                    context.settings().shouldShowSearchSuggestions
    
    89
    -            }
    
    90
    -
    
    91
    -        val recentSearchSuggestionsPreference =
    
    92
    -            requirePreference<SwitchPreference>(R.string.pref_key_show_recent_search_suggestions).apply {
    
    93
    -                isChecked = context.settings().shouldShowRecentSearchSuggestions
    
    94
    -            }
    
    95
    -
    
    96 60
             val autocompleteURLsPreference =
    
    97 61
                 requirePreference<SwitchPreference>(R.string.pref_key_enable_autocomplete_urls).apply {
    
    98 62
                     isChecked = context.settings().shouldAutocompleteInAwesomebar
    
    99 63
                 }
    
    100 64
     
    
    101
    -        val searchSuggestionsInPrivatePreference =
    
    102
    -            requirePreference<CheckBoxPreference>(R.string.pref_key_show_search_suggestions_in_private).apply {
    
    103
    -                isChecked = context.settings().shouldShowSearchSuggestionsInPrivate
    
    104
    -                isEnabled = context.settings().shouldShowSearchSuggestions
    
    105
    -            }
    
    106
    -
    
    107
    -        val showHistorySuggestions =
    
    108
    -            requirePreference<SwitchPreference>(R.string.pref_key_search_browsing_history).apply {
    
    109
    -                isChecked = context.settings().shouldShowHistorySuggestions
    
    110
    -            }
    
    111
    -
    
    112 65
             val showBookmarkSuggestions =
    
    113 66
                 requirePreference<SwitchPreference>(R.string.pref_key_search_bookmarks).apply {
    
    114 67
                     isChecked = context.settings().shouldShowBookmarkSuggestions
    
    115 68
                 }
    
    116 69
     
    
    117
    -        // val showSyncedTabsSuggestions =
    
    118
    -        //     requirePreference<SwitchPreference>(R.string.pref_key_search_synced_tabs).apply {
    
    119
    -        //         isChecked = context.settings().shouldShowSyncedTabsSuggestions
    
    120
    -        //     }
    
    121
    -
    
    122 70
             val showClipboardSuggestions =
    
    123 71
                 requirePreference<SwitchPreference>(R.string.pref_key_show_clipboard_suggestions).apply {
    
    124 72
                     isChecked = context.settings().shouldShowClipboardSuggestions
    
    ... ... @@ -129,32 +77,9 @@ class SearchEngineFragment : PreferenceFragmentCompat() {
    129 77
                     isChecked = context.settings().shouldShowVoiceSearch
    
    130 78
                 }
    
    131 79
     
    
    132
    -        // val showSponsoredSuggestionsPreference =
    
    133
    -        //     requirePreference<SwitchPreference>(R.string.pref_key_show_sponsored_suggestions).apply {
    
    134
    -        //         isChecked = context.settings().showSponsoredSuggestions
    
    135
    -        //         summary = getString(
    
    136
    -        //             R.string.preferences_show_sponsored_suggestions_summary,
    
    137
    -        //             getString(R.string.app_name),
    
    138
    -        //         )
    
    139
    -        //     }
    
    140
    -
    
    141
    -        // val showNonSponsoredSuggestionsPreference =
    
    142
    -        //     requirePreference<SwitchPreference>(R.string.pref_key_show_nonsponsored_suggestions).apply {
    
    143
    -        //         isChecked = context.settings().showNonSponsoredSuggestions
    
    144
    -        //         title = getString(
    
    145
    -        //             R.string.preferences_show_nonsponsored_suggestions,
    
    146
    -        //             getString(R.string.app_name),
    
    147
    -        //         )
    
    148
    -        //     }
    
    149
    -
    
    150 80
             searchSuggestionsPreference.onPreferenceChangeListener = SharedPreferenceUpdater()
    
    151
    -        showHistorySuggestions.onPreferenceChangeListener = SharedPreferenceUpdater()
    
    152 81
             showBookmarkSuggestions.onPreferenceChangeListener = SharedPreferenceUpdater()
    
    153
    -        // showSyncedTabsSuggestions.onPreferenceChangeListener = SharedPreferenceUpdater()
    
    154 82
             showClipboardSuggestions.onPreferenceChangeListener = SharedPreferenceUpdater()
    
    155
    -        searchSuggestionsInPrivatePreference.onPreferenceChangeListener = SharedPreferenceUpdater()
    
    156
    -        trendingSearchSuggestionsPreference.onPreferenceChangeListener = SharedPreferenceUpdater()
    
    157
    -        recentSearchSuggestionsPreference.onPreferenceChangeListener = SharedPreferenceUpdater()
    
    158 83
             showVoiceSearchPreference.onPreferenceChangeListener = object : Preference.OnPreferenceChangeListener {
    
    159 84
                 override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
    
    160 85
                     val newBooleanValue = newValue as? Boolean ?: return false
    
    ... ... @@ -166,17 +91,6 @@ class SearchEngineFragment : PreferenceFragmentCompat() {
    166 91
                 }
    
    167 92
             }
    
    168 93
             autocompleteURLsPreference.onPreferenceChangeListener = SharedPreferenceUpdater()
    
    169
    -
    
    170
    -        searchSuggestionsPreference.setOnPreferenceClickListener {
    
    171
    -            searchSuggestionsInPrivatePreference.isEnabled = searchSuggestionsPreference.isChecked && !requireContext().settings().shouldDisableNormalMode
    
    172
    -            trendingSearchSuggestionsPreference.isEnabled =
    
    173
    -                requireContext().components.core.store.state.search.selectedOrDefaultSearchEngine
    
    174
    -                    ?.trendingUrl != null && searchSuggestionsPreference.isChecked && !requireContext().settings().shouldDisableNormalMode
    
    175
    -            true
    
    176
    -        }
    
    177
    -
    
    178
    -        // showSponsoredSuggestionsPreference.onPreferenceChangeListener = SharedPreferenceUpdater()
    
    179
    -        // showNonSponsoredSuggestionsPreference.onPreferenceChangeListener = SharedPreferenceUpdater()
    
    180 94
         }
    
    181 95
     
    
    182 96
         override fun onPreferenceTreeClick(preference: Preference): Boolean {
    

  • mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
    ... ... @@ -1224,7 +1224,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
    1224 1224
         @VisibleForTesting
    
    1225 1225
         internal var trendingSearchSuggestionsEnabled by booleanPreference(
    
    1226 1226
             appContext.getPreferenceKey(R.string.pref_key_show_trending_search_suggestions),
    
    1227
    -        default = true,
    
    1227
    +        default = false,
    
    1228 1228
         )
    
    1229 1229
     
    
    1230 1230
         /**
    
    ... ... @@ -1233,7 +1233,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
    1233 1233
         @VisibleForTesting
    
    1234 1234
         internal var recentSearchSuggestionsEnabled by booleanPreference(
    
    1235 1235
             appContext.getPreferenceKey(R.string.pref_key_show_recent_search_suggestions),
    
    1236
    -        default = true,
    
    1236
    +        default = false,
    
    1237 1237
         )
    
    1238 1238
     
    
    1239 1239
         /**
    

  • mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml
    ... ... @@ -30,58 +30,8 @@
    30 30
                 android:defaultValue="true"
    
    31 31
                 android:key="@string/pref_key_show_search_suggestions"
    
    32 32
                 android:title="@string/preferences_show_search_suggestions" />
    
    33
    -        <CheckBoxPreference
    
    34
    -            android:defaultValue="false"
    
    35
    -            android:dependency="@string/pref_key_show_search_suggestions"
    
    36
    -            android:key="@string/pref_key_show_search_suggestions_in_private"
    
    37
    -            android:layout="@layout/checkbox_left_preference"
    
    38
    -            android:title="@string/preferences_show_search_suggestions_in_private"
    
    39
    -            app:iconSpaceReserved="false" />
    
    40
    -        <CheckBoxPreference
    
    41
    -            android:defaultValue="true"
    
    42
    -            android:dependency="@string/pref_key_show_search_suggestions"
    
    43
    -            android:key="@string/pref_key_show_trending_search_suggestions"
    
    44
    -            android:layout="@layout/checkbox_left_preference"
    
    45
    -            android:title="@string/preferences_show_trending_search_suggestions"
    
    46
    -            app:iconSpaceReserved="false" />
    
    47
    -        <SwitchPreference
    
    48
    -            app:iconSpaceReserved="false"
    
    49
    -            android:defaultValue="true"
    
    50
    -            android:key="@string/pref_key_show_recent_search_suggestions"
    
    51
    -            android:title="@string/preferences_show_recent_search_suggestions" />
    
    52 33
         </PreferenceCategory>
    
    53 34
     
    
    54
    -    <!-- <PreferenceCategory
    
    55
    -        android:title="@string/preference_search_address_bar_fx_suggest"
    
    56
    -        android:selectable="false"
    
    57
    -        app:iconSpaceReserved="false"
    
    58
    -        android:layout="@layout/preference_category_no_icon_style">
    
    59
    -        <SwitchPreference
    
    60
    -            app:iconSpaceReserved="false"
    
    61
    -            android:defaultValue="true"
    
    62
    -            android:key="@string/pref_key_show_shortcuts_suggestions"
    
    63
    -            android:title='@string/preferences_show_shortcuts' />
    
    64
    -        <SwitchPreference
    
    65
    -            app:iconSpaceReserved="false"
    
    66
    -            android:defaultValue="true"
    
    67
    -            android:key="@string/pref_key_search_synced_tabs"
    
    68
    -            android:title='@string/preferences_search_synced_tabs' />
    
    69
    -        <SwitchPreference
    
    70
    -            app:iconSpaceReserved="false"
    
    71
    -            android:key="@string/pref_key_show_nonsponsored_suggestions"
    
    72
    -            android:title="@string/preferences_show_nonsponsored_suggestions"
    
    73
    -            android:summary="@string/preferences_show_nonsponsored_suggestions_summary" />
    
    74
    -        <SwitchPreference
    
    75
    -            app:iconSpaceReserved="false"
    
    76
    -            android:key="@string/pref_key_show_sponsored_suggestions"
    
    77
    -            android:title="@string/preferences_show_sponsored_suggestions"
    
    78
    -            android:summary="@string/preferences_show_sponsored_suggestions_summary" />
    
    79
    -        <Preference
    
    80
    -            app:iconSpaceReserved="false"
    
    81
    -            android:key="@string/pref_key_learn_about_fx_suggest"
    
    82
    -            android:title="@string/preference_search_learn_about_fx_suggest" />
    
    83
    -    </PreferenceCategory> -->
    
    84
    -
    
    85 35
         <PreferenceCategory
    
    86 36
             android:title="@string/preferences_settings_address_bar"
    
    87 37
             android:selectable="false"
    
    ... ... @@ -92,11 +42,6 @@
    92 42
                 android:defaultValue="true"
    
    93 43
                 android:key="@string/pref_key_show_clipboard_suggestions"
    
    94 44
                 android:title="@string/preferences_show_clipboard_suggestions" />
    
    95
    -        <SwitchPreference
    
    96
    -            app:iconSpaceReserved="false"
    
    97
    -            android:defaultValue="true"
    
    98
    -            android:key="@string/pref_key_search_browsing_history"
    
    99
    -            android:title='@string/preferences_search_browsing_history' />
    
    100 45
             <SwitchPreference
    
    101 46
                 app:iconSpaceReserved="false"
    
    102 47
                 android:defaultValue="true"