diff --git a/dom/system/nsDeviceSensors.cpp b/dom/system/nsDeviceSensors.cpp index a77eb39ab201..6a825b5c4968 100644 --- a/dom/system/nsDeviceSensors.cpp +++ b/dom/system/nsDeviceSensors.cpp @@ -176,7 +176,6 @@ public: sensorData.values().AppendElement(0.5f); sensorData.values().AppendElement(0.5f); sensorData.values().AppendElement(0.5f); - sensorData.accuracy() = SENSOR_ACCURACY_UNRELIABLE; mTarget->Notify(sensorData); return NS_OK; } diff --git a/hal/HalSensor.h b/hal/HalSensor.h index 551c4271d539..f6032219cc22 100644 --- a/hal/HalSensor.h +++ b/hal/HalSensor.h @@ -34,18 +34,6 @@ class SensorData; typedef Observer ISensorObserver; -/** - * Enumeration of sensor accuracy types. - */ -enum SensorAccuracyType { - SENSOR_ACCURACY_UNKNOWN = -1, - SENSOR_ACCURACY_UNRELIABLE, - SENSOR_ACCURACY_LOW, - SENSOR_ACCURACY_MED, - SENSOR_ACCURACY_HIGH, - NUM_SENSOR_ACCURACY_TYPE -}; - class SensorAccuracy; typedef Observer ISensorAccuracyObserver; @@ -66,15 +54,6 @@ namespace IPC { mozilla::hal::SENSOR_UNKNOWN, mozilla::hal::NUM_SENSOR_TYPE> { }; - - template <> - struct ParamTraits: - public ContiguousEnumSerializer< - mozilla::hal::SensorAccuracyType, - mozilla::hal::SENSOR_ACCURACY_UNKNOWN, - mozilla::hal::NUM_SENSOR_ACCURACY_TYPE> { - - }; } // namespace IPC #endif /* __HAL_SENSOR_H_ */ diff --git a/hal/cocoa/CocoaSensor.mm b/hal/cocoa/CocoaSensor.mm index a9823489f97b..8992c24768bc 100644 --- a/hal/cocoa/CocoaSensor.mm +++ b/hal/cocoa/CocoaSensor.mm @@ -73,8 +73,7 @@ UpdateHandler(nsITimer *aTimer, void *aClosure) hal::SensorData sdata(sensor, PR_Now(), - values, - hal::SENSOR_ACCURACY_UNKNOWN); + values); hal::NotifySensorChange(sdata); } } diff --git a/hal/sandbox/PHal.ipdl b/hal/sandbox/PHal.ipdl index d621dbbe2c09..b97d34c25b7d 100644 --- a/hal/sandbox/PHal.ipdl +++ b/hal/sandbox/PHal.ipdl @@ -11,7 +11,6 @@ include "mozilla/GfxMessageUtils.h"; using mozilla::dom::ScreenOrientationInternal from "mozilla/dom/ScreenOrientation.h"; using mozilla::hal::SensorType from "mozilla/HalSensor.h"; -using mozilla::hal::SensorAccuracyType from "mozilla/HalSensor.h"; using mozilla::hal::WakeLockControl from "mozilla/HalTypes.h"; using mozilla::hal::ProcessPriority from "mozilla/HalTypes.h"; using nsIntRect from "nsRect.h"; @@ -30,7 +29,6 @@ struct SensorData { SensorType sensor; PRTime timestamp; float[] values; - SensorAccuracyType accuracy; }; struct NetworkInformation { diff --git a/hal/windows/WindowsSensor.cpp b/hal/windows/WindowsSensor.cpp index 7d6040c6aa82..32987428dc57 100644 --- a/hal/windows/WindowsSensor.cpp +++ b/hal/windows/WindowsSensor.cpp @@ -92,8 +92,7 @@ public: hal::SensorData sdata(hal::SENSOR_ACCELERATION, PR_Now(), - values, - hal::SENSOR_ACCURACY_UNKNOWN); + values); hal::NotifySensorChange(sdata); return S_OK; diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java index ffed6b95f621..78ff627f3fd0 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java @@ -397,7 +397,7 @@ public class GeckoAppShell @WrapForJNI(calledFrom = "ui", dispatchTo = "gecko") /* package */ static native void onSensorChanged(int hal_type, float x, float y, float z, - float w, int accuracy, long time); + float w, long time); @WrapForJNI(calledFrom = "any", dispatchTo = "gecko") /* package */ static native void onLocationChanged(double latitude, double longitude, @@ -415,26 +415,11 @@ public class GeckoAppShell public void onAccuracyChanged(Sensor sensor, int accuracy) { } - private static int HalSensorAccuracyFor(int androidAccuracy) { - switch (androidAccuracy) { - case SensorManager.SENSOR_STATUS_UNRELIABLE: - return GeckoHalDefines.SENSOR_ACCURACY_UNRELIABLE; - case SensorManager.SENSOR_STATUS_ACCURACY_LOW: - return GeckoHalDefines.SENSOR_ACCURACY_LOW; - case SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM: - return GeckoHalDefines.SENSOR_ACCURACY_MED; - case SensorManager.SENSOR_STATUS_ACCURACY_HIGH: - return GeckoHalDefines.SENSOR_ACCURACY_HIGH; - } - return GeckoHalDefines.SENSOR_ACCURACY_UNKNOWN; - } - @Override public void onSensorChanged(SensorEvent s) { int sensor_type = s.sensor.getType(); int hal_type = 0; float x = 0.0f, y = 0.0f, z = 0.0f, w = 0.0f; - final int accuracy = HalSensorAccuracyFor(s.accuracy); // SensorEvent timestamp is in nanoseconds, Gecko expects microseconds. final long time = s.timestamp / 1000; @@ -493,7 +478,7 @@ public class GeckoAppShell break; } - GeckoAppShell.onSensorChanged(hal_type, x, y, z, w, accuracy, time); + GeckoAppShell.onSensorChanged(hal_type, x, y, z, w, time); } // Geolocation. diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoHalDefines.java b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoHalDefines.java index 3d9b97427981..9e22109ec473 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoHalDefines.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoHalDefines.java @@ -18,10 +18,4 @@ public class GeckoHalDefines public static final int SENSOR_LIGHT = 5; public static final int SENSOR_ROTATION_VECTOR = 6; public static final int SENSOR_GAME_ROTATION_VECTOR = 7; - - public static final int SENSOR_ACCURACY_UNKNOWN = -1; - public static final int SENSOR_ACCURACY_UNRELIABLE = 0; - public static final int SENSOR_ACCURACY_LOW = 1; - public static final int SENSOR_ACCURACY_MED = 2; - public static final int SENSOR_ACCURACY_HIGH = 3; }; diff --git a/widget/android/nsAppShell.cpp b/widget/android/nsAppShell.cpp index 466b47b50070..1ef41ac6c7e1 100644 --- a/widget/android/nsAppShell.cpp +++ b/widget/android/nsAppShell.cpp @@ -296,7 +296,7 @@ public: } static void OnSensorChanged(int32_t aType, float aX, float aY, float aZ, - float aW, int32_t aAccuracy, int64_t aTime) + float aW, int64_t aTime) { AutoTArray values; @@ -336,8 +336,7 @@ public: "Unknown sensor type %d", aType); } - hal::SensorData sdata(hal::SensorType(aType), aTime, values, - hal::SensorAccuracyType(aAccuracy)); + hal::SensorData sdata(hal::SensorType(aType), aTime, values); hal::NotifySensorChange(sdata); }