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

Commit 5dfa3625 authored by Kazuki Takise's avatar Kazuki Takise
Browse files

Request transtion when PiP gets removed

I4c13ecc1b3c1dff15bd0d61aeafeacc1d7705460 added a call to
`requestCloseTransitionIfNeeded()` in
`removePinnedRootTaskInSurfaceTransaction` to ensure that a shell
transition runs when PiP gets removed, but the CL was reverted
due to a CTS regression.

Iec89dcdd0081eca1f26161aaead1662f0f661ab6 added the logic not to
introduce the regression but in the CL we forgot to handle the
original intention of calling `requestCloseTransitionIfNeeded()`,
which this CL takes care of.

One note is that, it turns out removing PiP is acutally not CLOSE
but TO_BACK given that it just involves windowing mode and z-order
changes, so with this CL, a TO_BACK transition is requested.

Bug: 303767495
Test: atest PinnedStackTests
Change-Id: I0821cf62ef54c7f41266b2e8bbc6927da9778483
parent 1d461a86
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import static android.os.Process.SYSTEM_UID;
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Display.INVALID_DISPLAY;
import static android.view.WindowManager.TRANSIT_TO_BACK;
import static android.view.WindowManager.TRANSIT_TO_FRONT;

import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_STATES;
@@ -1592,6 +1593,9 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
    }

    private void removePinnedRootTaskInSurfaceTransaction(Task rootTask) {
        rootTask.mTransitionController.requestTransitionIfNeeded(TRANSIT_TO_BACK, 0 /* flags */,
                rootTask, rootTask.mDisplayContent, null /* remoteTransition */,
                null /* displayChange */);
        /**
         * Workaround: Force-stop all the activities in the root pinned task before we reparent them
         * to the fullscreen root task.  This is to guarantee that when we are removing a root task,