From 1f4cce9ab3587a4c383507ed62d687e67cd1c05f Mon Sep 17 00:00:00 2001 From: Evan Rosky Date: Thu, 16 Mar 2023 10:03:34 -0700 Subject: Fix bug in mixedhandler merging Forgot to set subanimation count for a pass-through so it wouldn't merge things. Bug: 265749851 Test: launch/close apps quickly from launcher Change-Id: I27a807fdd29e174e985c833a83b01e4278b7a9c5 --- .../wm/shell/transition/DefaultMixedHandler.java | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 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 d0948923dc6e..aa851d1bd30f 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 @@ -272,13 +272,18 @@ public class DefaultMixedHandler implements Transitions.TransitionHandler { info.getChanges().remove(i); } } + Transitions.TransitionFinishCallback finishCB = (wct, wctCB) -> { + --mixed.mInFlightSubAnimations; + mixed.joinFinishArgs(wct, wctCB); + if (mixed.mInFlightSubAnimations > 0) return; + mActiveTransitions.remove(mixed); + finishCallback.onTransitionFinished(mixed.mFinishWCT, wctCB); + }; if (pipChange == null) { if (mixed.mLeftoversHandler != null) { + mixed.mInFlightSubAnimations = 1; if (mixed.mLeftoversHandler.startAnimation(mixed.mTransition, - info, startTransaction, finishTransaction, (wct, wctCB) -> { - mActiveTransitions.remove(mixed); - finishCallback.onTransitionFinished(wct, wctCB); - })) { + info, startTransaction, finishTransaction, finishCB)) { return true; } } @@ -287,13 +292,6 @@ public class DefaultMixedHandler implements Transitions.TransitionHandler { } ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, " Splitting PIP into a separate" + " animation because remote-animation likely doesn't support it"); - Transitions.TransitionFinishCallback finishCB = (wct, wctCB) -> { - --mixed.mInFlightSubAnimations; - mixed.joinFinishArgs(wct, wctCB); - if (mixed.mInFlightSubAnimations > 0) return; - mActiveTransitions.remove(mixed); - finishCallback.onTransitionFinished(mixed.mFinishWCT, wctCB); - }; // Split the transition into 2 parts: the pip part and the rest. mixed.mInFlightSubAnimations = 2; // make a new startTransaction because pip's startEnterAnimation "consumes" it so -- cgit v1.2.3-59-g8ed1b