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
This commit is contained in:
Vinit Nayak 2021-11-26 11:44:05 -08:00
parent b78cbf29e5
commit 09a822a6fe
1 changed files with 13 additions and 3 deletions

View File

@ -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