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

Commit b58efc3a authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Only recompute new config if rotation is changed from settings" into main

parents 7757758a 72e5ed92
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -948,7 +948,7 @@ public class DisplayRotation {
        mDisplayWindowSettings.setUserRotation(mDisplayContent, userRotationMode,
                userRotation);
        if (changed) {
            mService.updateRotation(true /* alwaysSendConfiguration */,
            mService.updateRotation(false /* alwaysSendConfiguration */,
                    false /* forceRelayout */);
        }
    }
@@ -2127,7 +2127,7 @@ public class DisplayRotation {
        @Override
        public void onChange(boolean selfChange) {
            if (updateSettings()) {
                mService.updateRotation(true /* alwaysSendConfiguration */,
                mService.updateRotation(false /* alwaysSendConfiguration */,
                        false /* forceRelayout */);
            }
        }
+4 −0
Original line number Diff line number Diff line
@@ -583,6 +583,7 @@ public class DisplayRotationTests {

        enableOrientationSensor();

        clearInvocations(sMockWm);
        mOrientationSensorListener.onSensorChanged(createSensorEvent(Surface.ROTATION_90));
        assertTrue(waitForUiHandler());

@@ -627,6 +628,7 @@ public class DisplayRotationTests {
        when(mDisplayRotationImmersiveAppCompatPolicyMock.isRotationLockEnforced(
                Surface.ROTATION_90)).thenReturn(false);

        clearInvocations(sMockWm);
        // And then ActivityRecord.setRequestedOrientation calls onSetRequestedOrientation.
        mTarget.onSetRequestedOrientation();

@@ -864,6 +866,7 @@ public class DisplayRotationTests {
        assertEquals(Surface.ROTATION_270, mTarget.rotationForOrientation(
                SCREEN_ORIENTATION_UNSPECIFIED, Surface.ROTATION_0));

        clearInvocations(sMockWm);
        // ... until half-fold
        mTarget.foldStateChanged(DeviceStateController.DeviceState.HALF_FOLDED);
        assertTrue(waitForUiHandler());
@@ -899,6 +902,7 @@ public class DisplayRotationTests {
        assertEquals(Surface.ROTATION_270, mTarget.rotationForOrientation(
                SCREEN_ORIENTATION_UNSPECIFIED, Surface.ROTATION_0));

        clearInvocations(sMockWm);
        // ... half-fold -> still no rotation
        mTarget.foldStateChanged(DeviceStateController.DeviceState.HALF_FOLDED);
        assertTrue(waitForUiHandler());