Bug 734325 - implement compassneedscalibration event. r=jdm

This commit is contained in:
Doug Turner
2012-03-13 16:57:09 -07:00
parent c80134c644
commit 8d14d19e31
12 changed files with 106 additions and 8 deletions

View File

@@ -331,6 +331,11 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait)
NativeEventCallback();
break;
case AndroidGeckoEvent::SENSOR_ACCURACY:
if (curEvent->Flags() == 0)
gDeviceMotionSystem->NeedsCalibration();
break;
case AndroidGeckoEvent::ACCELERATION_EVENT:
gDeviceMotionSystem->DeviceMotionChanged(nsIDeviceMotionData::TYPE_ACCELERATION,
-curEvent->X(),
@@ -340,9 +345,9 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait)
case AndroidGeckoEvent::ORIENTATION_EVENT:
gDeviceMotionSystem->DeviceMotionChanged(nsIDeviceMotionData::TYPE_ORIENTATION,
-curEvent->Alpha(),
curEvent->Beta(),
curEvent->Gamma());
curEvent->Alpha(),
-curEvent->Beta(),
-curEvent->Gamma());
mPendingOrientationEvents = false;
break;