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

Commit 892bd768 authored by Jeff Brown's avatar Jeff Brown
Browse files

Fix SENSOR_LANDSCAPE and SENSOR_PORTRAIT

Fixed a bug in the handling of SENSOR_LANDSCAPE and SENSOR_PORTAIT
on devices that have a natural landscape orientation.  The old code
was disabling 180 degree orientation detection when it shouldn't have.

Change-Id: I484a0aa44b3b8267a7d3b74bdf39c296faa7c6e3
parent 3a27acef
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2481,10 +2481,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    return mSeascapeRotation;
                case ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE:
                    //return either landscape rotation based on the sensor
                    mOrientationListener.setAllow180Rotation(false);
                    mOrientationListener.setAllow180Rotation(
                            isLandscapeOrSeascape(Surface.ROTATION_180));
                    return getCurrentLandscapeRotation(lastRotation);
                case ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT:
                    mOrientationListener.setAllow180Rotation(true);
                    mOrientationListener.setAllow180Rotation(
                            !isLandscapeOrSeascape(Surface.ROTATION_180));
                    return getCurrentPortraitRotation(lastRotation);
            }