clairehurst pushed to branch tor-browser-152.0a1-16.0-2 at The Tor Project / Applications / Tor Browser Commits: 631e5e4c by clairehurst at 2026-06-08T11:34:52-06:00 [android] Disable features and functionality tb#44175: Remove all default browser functionality (Android) - - - - - 3 changed files: - mobile/android/fenix/app/src/main/AndroidManifest.xml - mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt - mobile/android/fenix/app/src/main/res/xml/preferences.xml Changes: ===================================== mobile/android/fenix/app/src/main/AndroidManifest.xml ===================================== @@ -521,7 +521,6 @@ <data android:host="home"/> <data android:host="home_collections"/> <data android:host="install_search_widget"/> - <data android:host="make_default_browser"/> <data android:host="open"/> <data android:host="settings"/> <data android:host="settings_accessibility"/> @@ -560,54 +559,6 @@ android:exported="true" android:excludeFromRecents="true" > - <!-- - Respond to `Intent.makeMainSelectorActivity(Intent.ACTION_MAIN, Intent.CATEGORY_APP_BROWSER)` - --> - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - <category android:name="android.intent.category.APP_BROWSER"/> - <category android:name="android.intent.category.DEFAULT"/> - </intent-filter> - - <intent-filter> - <action android:name="android.intent.action.VIEW" /> - - <category android:name="android.intent.category.DEFAULT" /> - <category android:name="android.intent.category.BROWSABLE" /> - <category android:name="mozilla.components.pwa.category.SHORTCUT" /> - <data android:scheme="http" /> - <data android:scheme="https" /> - </intent-filter> - - <!--Exposed specific deep links for third-party apps to open wallpaper settings.--> - <intent-filter> - <action android:name="android.intent.action.VIEW" /> - <category android:name="android.intent.category.BROWSABLE" /> - <category android:name="android.intent.category.DEFAULT" /> - <data android:scheme="${deepLinkScheme}" - android:host="settings_wallpapers"/> - </intent-filter> - - <intent-filter> - <action android:name="android.intent.action.VIEW" /> - - <category android:name="android.intent.category.BROWSABLE" /> - <category android:name="android.intent.category.DEFAULT" /> - - <data android:scheme="http" /> - <data android:scheme="https" /> - <data android:mimeType="text/html" /> - <data android:mimeType="text/plain" /> - <data android:mimeType="application/xhtml+xml" /> - </intent-filter> - -<!-- - <intent-filter> - <action android:name="android.intent.action.SEND" /> - <category android:name="android.intent.category.DEFAULT" /> - <data android:mimeType="text/plain" /> - </intent-filter> ---> <intent-filter> <action android:name="android.intent.action.SEARCH" /> ===================================== mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt ===================================== @@ -615,8 +615,6 @@ class SettingsFragment : PreferenceFragmentCompat(), SystemInsetsPaddedFragment, val debuggingKey = getPreferenceKey(R.string.pref_key_remote_debugging) val preferenceLeakCanary = findPreference<Preference>(leakKey) val preferenceRemoteDebugging = findPreference<Preference>(debuggingKey) - val preferenceMakeDefaultBrowser = - requirePreference<DefaultBrowserPreference>(R.string.pref_key_make_default_browser) // Copied from PrivateBrowsingFragment with some removals requirePreference<SwitchPreferenceCompat>(R.string.pref_key_allow_screenshots_in_private_mode).apply { @@ -648,12 +646,6 @@ class SettingsFragment : PreferenceFragmentCompat(), SystemInsetsPaddedFragment, true } - preferenceMakeDefaultBrowser.apply { - updateSwitch() - onPreferenceClickListener = - getClickListenerForMakeDefaultBrowser() - } - val preferenceStartProfiler = findPreference<Preference>(getPreferenceKey(R.string.pref_key_start_profiler)) @@ -700,30 +692,6 @@ class SettingsFragment : PreferenceFragmentCompat(), SystemInsetsPaddedFragment, setupConnectionPreferences() } - private val setToDefaultPromptRequestLauncher: ActivityResultLauncher<Intent> = - registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result -> - with(requireContext()) { - maybeNavigateToSystemSetToDefaultAction(result.resultCode, settings(), dateTimeProvider) { - navigateToDefaultBrowserAppsSettings(BuildManufacturerChecker()) - } - } - } - - /** - * For >=Q -> Use new RoleManager API to show in-app browser switching dialog. - * For <Q && >=N -> Navigate user to Android Default Apps Settings. - * For <N -> Open sumo page to show user how to change default app. - */ - private fun getClickListenerForMakeDefaultBrowser(): Preference.OnPreferenceClickListener { - return Preference.OnPreferenceClickListener { - maybeRequestDefaultBrowserPrompt( - WeakReference((requireActivity() as? HomeActivity)), - setToDefaultPromptRequestLauncher, - ) - true - } - } - private fun navigateFromSettings(directions: NavDirections) { view?.findNavController()?.let { navController -> if (navController.currentDestination?.id == R.id.settingsFragment) { ===================================== mobile/android/fenix/app/src/main/res/xml/preferences.xml ===================================== @@ -108,11 +108,6 @@ app:iconSpaceReserved="false" app:isPreferenceVisible="false" android:title="@string/preferences_import_bookmarks" /> - - <org.mozilla.fenix.settings.DefaultBrowserPreference - android:key="@string/pref_key_make_default_browser" - app:iconSpaceReserved="false" - android:title="@string/preferences_set_as_default_browser" /> </androidx.preference.PreferenceCategory> <androidx.preference.PreferenceCategory View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/631e5e4c... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/631e5e4c... You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
participants (1)
-
clairehurst (@clairehurst)