tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 18ade056c3bedeb121032b5a57c81064f187fd57
parent 9fb40f43f57174e2d41468c5d8998ae35aa36139
Author: sarah541 <sarahkhan1107@hotmail.com>
Date:   Tue, 28 Oct 2025 17:47:03 +0000

Bug 1992002 - Remove print menu item if android automative is used r=android-reviewers,007

Differential Revision: https://phabricator.services.mozilla.com/D267878

Diffstat:
Mmobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/MenuDialogFragment.kt | 2++
Mmobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/compose/MoreSettingsSubmenu.kt | 16++++++++++------
2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/MenuDialogFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/MenuDialogFragment.kt @@ -68,6 +68,7 @@ import org.mozilla.fenix.BrowserDirection import org.mozilla.fenix.GleanMetrics.Events import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.R +import org.mozilla.fenix.automotive.isAndroidAutomotiveAvailable import org.mozilla.fenix.components.appstate.SupportedMenuNotifications import org.mozilla.fenix.components.components import org.mozilla.fenix.components.menu.compose.Addons @@ -677,6 +678,7 @@ class MenuDialogFragment : BottomSheetDialogFragment() { isOpenInAppMenuHighlighted = isOpenInAppMenuHighlighted, translationInfo = translationInfo, showShortcuts = settings.showTopSitesFeature, + isAndroidAutomotiveAvailable = context.isAndroidAutomotiveAvailable(), onWebCompatReporterClick = { store.dispatch(MenuAction.Navigate.WebCompatReporter) }, diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/compose/MoreSettingsSubmenu.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/compose/MoreSettingsSubmenu.kt @@ -36,6 +36,7 @@ internal fun MoreSettingsSubmenu( isOpenInAppMenuHighlighted: Boolean, translationInfo: TranslationInfo, showShortcuts: Boolean, + isAndroidAutomotiveAvailable: Boolean, onWebCompatReporterClick: () -> Unit, onShortcutsMenuClick: () -> Unit, onAddToHomeScreenMenuClick: () -> Unit, @@ -113,12 +114,13 @@ internal fun MoreSettingsSubmenu( beforeIconPainter = painterResource(id = iconsR.drawable.mozac_ic_save_file_24), onClick = onSaveAsPDFMenuClick, ) - - MenuItem( - label = stringResource(id = R.string.browser_menu_print_2), - beforeIconPainter = painterResource(id = iconsR.drawable.mozac_ic_print_24), - onClick = onPrintMenuClick, - ) + if (!isAndroidAutomotiveAvailable) { + MenuItem( + label = stringResource(id = R.string.browser_menu_print_2), + beforeIconPainter = painterResource(id = iconsR.drawable.mozac_ic_print_24), + onClick = onPrintMenuClick, + ) + } } } @@ -204,6 +206,7 @@ private fun MoreSettingsSubmenuPreview() { onTranslatePageMenuClick = {}, ), showShortcuts = true, + isAndroidAutomotiveAvailable = false, onWebCompatReporterClick = {}, onShortcutsMenuClick = {}, onAddToHomeScreenMenuClick = {}, @@ -245,6 +248,7 @@ private fun MoreSettingsSubmenuPrivatePreview() { onTranslatePageMenuClick = {}, ), showShortcuts = true, + isAndroidAutomotiveAvailable = false, onWebCompatReporterClick = {}, onShortcutsMenuClick = {}, onAddToHomeScreenMenuClick = {},