Fix SENSOR_LANDSCAPE and SENSOR_PORTRAIT (DO NOT MERGE)

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.

Bug: 3381359
Change-Id: I19bd2519e7f69a24835840fbf542aa7349981029
This commit is contained in:
Jeff Brown
2011-01-23 13:05:44 -08:00
parent efebdf4bd4
commit d8bdc06f81

View File

@@ -2083,10 +2083,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return mSeascapeRotation; return mSeascapeRotation;
case ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE: case ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE:
//return either landscape rotation based on the sensor //return either landscape rotation based on the sensor
mOrientationListener.setAllow180Rotation(false); mOrientationListener.setAllow180Rotation(
isLandscapeOrSeascape(Surface.ROTATION_180));
return getCurrentLandscapeRotation(lastRotation); return getCurrentLandscapeRotation(lastRotation);
case ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT: case ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT:
mOrientationListener.setAllow180Rotation(true); mOrientationListener.setAllow180Rotation(
!isLandscapeOrSeascape(Surface.ROTATION_180));
return getCurrentPortraitRotation(lastRotation); return getCurrentPortraitRotation(lastRotation);
} }