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

Commit 65634122 authored by Alex Florescu's avatar Alex Florescu
Browse files

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
parent 5214873a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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;