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

Commit 2f4ac214 authored by Craig Mautner's avatar Craig Mautner Committed by Android Git Automerger
Browse files

am 89020454: am cbb6b41a: Merge "Do not use last app rotation as default." into jb-mr1-dev

* commit '89020454':
  Do not use last app rotation as default.
parents 9d5bcfe6 89020454
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -361,6 +361,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    boolean mScreenOnEarly = false;
    boolean mScreenOnFully = false;
    boolean mOrientationSensorEnabled = false;
    int mLastSensorRotation = -1;
    int mCurrentAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
    boolean mHasSoftInput = false;
    
@@ -3721,8 +3722,17 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        synchronized (mLock) {
            int sensorRotation = mOrientationListener.getProposedRotation(); // may be -1
            if (sensorRotation < 0) {
                // Sensor is disabled, device probably just turned off.
                if (mLastSensorRotation >= 0) {
                    sensorRotation = mLastSensorRotation;
                } else {
                    // Sensor has never been enabled. Last resort is to use lastRotation.
                    sensorRotation = lastRotation;
                }
            } else {
                // Valid sensor data, save it away.
                mLastSensorRotation = sensorRotation;
            }

            final int preferredRotation;
            if (mLidState == LID_OPEN && mLidOpenRotation >= 0) {