[Overview Actions] For in-place landscape, add select only when aiai works. am: ff6bc2ab5f

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/11873444

Change-Id: I3de8007af26460090220122c084587014b80b871
This commit is contained in:
Becky Qiu
2020-06-17 17:42:49 +00:00
committed by Automerger Merge Worker
@@ -70,10 +70,19 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
// 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 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
TaskShortcutFactory.WELLBEING
};
private static final TaskShortcutFactory[] ACTION_MENU_OPTIONS = new TaskShortcutFactory[]{
TaskShortcutFactory.SCREENSHOT,
TaskShortcutFactory.MODAL
};
/**
* Overlay on each task handling Overview Action Buttons.
*/