This bug is introduced by the refactoring done in ag/589395.
Bug:
18520267
Change-Id: If0df6a7d6fe3ca630839ef92dccaa78f0136bb7d
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;
}
}