Back out bug 735330, bug 737462, bug 734854 because they broke XUL Fennec

This commit is contained in:
Matt Brubeck
2012-03-20 16:59:24 -07:00
parent 06bd50a543
commit 7c4b6228e2
44 changed files with 1585 additions and 365 deletions

View File

@@ -43,14 +43,32 @@ 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) {
AndroidBridge::Bridge()->EnableSensor(aSensor);
int androidSensor = MapSensorType(aSensor);
MOZ_ASSERT(androidSensor != -1);
AndroidBridge::Bridge()->EnableSensor(androidSensor);
}
void
DisableSensorNotifications(SensorType aSensor) {
AndroidBridge::Bridge()->DisableSensor(aSensor);
int androidSensor = MapSensorType(aSensor);
MOZ_ASSERT(androidSensor != -1);
AndroidBridge::Bridge()->DisableSensor(androidSensor);
}
} // hal_impl