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

Commit 54822568 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 14cf9a42
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -515,6 +515,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;

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

        final Resources res = mContext.getResources();
        int shortSize, longSize;
@@ -5194,7 +5198,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }

        if (mForceDefaultOrientation) {
            return Surface.ROTATION_0;
            return mPanelOrientation;
        }

        synchronized (mLock) {
@@ -5334,14 +5338,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                        return lastRotation;
                    }
                    return mPortraitRotation;

                default:
                    // For USER, UNSPECIFIED, NOSENSOR, SENSOR and FULL_SENSOR,
                    // just return the preferred orientation we already calculated.
                    if (preferredRotation >= 0) {
                        return preferredRotation;
                    }
                    return Surface.ROTATION_0;
                    return mPanelOrientation;
            }
        }
    }