diff options
author | Brett Chabot <brettchabot@google.com> | 2013-05-16 19:38:08 -0700 |
---|---|---|
committer | Brett Chabot <brettchabot@google.com> | 2013-05-16 19:41:34 -0700 |
commit | 7e55c40e92882f9a27b3e55de6805e2ccb4b7db9 (patch) | |
tree | ccf27697dacc18fa8616c959f12c75cf64e63357 /policy | |
parent | 02ea97b592f453e1faf591acafe374bca74d0de4 (diff) | |
download | frameworks_base-7e55c40e92882f9a27b3e55de6805e2ccb4b7db9.zip frameworks_base-7e55c40e92882f9a27b3e55de6805e2ccb4b7db9.tar.gz frameworks_base-7e55c40e92882f9a27b3e55de6805e2ccb4b7db9.tar.bz2 |
Fix PhoneWindowManager#getUserRotationMode
This method should be reading from the ACCELEROMETER_ROTATION instead
of the USER_ROTATION setting.
Needed for uiautomator to properly restore the current auto rotation
setting after test run finishes.
Bug 8985351
Change-Id: I50f100117c0590dd65a646b584d027751ad5d3ce
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 5 |
1 files changed, 3 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 0fb3244..ba51671 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -4369,8 +4369,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { public int getUserRotationMode() { return Settings.System.getIntForUser(mContext.getContentResolver(), - Settings.System.USER_ROTATION, WindowManagerPolicy.USER_ROTATION_FREE, - UserHandle.USER_CURRENT); + Settings.System.ACCELEROMETER_ROTATION, 0, UserHandle.USER_CURRENT) != 0 ? + WindowManagerPolicy.USER_ROTATION_FREE : + WindowManagerPolicy.USER_ROTATION_LOCKED; } // User rotation: to be used when all else fails in assigning an orientation to the device |