summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Steve Block <steveblock@google.com> 2012-08-15 15:52:12 +0100
committer Steve Block <steveblock@google.com> 2012-08-16 11:04:51 +0100
commitd5be055f79615e2b80fb3fe92a35db2bc84c023d (patch)
tree6f6b5ff882a200bd4b8a1cd6348969df6571971a
parent58de1427c313e0debf2a929931e8c4065d4d46c5 (diff)
Fix alpha value for device orientation
This seems to have been incorrect since this code was first written for HC. I can only think that the error was made due to confusion between portrait and landscape mode as development switched from phones to tablets. Tested on stingray and prime. A similar fix will be required for Chrome. Change-Id: I5da13c489fdb9de340b9e6ea8868c9f1adc15bb2
-rwxr-xr-xcore/java/android/webkit/DeviceOrientationService.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/webkit/DeviceOrientationService.java b/core/java/android/webkit/DeviceOrientationService.java
index 2e8656c54364..a4d240dc9f3a 100755
--- a/core/java/android/webkit/DeviceOrientationService.java
+++ b/core/java/android/webkit/DeviceOrientationService.java
@@ -123,7 +123,7 @@ final class DeviceOrientationService implements SensorEventListener {
// The angles are in radians
float[] rotationAngles = new float[3];
SensorManager.getOrientation(deviceRotationMatrix, rotationAngles);
- double alpha = Math.toDegrees(-rotationAngles[0]) - 90.0;
+ double alpha = Math.toDegrees(-rotationAngles[0]);
while (alpha < 0.0) { alpha += 360.0; } // [0, 360)
double beta = Math.toDegrees(-rotationAngles[1]);
while (beta < -180.0) { beta += 360.0; } // [-180, 180)