Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97322ad0 authored by Merissa Mitchell's avatar Merissa Mitchell
Browse files

[Pip2] Skip merge for REMOVE_PIP in mid-Recents.

In PiP2, removing PiP is starting a transition, so we get a merge signal
when trying to remove PiP in the middle of Recents.
This CL cancels the merge so that PipTransition can handle the
REMOVE_PIP transition.

Bug: 414836656
Test: atest WMShellUnitTests:com.android.wm.shell.pip2.phone
Test: atest WMShellUnitTests:com.android.wm.shell.pip.phone
Test: atest WMShellUnitTests:com.android.wm.shell.recents
Flag: com.android.wm.shell.enable_pip2
Change-Id: I49bd90cec4821877dbb36a8b4c558ae2774165a9
parent 5eadb359
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import static com.android.wm.shell.recents.RecentsTransitionStateListener.TRANSI
import static com.android.wm.shell.shared.ShellSharedConstants.KEY_EXTRA_SHELL_CAN_HAND_OFF_ANIMATION;
import static com.android.wm.shell.shared.split.SplitBounds.KEY_EXTRA_SPLIT_BOUNDS;
import static com.android.wm.shell.transition.Transitions.TRANSIT_END_RECENTS_TRANSITION;
import static com.android.wm.shell.transition.Transitions.TRANSIT_REMOVE_PIP;
import static com.android.wm.shell.transition.Transitions.TRANSIT_START_RECENTS_TRANSITION;

import android.annotation.Nullable;
@@ -987,6 +988,16 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler,
                cancel("transit_sleep");
                return;
            }

            if (info.getType() == TRANSIT_REMOVE_PIP && PipFlags.isPip2ExperimentEnabled()) {
                ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION,
                        "[%d] RecentsController.merge: transit_remove_pip", mInstanceId);
                // Cancel the merge if transition is removing PiP; PiP is on top of everything else.
                cancel(mWillFinishToHome /* toHome */, mWillFinishToHome /* withScreenshots */,
                        "transit_remove_pip");
                return;
            }

            if (mKeyguardLocked || (info.getFlags() & KEYGUARD_VISIBILITY_TRANSIT_FLAGS) != 0) {
                ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION,
                        "[%d] RecentsController.merge: keyguard is locked", mInstanceId);