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

Commit 69b71191 authored by Hongwei Wang's avatar Hongwei Wang Committed by Automerger Merge Worker
Browse files

Merge "Reparent PiP to split screen on exit" into rvc-dev am: 11affeca am:...

Merge "Reparent PiP to split screen on exit" into rvc-dev am: 11affeca am: f0caffa0 am: 5c0d240a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11973248

Change-Id: I3c575851870def8a7f42242107a1ca451f7f28dc
parents 2feff4d3 5c0d240a
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -273,8 +273,7 @@ public class PipTaskOrganizer extends TaskOrganizer implements
            sendOnPipTransitionStarted(direction);
            // Don't bother doing an animation if the display rotation differs or if it's in
            // a non-supported windowing mode
            wct.setWindowingMode(mToken, WINDOWING_MODE_UNDEFINED);
            wct.setActivityWindowingMode(mToken, WINDOWING_MODE_UNDEFINED);
            applyWindowingModeChangeOnExit(wct, direction);
            WindowOrganizer.applyTransaction(wct);
            // Send finished callback though animation is ignored.
            sendOnPipTransitionFinished(direction);
@@ -303,6 +302,16 @@ public class PipTaskOrganizer extends TaskOrganizer implements
        mExitingPip = true;
    }

    private void applyWindowingModeChangeOnExit(WindowContainerTransaction wct, int direction) {
        // Reset the final windowing mode.
        wct.setWindowingMode(mToken, getOutPipWindowingMode());
        // Simply reset the activity mode set prior to the animation running.
        wct.setActivityWindowingMode(mToken, WINDOWING_MODE_UNDEFINED);
        if (mSplitDivider != null && direction == TRANSITION_DIRECTION_TO_SPLIT_SCREEN) {
            wct.reparent(mToken, mSplitDivider.getSecondaryRoot(), true /* onTop */);
        }
    }

    /**
     * Removes PiP immediately.
     */
@@ -745,13 +754,7 @@ public class PipTaskOrganizer extends TaskOrganizer implements
            // on the task to ensure that the task "matches" the parent's bounds.
            taskBounds = (direction == TRANSITION_DIRECTION_TO_FULLSCREEN)
                    ? null : destinationBounds;
            // Reset the final windowing mode.
            wct.setWindowingMode(mToken, getOutPipWindowingMode());
            // Simply reset the activity mode set prior to the animation running.
            wct.setActivityWindowingMode(mToken, WINDOWING_MODE_UNDEFINED);
            if (mSplitDivider != null && direction == TRANSITION_DIRECTION_TO_SPLIT_SCREEN) {
                wct.reparent(mToken, mSplitDivider.getSecondaryRoot(), true /* onTop */);
            }
            applyWindowingModeChangeOnExit(wct, direction);
        } else {
            // Just a resize in PIP
            taskBounds = destinationBounds;