diff options
| author | 2021-08-09 14:31:42 +0100 | |
|---|---|---|
| committer | 2021-08-11 11:01:30 +0000 | |
| commit | 656341229a5791c1d18088d8f557a097622d7367 (patch) | |
| tree | a91a604398ea485a7931d66669bc63d5bf7e7975 | |
| parent | 5214873aa8c2b5f211547894588457d6fc6169a2 (diff) | |
Read isKeyguardScreenRotationAllowed each time instead of caching
When devices change device state, the value of this can change and it
should be read again.
Fixes: 193390733
Test: manual
Change-Id: Ia9725efe5be4a9a366cc07d89c656b90a6348262
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java index d2a4a00c03bf..c52a094d4b57 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java @@ -84,8 +84,8 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW private final WindowManager mWindowManager; private final IActivityManager mActivityManager; private final DozeParameters mDozeParameters; + private final KeyguardStateController mKeyguardStateController; private final LayoutParams mLpChanged; - private final boolean mKeyguardScreenRotation; private final long mLockScreenDisplayTimeout; private final float mKeyguardPreferredRefreshRate; // takes precedence over max private final float mKeyguardMaxRefreshRate; @@ -123,8 +123,8 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW mContext = context; mWindowManager = windowManager; mActivityManager = activityManager; - mKeyguardScreenRotation = keyguardStateController.isKeyguardScreenRotationAllowed(); mDozeParameters = dozeParameters; + mKeyguardStateController = keyguardStateController; mScreenBrightnessDoze = mDozeParameters.getScreenBrightnessDoze(); mLpChanged = new LayoutParams(); mKeyguardViewMediator = keyguardViewMediator; @@ -323,7 +323,7 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW private void adjustScreenOrientation(State state) { if (state.isKeyguardShowingAndNotOccluded() || state.mDozing) { - if (mKeyguardScreenRotation) { + if (mKeyguardStateController.isKeyguardScreenRotationAllowed()) { mLpChanged.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_USER; } else { mLpChanged.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_NOSENSOR; |