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

Commit 652a6c2c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Align all rotation values according to panel orientation"

parents 19d702b9 40612b7c
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ public class KeyguardViewManager {

    private boolean mScreenOn = false;
    private LockPatternUtils mLockPatternUtils;
    private int mPanelOrientation = 0;

    private KeyguardUpdateMonitorCallback mBackgroundChanger = new KeyguardUpdateMonitorCallback() {
        @Override
@@ -106,6 +107,8 @@ public class KeyguardViewManager {
        mViewManager = viewManager;
        mViewMediatorCallback = callback;
        mLockPatternUtils = lockPatternUtils;
        mPanelOrientation =
                SystemProperties.getInt("persist.panel.orientation", 0) / 90;
    }

    /**
@@ -117,6 +120,12 @@ public class KeyguardViewManager {

        boolean enableScreenRotation = shouldEnableScreenRotation();

        if(mPanelOrientation != 0) {
            // override the enableScreen Rotation value, if the panel
            // orientation is not portrait.
            enableScreenRotation = false;
        }

        maybeCreateKeyguardLocked(enableScreenRotation, false, options);
        maybeEnableScreenRotation(enableScreenRotation);

+6 −1
Original line number Diff line number Diff line
@@ -435,6 +435,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    int mOverscanRight = 0;
    int mOverscanBottom = 0;

    // Panel Orientation default portrait
    int mPanelOrientation = Surface.ROTATION_0;

    // What we do when the user long presses on home
    private int mLongPressOnHomeBehavior;

@@ -1024,6 +1027,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            return;
        }
        mDisplay = display;
        mPanelOrientation =
            SystemProperties.getInt("persist.panel.orientation", 0) / 90;

        final Resources res = mContext.getResources();
        int shortSize, longSize;
@@ -4586,7 +4591,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    if (preferredRotation >= 0) {
                        return preferredRotation;
                    }
                    return Surface.ROTATION_0;
                    return mPanelOrientation;
            }
        }
    }