diff options
author | Jeff Brown <jeffbrown@google.com> | 2011-01-23 13:05:44 -0800 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2011-01-23 13:05:44 -0800 |
commit | 892bd76881e2df9b4915a30144efc5428f7ab5a3 (patch) | |
tree | 6cd4828e17dafbdfd05bbad2c6a57e643b46d973 /policy | |
parent | 3a27acef4e72d80bbbe0618b50785a2945ef4910 (diff) | |
download | frameworks_base-892bd76881e2df9b4915a30144efc5428f7ab5a3.zip frameworks_base-892bd76881e2df9b4915a30144efc5428f7ab5a3.tar.gz frameworks_base-892bd76881e2df9b4915a30144efc5428f7ab5a3.tar.bz2 |
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
Diffstat (limited to 'policy')
-rwxr-xr-x | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 747242f..0d0e89c 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -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); } |