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 | |
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')
-rw-r--r-- | src/com/android/camera/CameraActivity.java | 1 | ||||
-rw-r--r-- | src/com/android/camera/VideoModule.java | 2 | ||||
-rw-r--r-- | src/com/android/camera/WideAnglePanoramaModule.java | 2 | ||||
-rw-r--r-- | src/com/android/camera/app/OrientationManager.java | 15 |
4 files changed, 15 insertions, 5 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java index caaa0244d..84ebe46ae 100644 --- a/src/com/android/camera/CameraActivity.java +++ b/src/com/android/camera/CameraActivity.java @@ -768,6 +768,7 @@ public class CameraActivity extends Activity @Override public void onResume() { + // TODO: Handle this in OrientationManager. if (Settings.System.getInt(getContentResolver(), Settings.System.ACCELEROMETER_ROTATION, 0) == 0) {// auto-rotate off setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index 53cb43ae0..291c74cc5 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -683,6 +683,7 @@ public class VideoModule implements CameraModule, keepScreenOnAwhile(); + mOrientationManager.resume(); // Initialize location service. boolean recordLocation = RecordLocationPreference.get(mPreferences, mContentResolver); @@ -817,6 +818,7 @@ public class VideoModule implements CameraModule, resetScreenOn(); if (mLocationManager != null) mLocationManager.recordLocation(false); + mOrientationManager.pause(); mHandler.removeMessages(CHECK_DISPLAY_ROTATION); mHandler.removeMessages(SWITCH_CAMERA); diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java index 1756e4c70..053e99df7 100644 --- a/src/com/android/camera/WideAnglePanoramaModule.java +++ b/src/com/android/camera/WideAnglePanoramaModule.java @@ -759,6 +759,7 @@ public class WideAnglePanoramaModule public void onPauseBeforeSuper() { mPaused = true; if (mLocationManager != null) mLocationManager.recordLocation(false); + mOrientationManager.pause(); } @Override @@ -851,6 +852,7 @@ public class WideAnglePanoramaModule } keepScreenOnAwhile(); + mOrientationManager.resume(); // Initialize location service. boolean recordLocation = RecordLocationPreference.get(mPreferences, mContentResolver); 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); |