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

Commit 1d23905a authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "0 degree rotation for orientation locking: frameworks/base" into gingerbread

parents a3eecd88 3acdc83f
Loading
Loading
Loading
Loading
+16 −15
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ public abstract class WindowOrientationListener {
    private static final String TAG = "WindowOrientationListener";
    private static final boolean DEBUG = false;
    private static final boolean localLOGV = DEBUG || Config.DEBUG;
    private static int sAccelerometerMode = 5;
    private static int sAccelerometerMode = 13;
    private SensorManager mSensorManager;
    private boolean mEnabled = false;
    private int mRate;
@@ -166,7 +166,7 @@ public abstract class WindowOrientationListener {
        public void update() {
            ContentResolver resolver = mContext.getContentResolver();
            sAccelerometerMode = Settings.System.getInt(resolver,
                    Settings.System.ACCELEROMETER_ROTATION_MODE, 5);
                    Settings.System.ACCELEROMETER_ROTATION_MODE, 13);
            if (localLOGV) Log.i(TAG, "sAccelerometerMode=" + sAccelerometerMode);
        }
    }
@@ -373,9 +373,11 @@ public abstract class WindowOrientationListener {
                return;
            }

            boolean allowed = rotation == ROTATION_0;
            if (!allowed) {
            boolean allowed = true;
            switch (rotation) {
                case ROTATION_0:
                    allowed = (sAccelerometerMode & 8) != 0;
                    break;
                case ROTATION_90:
                    allowed = (sAccelerometerMode & 1) != 0;
                    break;
@@ -386,7 +388,6 @@ public abstract class WindowOrientationListener {
                    allowed = (sAccelerometerMode & 4) != 0;
                    break;
            }
            }
            if (!allowed) {
                if (localLOGV) Log.i(TAG, " not allowed rotation = " + rotation);
                return;