diff options
author | Angus Kong <shkong@google.com> | 2013-09-05 17:49:06 -0700 |
---|---|---|
committer | Angus Kong <shkong@google.com> | 2013-09-05 23:00:58 -0700 |
commit | ce2b94917098f211cacaaebaa0f6b40021d3e3fa (patch) | |
tree | 094ab37f43c2edcb9b4bb9b3254be273663e2781 /src/com/android/camera/app | |
parent | fffc6a5a3458cd0a29a49f10ff5ea1834c1c98fc (diff) | |
download | android_packages_apps_Snap-ce2b94917098f211cacaaebaa0f6b40021d3e3fa.tar.gz android_packages_apps_Snap-ce2b94917098f211cacaaebaa0f6b40021d3e3fa.tar.bz2 android_packages_apps_Snap-ce2b94917098f211cacaaebaa0f6b40021d3e3fa.zip |
Respect system auto-rotate setting.
bug:10623244
Change-Id: I66757e50daf487680ac4f49d854c0f49d672b6ff
Diffstat (limited to 'src/com/android/camera/app')
-rw-r--r-- | src/com/android/camera/app/OrientationManager.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/com/android/camera/app/OrientationManager.java b/src/com/android/camera/app/OrientationManager.java index 7bf924218..ef03a0163 100644 --- a/src/com/android/camera/app/OrientationManager.java +++ b/src/com/android/camera/app/OrientationManager.java @@ -68,9 +68,12 @@ public class OrientationManager { // the framework orientation, we always set the compensation value to 0. //////////////////////////////////////////////////////////////////////////// - // Lock the framework orientation to the current device orientation + /** + * Lock the framework orientation to the current device orientation + * rotates. No effect if the system setting of auto-rotation is off. + */ public void lockOrientation() { - if (mOrientationLocked) return; + if (mOrientationLocked || mRotationLockedSetting) return; mOrientationLocked = true; if (ApiHelper.HAS_ORIENTATION_LOCK) { mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED); @@ -79,10 +82,12 @@ public class OrientationManager { } } - // Unlock the framework orientation, so it can change when the device - // rotates. + /** + * Unlock the framework orientation, so it can change when the device + * rotates. No effect if the system setting of auto-rotation is off. + */ public void unlockOrientation() { - if (!mOrientationLocked) return; + if (!mOrientationLocked || mRotationLockedSetting) return; mOrientationLocked = false; Log.d(TAG, "unlock orientation"); mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR); |