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

Commit 71784f2a authored by Tony Huang's avatar Tony Huang
Browse files

Fix black screen while pip to split screen

Race condition caused pip animation end transition later than
split screen appear transition. Fix it by set to right surface
postiion on on pip side too.

Bug: 172381920
Test: Enter pip and split screen then expand pip
Change-Id: If5470a99385b389af87db1129994610002c035fd
parent 7d058d62
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -540,9 +540,10 @@ public class PipAnimationController {
                    // WindowContainerTransaction in task organizer
                    // WindowContainerTransaction in task organizer
                    final Rect destBounds = getDestinationBounds();
                    final Rect destBounds = getDestinationBounds();
                    getSurfaceTransactionHelper().resetScale(tx, leash, destBounds);
                    getSurfaceTransactionHelper().resetScale(tx, leash, destBounds);
                    if (transitionDirection == TRANSITION_DIRECTION_LEAVE_PIP) {
                    if (isOutPipDirection(transitionDirection)) {
                        // Leaving to fullscreen, reset crop to null.
                        // Exit pip, clear scale, position and crop.
                        tx.setPosition(leash, destBounds.left, destBounds.top);
                        tx.setMatrix(leash, 1, 0, 0, 1);
                        tx.setPosition(leash, 0, 0);
                        tx.setWindowCrop(leash, 0, 0);
                        tx.setWindowCrop(leash, 0, 0);
                    } else {
                    } else {
                        getSurfaceTransactionHelper().crop(tx, leash, destBounds);
                        getSurfaceTransactionHelper().crop(tx, leash, destBounds);
+3 −4
Original line number Original line Diff line number Diff line
@@ -1016,10 +1016,9 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
            wct.setActivityWindowingMode(mToken, WINDOWING_MODE_UNDEFINED);
            wct.setActivityWindowingMode(mToken, WINDOWING_MODE_UNDEFINED);
            wct.scheduleFinishEnterPip(mToken, destinationBounds);
            wct.scheduleFinishEnterPip(mToken, destinationBounds);
        } else if (isOutPipDirection(direction)) {
        } else if (isOutPipDirection(direction)) {
            // If we are animating to fullscreen, then we need to reset the override bounds
            // If we are animating to fullscreen or split screen, then we need to reset the
            // on the task to ensure that the task "matches" the parent's bounds.
            // override bounds on the task to ensure that the task "matches" the parent's bounds.
            taskBounds = (direction == TRANSITION_DIRECTION_LEAVE_PIP)
            taskBounds = null;
                    ? null : destinationBounds;
            applyWindowingModeChangeOnExit(wct, direction);
            applyWindowingModeChangeOnExit(wct, direction);
        } else {
        } else {
            // Just a resize in PIP
            // Just a resize in PIP