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

Commit 470b7b5c authored by Riddle Hsu's avatar Riddle Hsu Committed by Automerger Merge Worker
Browse files

Merge "Apply rotation animation when canceling fixed rotation" into sc-dev am:...

Merge "Apply rotation animation when canceling fixed rotation" into sc-dev am: 25a8b5f6 am: 7f4fdd89

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

Change-Id: I70d660be49639060dad2191f96d012a1905dfe86
parents a8b2419f 7f4fdd89
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -6619,9 +6619,15 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

    @Override
    void onCancelFixedRotationTransform(int originalDisplayRotation) {
        if (this != mDisplayContent.getLastOrientationSource()
                || getRequestedConfigurationOrientation() != ORIENTATION_UNDEFINED) {
            // Only need to handle the activity that should be rotated with display.
        if (this != mDisplayContent.getLastOrientationSource()) {
            // This activity doesn't affect display rotation.
            return;
        }
        final int requestedOrientation = getRequestedConfigurationOrientation();
        if (requestedOrientation != ORIENTATION_UNDEFINED
                && requestedOrientation != mDisplayContent.getConfiguration().orientation) {
            // Only need to handle the activity that can be rotated with display or the activity
            // has requested the same orientation.
            return;
        }

+9 −0
Original line number Diff line number Diff line
@@ -1723,6 +1723,15 @@ public class ActivityRecordTests extends WindowTestsBase {

        assertFalse(display.hasTopFixedRotationLaunchingApp());
        assertFalse(activity.hasFixedRotationTransform());

        // Simulate that the activity requests the same orientation as display.
        activity.setOrientation(display.getConfiguration().orientation);
        // Skip the real freezing.
        activity.mVisibleRequested = false;
        clearInvocations(activity);
        activity.onCancelFixedRotationTransform(originalRotation);
        // The implementation of cancellation must be executed.
        verify(activity).startFreezingScreen(originalRotation);
    }

    @Test