commit 3c166bee68d7ea4c970086ba13f32e57f0e3ffc7 parent caa6561733cbe52ffbd49f234eea52e6adfc86b4 Author: sarah541 <sarahkhan1107@hotmail.com> Date: Mon, 13 Oct 2025 20:04:11 +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:
2 files changed, 10 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 @@ -34,6 +34,7 @@ internal fun MoreSettingsSubmenu( isOpenInAppMenuHighlighted: Boolean, translationInfo: TranslationInfo, showShortcuts: Boolean, + isAndroidAutomotiveAvailable: Boolean, onWebCompatReporterClick: () -> Unit, onShortcutsMenuClick: () -> Unit, onAddToHomeScreenMenuClick: () -> Unit, @@ -111,12 +112,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, + ) + } } }