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

Commit 2e2e4b3a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Update rotation with animating recents if the device will sleep" into sc-qpr1-dev

parents 209aec58 8bbb95fd
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -444,7 +444,9 @@ public class DisplayRotation {
            }

            if (mDisplayContent.mFixedRotationTransitionListener
                    .isTopFixedOrientationRecentsAnimating()) {
                    .isTopFixedOrientationRecentsAnimating()
                    // If screen is off or the device is going to sleep, then still allow to update.
                    && mService.mPolicy.okToAnimate(false /* ignoreScreenOn */)) {
                // During the recents animation, the closing app might still be considered on top.
                // In order to ignore its requested orientation to avoid a sensor led rotation (e.g
                // user rotating the device while the recents animation is running), we ignore
+6 −0
Original line number Diff line number Diff line
@@ -1565,6 +1565,12 @@ public class DisplayContentTests extends WindowTestsBase {
        mDisplayContent.mFixedRotationTransitionListener.onFinishRecentsAnimation();
        assertTrue(displayRotation.updateRotationUnchecked(false));

        // Rotation can be updated if the policy is not ok to animate (e.g. going to sleep).
        mDisplayContent.mFixedRotationTransitionListener.onStartRecentsAnimation(recentsActivity);
        displayRotation.setRotation((displayRotation.getRotation() + 1) % 4);
        ((TestWindowManagerPolicy) mWm.mPolicy).mOkToAnimate = false;
        assertTrue(displayRotation.updateRotationUnchecked(false));

        // Rotation can be updated if the recents animation is animating but it is not on top, e.g.
        // switching activities in different orientations by quickstep gesture.
        mDisplayContent.mFixedRotationTransitionListener.onStartRecentsAnimation(recentsActivity);