Bug 705009: Report DeviceMotion values in units of m/s^2, not Gs, per current spec. r=dougt
authorChris Jones <jones.chris.g@gmail.com>
Wed, 23 Nov 2011 16:27:40 -0800
changeset 82489 601d585e1e35c9ca0275dcaa1b79b08688b2ff0d
parent 82488 8e47f9fbd5f208ec75009f335a2eb32bd4305fd8
child 82490 58394a391fd269d5cc606e5b97c73a13141dec96
push idunknown
push userunknown
push dateunknown
reviewersdougt
bugs705009
milestone11.0a1
Bug 705009: Report DeviceMotion values in units of m/s^2, not Gs, per current spec. r=dougt
embedding/android/GeckoEvent.java
--- a/embedding/android/GeckoEvent.java
+++ b/embedding/android/GeckoEvent.java
@@ -143,19 +143,19 @@ public class GeckoEvent {
         if (mCount > 1)
             mP1 = new Point((int)m.getX(1), (int)m.getY(1));
     }
 
     public GeckoEvent(SensorEvent s) {
 
         if (s.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
             mType = ACCELERATION_EVENT;
-            mX = s.values[0] / SensorManager.GRAVITY_EARTH;
-            mY = s.values[1] / SensorManager.GRAVITY_EARTH;
-            mZ = s.values[2] / SensorManager.GRAVITY_EARTH;
+            mX = s.values[0];
+            mY = s.values[1];
+            mZ = s.values[2];
         }
         else {
             mType = ORIENTATION_EVENT;
             mAlpha = -s.values[0];
             mBeta = -s.values[1];
             mGamma = -s.values[2];
             Log.i("GeckoEvent", "SensorEvent type = " + s.sensor.getType() + " " + s.sensor.getName() + " " + mAlpha + " " + mBeta + " " + mGamma );
         }