summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-01-23 13:05:44 -0800
committerJeff Brown <jeffbrown@google.com>2011-01-24 17:07:36 -0800
commitd8bdc06f8139231f1edc1a8bf22b637ebb790605 (patch)
tree3dc757b3f59469d3730944ea3a897c6e13a583af /policy
parentefebdf4bd4da35bc50c7d81450c8473697f6654a (diff)
downloadframeworks_base-d8bdc06f8139231f1edc1a8bf22b637ebb790605.zip
frameworks_base-d8bdc06f8139231f1edc1a8bf22b637ebb790605.tar.gz
frameworks_base-d8bdc06f8139231f1edc1a8bf22b637ebb790605.tar.bz2
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
Diffstat (limited to 'policy')
-rwxr-xr-xpolicy/src/com/android/internal/policy/impl/PhoneWindowManager.java6
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 92c41d8..f934e6b 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -2083,10 +2083,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);
}