Bug 735330 - move device motion from dom/system to hal. r=jdm

* * *
Bug 735330 - move device motion from dom/system to hal. cocoa bits. r=jdm
* * *
Bug 735330 - move device motion from dom/system to hal. window/qt/linux bits. r=jdm
* * *
Bug 735330 - move device motion from dom/system to hal. move accuracy into sensor data.  support compassneedscalibration. r=jdm
This commit is contained in:
Doug Turner
2012-03-20 14:46:14 -07:00
parent d0bb8bd558
commit 763d8ec79d
43 changed files with 237 additions and 1467 deletions

View File

@@ -43,32 +43,14 @@ using namespace mozilla::hal;
namespace mozilla {
namespace hal_impl {
/**
* Translate ID of sensor type from Sensor service to Android.
*
* Must be consistent with the definition of sensor types in
* embedding/android/GeckoAppShell.java
*/
static int
MapSensorType(SensorType aSensorType) {
return (SENSOR_UNKNOWN <= aSensorType && aSensorType < NUM_SENSOR_TYPE) ?
aSensorType + 1 : -1;
}
void
EnableSensorNotifications(SensorType aSensor) {
int androidSensor = MapSensorType(aSensor);
MOZ_ASSERT(androidSensor != -1);
AndroidBridge::Bridge()->EnableSensor(androidSensor);
AndroidBridge::Bridge()->EnableSensor(aSensor);
}
void
DisableSensorNotifications(SensorType aSensor) {
int androidSensor = MapSensorType(aSensor);
MOZ_ASSERT(androidSensor != -1);
AndroidBridge::Bridge()->DisableSensor(androidSensor);
AndroidBridge::Bridge()->DisableSensor(aSensor);
}
} // hal_impl