From 09a822a6fe32a53cb4378177f920f31a051f89b6 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Fri, 26 Nov 2021 11:44:05 -0800 Subject: [PATCH] Schedule OverviewCommandHelper callbacks for GroupedTaskView * Schedule runnables to clear pending queue in OverviewCommandHelper similar to how TaskView does it. * End callbacks get run when recents animation finishes in RecentsView in the case of live tile when recents animation is still running OR in directly when the split remote animation finishes Bug: 207845542 Change-Id: I7e858ce55b08cde6436d44f2e857e28b73458f0b --- .../android/quickstep/views/GroupedTaskView.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java index 00f541d4c6..b43626b50e 100644 --- a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java +++ b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java @@ -157,10 +157,20 @@ public class GroupedTaskView extends TaskView { @Nullable @Override public RunnableList launchTaskAnimated() { - getRecentsView().getSplitPlaceholder().launchTasks(this /*groupedTaskView*/, - null /*callback*/, + if (mTask == null || mSecondaryTask == null) { + return null; + } + + RunnableList endCallback = new RunnableList(); + RecentsView recentsView = getRecentsView(); + // Callbacks run from remote animation when recents animation not currently running + recentsView.getSplitPlaceholder().launchTasks(this /*groupedTaskView*/, + success -> endCallback.executeAllAndDestroy(), false /* freezeTaskList */); - return null; + + // Callbacks get run from recentsView for case when recents animation already running + recentsView.addSideTaskLaunchCallback(endCallback); + return endCallback; } @Override