Fix the orientation issue for front camera.
This bug is introduced by the refactoring done in ag/589395.
Bug: 18520267
Change-Id: If0df6a7d6fe3ca630839ef92dccaa78f0136bb7d
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java
index c587ff4..c265f00 100644
--- a/src/com/android/camera/util/CameraUtil.java
+++ b/src/com/android/camera/util/CameraUtil.java
@@ -1361,11 +1361,10 @@
public static int getImageRotation(int sensorOrientation,
int deviceOrientation,
boolean isFrontCamera) {
- int rotation = (sensorOrientation + deviceOrientation) % 360;
// The sensor of front camera faces in the opposite direction from back camera.
if (isFrontCamera) {
- return (360 - rotation) % 360;
+ deviceOrientation = (360 - deviceOrientation) % 360;
}
- return rotation;
+ return (sensorOrientation + deviceOrientation) % 360;
}
}