From 928b3989b627e2745b337fd77a3eb9673aa8fafc Mon Sep 17 00:00:00 2001 From: mattsziklay Date: Thu, 21 Nov 2024 03:38:56 -0800 Subject: [PATCH 01/16] Implement cancel transition on tapping floating view. Cancels split select when tapping the floating task view created from the desktop split select transition, similar to other implementations of split select. Bug: 368631327 Test: Manual Flag: EXEMPT bugfix Change-Id: Ib83de3a5ff95a35627b7fac115d4e4566ec79e40 --- .../android/quickstep/util/SplitSelectStateController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java index d35a36aaea..1eb91ae047 100644 --- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java +++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java @@ -106,6 +106,7 @@ import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Optional; import java.util.function.Consumer; /** @@ -941,6 +942,10 @@ public class SplitSelectStateController { mLauncher, mLauncher.getDragLayer(), null /* thumbnail */, mAppIcon, new RectF()); + floatingTaskView.setOnClickListener(view -> + getSplitAnimationController() + .playAnimPlaceholderToFullscreen(mContainer, view, + Optional.of(() -> resetState()))); floatingTaskView.setAlpha(1); floatingTaskView.addStagingAnimation(anim, mTaskBounds, mTempRect, false /* fadeWithThumbnail */, true /* isStagedTask */); From 7a14d1b7b960706e62cf8141b210efba320eba12 Mon Sep 17 00:00:00 2001 From: Jagrut Desai Date: Thu, 21 Nov 2024 12:58:45 -0800 Subject: [PATCH 02/16] Don't recreate taskbar in Overview This cl includes - when going to overview from Launcher or Desktop Mode don't recreate taskbar and keep it a same variant as the context user was in. - user will still be able to pin/unpin taskbar in overview, but it will be recreated to the launcher context. Bug: 343882478 Test: Manual Flag: com.android.window.flags.enable_desktop_windowing_mode Change-Id: Icb62e1767a83a31422d952ca44fae96ad84ebf44 --- .../statehandlers/DesktopVisibilityController.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java b/quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java index fd0243a035..2ff9b18947 100644 --- a/quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java +++ b/quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java @@ -111,10 +111,9 @@ public class DesktopVisibilityController { public boolean areDesktopTasksVisible() { boolean desktopTasksVisible = mVisibleDesktopTasksCount > 0; if (DEBUG) { - Log.d(TAG, "areDesktopTasksVisible: desktopVisible=" + desktopTasksVisible - + " overview=" + mInOverviewState); + Log.d(TAG, "areDesktopTasksVisible: desktopVisible=" + desktopTasksVisible); } - return desktopTasksVisible && !mInOverviewState; + return desktopTasksVisible; } /** @@ -219,12 +218,8 @@ public class DesktopVisibilityController { + " currentValue=" + mInOverviewState); } if (overviewStateEnabled != mInOverviewState) { - final boolean wereDesktopTasksVisibleBefore = areDesktopTasksVisible(); mInOverviewState = overviewStateEnabled; final boolean areDesktopTasksVisibleNow = areDesktopTasksVisible(); - if (wereDesktopTasksVisibleBefore != areDesktopTasksVisibleNow) { - notifyDesktopVisibilityListeners(areDesktopTasksVisibleNow); - } if (ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY.isTrue()) { return; From d87722d396acde94160659df18566f4370d3faac Mon Sep 17 00:00:00 2001 From: Jagrut Desai Date: Fri, 22 Nov 2024 14:02:27 -0800 Subject: [PATCH 03/16] Open Task into Desktop Mode when Taksbar is in DesktopMode This cl includes - opening app from taskbar context is now aware of if taskbar is in desktop mode and opens app in Desktop Mode when user oepn any app. - This cl will not include the animation when taskbar variant is changing between launcher and desktop mode. Solution - if desktop tasks are visible we will open any app from taskbar context into Desktop windowing mode after launching the DesktopTaskView manually. We will launch desktop task from recentview first and upon end of recent animation we will launch the app. Bug: 343882478 Test: Manual Flag: com.android.window.flags.enable_desktop_windowing_mode Change-Id: I7d235179e8700755a7d6b032601136ad4296b090 --- .../taskbar/TaskbarActivityContext.java | 34 ++++++++++++++++--- .../android/quickstep/views/RecentsView.java | 13 +++++++ 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index d7e5c61215..0a83ceb147 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -1274,9 +1274,25 @@ public class TaskbarActivityContext extends BaseTaskbarContext { } else if (tag instanceof TaskItemInfo info) { RemoteTransition remoteTransition = canUnminimizeDesktopTask(info.getTaskId()) ? createUnminimizeRemoteTransition() : null; - UI_HELPER_EXECUTOR.execute(() -> - SystemUiProxy.INSTANCE.get(this).showDesktopApp( - info.getTaskId(), remoteTransition)); + + if (areDesktopTasksVisible() && recents != null) { + TaskView taskView = recents.getTaskViewByTaskId(info.getTaskId()); + if (taskView == null) return; + RunnableList runnableList = taskView.launchWithAnimation(); + if (runnableList != null) { + runnableList.add(() -> + // wrapped it in runnable here since we need the post for DW to be + // ready. if we don't other DW will be gone and only the launched task + // will show. + UI_HELPER_EXECUTOR.execute(() -> + SystemUiProxy.INSTANCE.get(this).showDesktopApp( + info.getTaskId(), remoteTransition))); + } + } else { + UI_HELPER_EXECUTOR.execute(() -> + SystemUiProxy.INSTANCE.get(this).showDesktopApp( + info.getTaskId(), remoteTransition)); + } mControllers.taskbarStashController.updateAndAnimateTransientTaskbar( /* stash= */ true); } else if (tag instanceof WorkspaceItemInfo) { @@ -1518,7 +1534,17 @@ public class TaskbarActivityContext extends BaseTaskbarContext { .launchAppPair((AppPairIcon) launchingIconView, -1 /*cuj*/))); } else { - startItemInfoActivity(itemInfos.get(0), foundTask); + if (areDesktopTasksVisible()) { + RunnableList runnableList = recents.launchDesktopTaskView(); + // Wrapping it in runnable so we post after DW is ready for the app + // launch. + if (runnableList != null) { + runnableList.add(() -> UI_HELPER_EXECUTOR.execute( + () -> startItemInfoActivity(itemInfos.get(0), foundTask))); + } + } else { + startItemInfoActivity(itemInfos.get(0), foundTask); + } } } ); diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 92c93ff9ee..41802e8dff 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -1498,6 +1498,19 @@ public abstract class RecentsView< return focusedTask != null && isTaskInExpectedScrollPosition(indexOfChild(focusedTask)); } + /** + * Launch DesktopTaskView if found. + * @return provides runnable list to attach runnable at end of Desktop Mode launch + */ + public RunnableList launchDesktopTaskView() { + for (TaskView taskView : getTaskViews()) { + if (taskView instanceof DesktopTaskView) { + return taskView.launchWithAnimation(); + } + } + return null; + } + /** * Returns a {@link TaskView} that has taskId matching {@code taskId} or null if no match. */ From 377c391a9db792be27f73e1693dab80b03783b26 Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Thu, 28 Nov 2024 02:34:58 +0000 Subject: [PATCH 04/16] Workaround for incomplete setup flow prior to Launcher tests Implemented per #11 in the bug. Bug: 374332455 Test: presubmit Flag: NONE Test change Change-Id: I0acf5d24864d47ba41dc79d9ff62b9afe0499196 --- tests/Launcher3Tests.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Launcher3Tests.xml b/tests/Launcher3Tests.xml index 270a610814..a8768609b0 100644 --- a/tests/Launcher3Tests.xml +++ b/tests/Launcher3Tests.xml @@ -48,6 +48,8 @@