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

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

Change-Id: I5ca2034ad6565a0493f802635b828d0fdd9f4f74
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Aaron Liu
2022-05-05 15:26:09 +00:00
committed by Automerger Merge Worker
2 changed files with 15 additions and 1 deletions

View File

@@ -333,7 +333,7 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
}
private void adjustScreenOrientation(State state) {
if (state.isKeyguardShowingAndNotOccluded() || state.mDozing) {
if (state.mBouncerShowing || state.isKeyguardShowingAndNotOccluded() || state.mDozing) {
if (mKeyguardStateController.isKeyguardScreenRotationAllowed()) {
mLpChanged.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_USER;
} else {

View File

@@ -26,6 +26,7 @@ import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.clearInvocations;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
@@ -309,4 +310,17 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase {
});
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);
}
}