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

Commit d5e232d1 authored by Aaron Liu's avatar Aaron Liu Committed by Automerger Merge Worker
Browse files

Merge "[Bouncer] Force bouncer into portrait mode." into tm-dev am: b560e960 am: f073f77e

parents 1f446242 f073f77e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -333,7 +333,7 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
    }
    }


    private void adjustScreenOrientation(State state) {
    private void adjustScreenOrientation(State state) {
        if (state.isKeyguardShowingAndNotOccluded() || state.mDozing) {
        if (state.mBouncerShowing || state.isKeyguardShowingAndNotOccluded() || state.mDozing) {
            if (mKeyguardStateController.isKeyguardScreenRotationAllowed()) {
            if (mKeyguardStateController.isKeyguardScreenRotationAllowed()) {
                mLpChanged.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_USER;
                mLpChanged.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_USER;
            } else {
            } else {
+14 −0
Original line number Original line Diff line number Diff line
@@ -26,6 +26,7 @@ import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.clearInvocations;
import static org.mockito.Mockito.clearInvocations;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.reset;
@@ -309,4 +310,17 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase {
        });
        });
        verify(mWindowManager).updateViewLayout(any(), any());
        verify(mWindowManager).updateViewLayout(any(), any());
    }
    }

    @Test
    public void bouncerShowing_OrientationNoSensor() {
        mNotificationShadeWindowController.setKeyguardShowing(true);
        mNotificationShadeWindowController.setKeyguardOccluded(true);
        mNotificationShadeWindowController.setBouncerShowing(true);
        when(mKeyguardStateController.isKeyguardScreenRotationAllowed()).thenReturn(false);
        mNotificationShadeWindowController.onConfigChanged(new Configuration());

        verify(mWindowManager, atLeastOnce()).updateViewLayout(any(), mLayoutParameters.capture());
        assertThat(mLayoutParameters.getValue().screenOrientation)
                .isEqualTo(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);
    }
}
}