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

Commit 40612b7c authored by Ramkumar Radhakrishnan's avatar Ramkumar Radhakrishnan Committed by Gerrit - the friendly Code Review server
Browse files

Align all rotation values according to panel orientation

Align all rotation values according to the panel orientation
specified by the user in system.prop.

Change-Id: I2a2d6f42db8bd2e3c46a3a3180954c6221ab891f
parent edd639f4
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;

@@ -1016,6 +1019,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;
@@ -4563,7 +4568,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    if (preferredRotation >= 0) {
                        return preferredRotation;
                    }
                    return Surface.ROTATION_0;
                    return mPanelOrientation;
            }
        }
    }