summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2013-04-15 11:35:52 -0700
committerMichael Kolb <kolby@google.com>2013-04-15 13:30:30 -0700
commitb2c323e3538820dc1da537c7a207ca6c9bd6d92b (patch)
tree57c7b03b1312d49d179158e51bc6cc1f3ed54b7c /src
parentd02932454e58d6858ec80d64932247f73dd0b19b (diff)
downloadandroid_packages_apps_Snap-b2c323e3538820dc1da537c7a207ca6c9bd6d92b.tar.gz
android_packages_apps_Snap-b2c323e3538820dc1da537c7a207ca6c9bd6d92b.tar.bz2
android_packages_apps_Snap-b2c323e3538820dc1da537c7a207ca6c9bd6d92b.zip
Lock camera orientation using FW API
Bug: 8617536 Change-Id: Id3a5ae777f6f87d24984cbca48202470651cd71c
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/app/OrientationManager.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/app/OrientationManager.java b/src/com/android/gallery3d/app/OrientationManager.java
index 0a644ef66..24201ff24 100644
--- a/src/com/android/gallery3d/app/OrientationManager.java
+++ b/src/com/android/gallery3d/app/OrientationManager.java
@@ -25,6 +25,7 @@ import android.provider.Settings;
import android.view.OrientationEventListener;
import android.view.Surface;
+import com.android.gallery3d.common.ApiHelper;
import com.android.gallery3d.ui.OrientationSource;
public class OrientationManager implements OrientationSource {
@@ -71,7 +72,11 @@ public class OrientationManager implements OrientationSource {
public void lockOrientation() {
if (mOrientationLocked) return;
mOrientationLocked = true;
- mActivity.setRequestedOrientation(calculateCurrentScreenOrientation());
+ if (ApiHelper.HAS_ORIENTATION_LOCK) {
+ mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED);
+ } else {
+ mActivity.setRequestedOrientation(calculateCurrentScreenOrientation());
+ }
}
// Unlock the framework orientation, so it can change when the device