[Overview Actions] For in-place landscape, add select only when aiai works.
When display orientation is not the same as device orientation, aiai won't work for select mode highlight. So we should only show the select button in task menu for in-place landscape when the display rotation is the same as the device rotation which is portrait.
Screenshot would be in the task menu for in-place landscape all the time.
Test: demo video: https://drive.google.com/file/d/1OQrjww2lFTTsthz4dB3BSa-jw943KLWp/view?usp=sharing
Change-Id: I58b6f6da234ea36eef0af5bb966c33ebda3625b8
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskOverlayFactory.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskOverlayFactory.java
index 177f9a0..0101ac7 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskOverlayFactory.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskOverlayFactory.java
@@ -70,10 +70,19 @@
// Add overview actions to the menu when in in-place rotate landscape mode.
if (!canLauncherRotate && isInLandscape) {
- for (TaskShortcutFactory actionMenuOption : ACTION_MENU_OPTIONS) {
- SystemShortcut shortcut = actionMenuOption.getShortcut(activity, taskView);
- if (shortcut != null) {
- shortcuts.add(shortcut);
+ // Add screenshot action to task menu.
+ SystemShortcut screenshotShortcut = TaskShortcutFactory.SCREENSHOT
+ .getShortcut(activity, taskView);
+ if (screenshotShortcut != null) {
+ shortcuts.add(screenshotShortcut);
+ }
+
+ // Add modal action only if display orientation is the same as the device orientation.
+ if (orientedState.getDisplayRotation() == ROTATION_0) {
+ SystemShortcut modalShortcut = TaskShortcutFactory.MODAL
+ .getShortcut(activity, taskView);
+ if (modalShortcut != null) {
+ shortcuts.add(modalShortcut);
}
}
}
@@ -104,11 +113,6 @@
TaskShortcutFactory.WELLBEING
};
- private static final TaskShortcutFactory[] ACTION_MENU_OPTIONS = new TaskShortcutFactory[]{
- TaskShortcutFactory.SCREENSHOT,
- TaskShortcutFactory.MODAL
- };
-
/**
* Overlay on each task handling Overview Action Buttons.
*/