From 58717a70c5580a9edbb41c8600cfc69b4404dc7e Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Wed, 3 May 2023 18:00:46 +0000 Subject: [PATCH] Potential fix for end callback not being run in 3-button - Context: With shell transitions, the launch of a new task is merged into the same recents transition that is running, which means that it does not run as its own independent transition (this probably needs to be addressed in the transitions level somehow) - Given the above, if there is somehow no running task id, then we still need to rely on the next task appeared to trigger the flush of the callback list (since the animation will not run to flush that callback) Bug: b/255851262 Test: Manually simulate getRunningTaskViewId() == 1 and verify Change-Id: I778f22fa59cb1620781f7aa442d244793352d74e Signed-off-by: Winson Chung --- quickstep/src/com/android/quickstep/views/TaskView.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index 53660b5040..4ccfc3344f 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -92,6 +92,7 @@ import com.android.launcher3.util.ViewPool.Reusable; import com.android.quickstep.RecentsModel; import com.android.quickstep.RemoteAnimationTargets; import com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle; +import com.android.quickstep.TaskAnimationManager; import com.android.quickstep.TaskIconCache; import com.android.quickstep.TaskOverlayFactory; import com.android.quickstep.TaskThumbnailCache; @@ -801,6 +802,14 @@ public class TaskView extends FrameLayout implements Reusable { recentsView.addSideTaskLaunchCallback(callbackList); return callbackList; } + if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) { + // If the recents transition is running (ie. in live tile mode), then the start + // of a new task will merge into the existing transition and it currently will + // not be run independently, so we need to rely on the onTaskAppeared() call + // for the new task to trigger the side launch callback to flush this runnable + // list (which is usually flushed when the app launch animation finishes) + recentsView.addSideTaskLaunchCallback(opts.onEndCallback); + } return opts.onEndCallback; } else { notifyTaskLaunchFailed(TAG);