am 5f1e37a7: am f4180679: Merge "Fix SENSOR_LANDSCAPE and SENSOR_PORTRAIT" into honeycomb

* commit '5f1e37a736928bbb38f665d12812a1bed3394fa3':
  Fix SENSOR_LANDSCAPE and SENSOR_PORTRAIT
This commit is contained in:
Jeff Brown
2011-01-23 13:42:50 -08:00
committed by Android Git Automerger

View File

@@ -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);
}