summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ats Jenk <atsjenk@google.com> 2023-10-02 17:29:22 -0700
committer Ats Jenk <atsjenk@google.com> 2023-10-05 17:04:30 -0700
commitb97aedb8c64a3cc63061213d100ab350cbe1742d (patch)
treed5ab9dfaf138b0a2371f0fc4a0653c275e990755
parent9286cb9fdffa8e2058b56f294e1fcc5d5498c3b0 (diff)
Fix recents animation tracking for desktop
Make sure recents animation triggered from desktop can be merged with new app launch animation. When live tile is active in recents, the recents animation continues to run. When tapping on another app to launch it, the launch animation gets merged with the existing recents animation. When setting up the recents animation for desktop, we were not correctly setting the sub animation tracker which caused the merge to be skipped (it was assumed there are no pending animations). Skipping the merge caused the recents animation (triggered from desktop) to remain in a pending state and we never cleared it up. Which left launcher in a bad state and caused issues for new app launches. Bug: 297590571 Test: manual, open an app on desktop, swipe up to overview, tap on another fullscreen app, check that is launches correctly Change-Id: I2e1f241b42e55eb0a7b5c3d0b9c956fa036767f5
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultMixedHandler.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultMixedHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultMixedHandler.java
index 83dc7fa5e869..e828eedc275c 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultMixedHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultMixedHandler.java
@@ -23,6 +23,7 @@ import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_TO_BACK;
import static android.window.TransitionInfo.FLAG_IS_WALLPAPER;
+
import static com.android.wm.shell.common.split.SplitScreenConstants.FLAG_IS_DIVIDER_BAR;
import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_UNDEFINED;
import static com.android.wm.shell.pip.PipAnimationController.ANIM_TYPE_ALPHA;
@@ -693,9 +694,19 @@ public class DefaultMixedHandler implements Transitions.TransitionHandler,
@NonNull SurfaceControl.Transaction startTransaction,
@NonNull SurfaceControl.Transaction finishTransaction,
@NonNull Transitions.TransitionFinishCallback finishCallback) {
+ Transitions.TransitionFinishCallback finishCB = wct -> {
+ mixed.mInFlightSubAnimations--;
+ if (mixed.mInFlightSubAnimations == 0) {
+ mActiveTransitions.remove(mixed);
+ finishCallback.onTransitionFinished(wct);
+ }
+ };
+
+ mixed.mInFlightSubAnimations++;
boolean consumed = mRecentsHandler.startAnimation(
- mixed.mTransition, info, startTransaction, finishTransaction, finishCallback);
+ mixed.mTransition, info, startTransaction, finishTransaction, finishCB);
if (!consumed) {
+ mixed.mInFlightSubAnimations--;
return false;
}
if (mDesktopTasksController != null) {