summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera
diff options
context:
space:
mode:
authorDoris Liu <tianliu@google.com>2013-10-18 17:15:30 -0700
committerThe Android Automerger <android-build@google.com>2013-10-20 12:33:04 -0700
commitaa67d847edf7de3741bac6fb40cd94b8c838d0ae (patch)
treed37e2f83b7eada77758c6adb71547befaa3aaf12 /src/com/android/camera
parent071cfe6c640c014bb9503a049ec5b20e26684860 (diff)
downloadandroid_packages_apps_Snap-aa67d847edf7de3741bac6fb40cd94b8c838d0ae.tar.gz
android_packages_apps_Snap-aa67d847edf7de3741bac6fb40cd94b8c838d0ae.tar.bz2
android_packages_apps_Snap-aa67d847edf7de3741bac6fb40cd94b8c838d0ae.zip
Fix SRI orientation on manta
Bug: 11292213 Change-Id: I7977de4c5bb906eec5431e706e28118837a682e7
Diffstat (limited to 'src/com/android/camera')
-rw-r--r--src/com/android/camera/WideAnglePanoramaController.java2
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java7
-rw-r--r--src/com/android/camera/WideAnglePanoramaUI.java9
3 files changed, 16 insertions, 2 deletions
diff --git a/src/com/android/camera/WideAnglePanoramaController.java b/src/com/android/camera/WideAnglePanoramaController.java
index 6ac7c511d..d711c0942 100644
--- a/src/com/android/camera/WideAnglePanoramaController.java
+++ b/src/com/android/camera/WideAnglePanoramaController.java
@@ -30,4 +30,6 @@ public interface WideAnglePanoramaController {
public void onShutterButtonClick();
public void onPreviewUILayoutChange(int l, int t, int r, int b);
+
+ public int getCameraOrientation();
}
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java
index aa66bdcd3..a08aa66ec 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -647,6 +647,13 @@ public class WideAnglePanoramaModule
return orientation;
}
+ /** The orientation of the camera image. The value is the angle that the camera
+ * image needs to be rotated clockwise so it shows correctly on the display
+ * in its natural orientation. It should be 0, 90, 180, or 270.*/
+ public int getCameraOrientation() {
+ return mCameraOrientation;
+ }
+
public void saveHighResMosaic() {
runBackgroundThread(new Thread() {
@Override
diff --git a/src/com/android/camera/WideAnglePanoramaUI.java b/src/com/android/camera/WideAnglePanoramaUI.java
index da49638cc..2a47d233e 100644
--- a/src/com/android/camera/WideAnglePanoramaUI.java
+++ b/src/com/android/camera/WideAnglePanoramaUI.java
@@ -431,8 +431,13 @@ public class WideAnglePanoramaUI implements
}
public void flipPreviewIfNeeded() {
- if (CameraUtil.getDisplayRotation(mActivity) >= 180) {
- // In either reverse landscape or reverse portrait
+ // Rotation needed to display image correctly clockwise
+ int cameraOrientation = mController.getCameraOrientation();
+ // Display rotated counter-clockwise
+ int displayRotation = CameraUtil.getDisplayRotation(mActivity);
+ // Rotation needed to display image correctly on current display
+ int rotation = (cameraOrientation - displayRotation + 360) % 360;
+ if (rotation >= 180) {
mTextureView.setRotation(180);
} else {
mTextureView.setRotation(0);