From eb950c1f44894b52fd2c11534ba957a05798a472 Mon Sep 17 00:00:00 2001 From: Saumya Prakash Date: Tue, 13 Aug 2024 22:12:50 +0000 Subject: [PATCH] Disable split screen option in app menu in Desktop Mode The split screen app shortcut is not intended to work in Desktop Mode. This change removes it from Taskbar and all apps in this mode to avoid a crash. Fix: 346333758 Test: Launch the app menu for different apps in Desktop mode and in normal mode. Check that the split option only shows up in normal mode. Flag: EXEMPT bugfix Change-Id: I6e2535b41a490ad3eb5c0ebd924c49eaf5028669 --- .../android/launcher3/taskbar/TaskbarPopupController.java | 7 +++++-- .../launcher3/taskbar/TaskbarRecentAppsController.kt | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarPopupController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarPopupController.java index e80ad7a8a1..332eb9519e 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarPopupController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarPopupController.java @@ -185,10 +185,13 @@ public class TaskbarPopupController implements TaskbarControllers.LoggableTaskba // Create a Stream of all applicable system shortcuts private Stream getSystemShortcuts() { - // append split options to APP_INFO shortcut, the order here will reflect in the popup + // append split options to APP_INFO shortcut if not in Desktop Windowing mode, the order + // here will reflect in the popup ArrayList shortcuts = new ArrayList<>(); shortcuts.add(APP_INFO); - shortcuts.addAll(mControllers.uiController.getSplitMenuOptions().toList()); + if (!mControllers.taskbarRecentAppsController.isInDesktopMode()) { + shortcuts.addAll(mControllers.uiController.getSplitMenuOptions().toList()); + } if (com.android.wm.shell.Flags.enableBubbleAnything()) { shortcuts.add(BUBBLE); } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.kt index 1a168a925b..737d03198e 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.kt +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.kt @@ -81,7 +81,7 @@ class TaskbarRecentAppsController( private val desktopVisibilityController: DesktopVisibilityController? get() = desktopVisibilityControllerProvider() - private val isInDesktopMode: Boolean + val isInDesktopMode: Boolean get() = desktopVisibilityController?.areDesktopTasksVisible() ?: false val runningTaskIds: Set