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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user