From 1ece740e7a43d1d61a5ebd1aab3b533740f81c25 Mon Sep 17 00:00:00 2001 From: Jeremy Sim Date: Fri, 5 Apr 2024 16:21:55 -0700 Subject: [PATCH] Prevent menu items from showing on split tasks This CL changes the TaskShortcutFactory for SCREENSHOT and MODAL so that the associated menu options ("Screenshot" and "Select") don't show up on split tasks. These actions are not fully supported on splitscreen tiles (they will only work on one of the two apps), so we disable them. Bug: 327434215 Flag: N/A Test: Manual Change-Id: I121a9c28fa7570f10e13be2de6489182e3362cfc (cherry picked from commit 6a60c3b1130c96ba349b09e4f2fb5b95102b2949) Merged-In: I121a9c28fa7570f10e13be2de6489182e3362cfc --- .../src/com/android/quickstep/TaskOverlayFactory.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java index cc582d1e09..2fa3001725 100644 --- a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java +++ b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java @@ -82,9 +82,10 @@ public class TaskOverlayFactory implements ResourceBasedOverride { boolean isTablet = activity.getDeviceProfile().isTablet; boolean isGridOnlyOverview = isTablet && Flags.enableGridOnlyOverview(); - // Add overview actions to the menu when in in-place rotate landscape mode, or in - // grid-only overview. - if ((!canLauncherRotate && isInLandscape) || isGridOnlyOverview) { + // Add overview actions to the menu when: + // - single task is showing + // - in in-place rotate landscape mode, or in grid-only overview. + if (!hasMultipleTasks && ((!canLauncherRotate && isInLandscape) || isGridOnlyOverview)) { // Add screenshot action to task menu. List screenshotShortcuts = TaskShortcutFactory.SCREENSHOT .getShortcuts(activity, taskContainer);