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

Commit 14855406 authored by Hongwei Wang's avatar Hongwei Wang
Browse files

GRANT TRUSTED_OVERLAY as part of start tx

- Make sure the TRUSTED_OVERLAY is only granted after WMShell
  successfully handled the entering PiP transition

Flag: com.android.wm.shell.enable_pip2
Bug: 436270922
Test: atest PinnedStackTests
Change-Id: Ic14f0f14100df13e7065f3cfe8737a2d711c10c9
parent 3b93cc4b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -355,6 +355,11 @@ public class PipTransition extends PipTransitionController implements
            extra.putParcelable(PIP_TASK_INFO, pipChange.getTaskInfo());
            mPipTransitionState.setState(PipTransitionState.ENTERING_PIP, extra);

            // TRUSTED_OVERLAY is granted iff Shell successfully receives the transition.
            ProtoLog.d(WM_SHELL_PICTURE_IN_PICTURE,
                    "Set TRUSTED_OVERLAY for Task#%d", pipChange.getTaskInfo().taskId);
            startTransaction.setTrustedOverlay(pipChange.getLeash(), true);

            if (isInSwipePipToHomeTransition()) {
                // If this is the second transition as a part of swipe PiP to home cuj,
                // handle this transition as a special case with no-op animation.