Bug 1469309 - Remove an unused sensor type.

This commit is contained in:
wolfbeast 2018-09-11 14:24:50 +02:00 • committed by Roy Tam
commit d3a845d2fc
3 changed files with 5 additions and 5 deletions

View file

@ -587,6 +587,7 @@ UnregisterSensorObserver(SensorType aSensor, ISensorObserver *aObserver) {
AssertMainThread(); AssertMainThread();
if (!gSensorObservers) { if (!gSensorObservers) {
HAL_ERR("Un-registering a sensor when none have been registered");
return; return;
} }

View file

@ -18,7 +18,6 @@ namespace hal {
* If you add or change any here, do the same in GeckoHalDefines.java. * If you add or change any here, do the same in GeckoHalDefines.java.
*/ */
enum SensorType { enum SensorType {
SENSOR_UNKNOWN = -1,
SENSOR_ORIENTATION = 0, SENSOR_ORIENTATION = 0,
SENSOR_ACCELERATION = 1, SENSOR_ACCELERATION = 1,
SENSOR_PROXIMITY = 2, SENSOR_PROXIMITY = 2,
@ -63,7 +62,7 @@ namespace IPC {
struct ParamTraits<mozilla::hal::SensorType>: struct ParamTraits<mozilla::hal::SensorType>:
public ContiguousEnumSerializer< public ContiguousEnumSerializer<
mozilla::hal::SensorType, mozilla::hal::SensorType,
mozilla::hal::SENSOR_UNKNOWN, mozilla::hal::SENSOR_ORIENTATION,
mozilla::hal::NUM_SENSOR_TYPE> { mozilla::hal::NUM_SENSOR_TYPE> {
}; };

View file

@ -16,6 +16,7 @@
#include "mozilla/dom/battery/Types.h" #include "mozilla/dom/battery/Types.h"
#include "mozilla/dom/network/Types.h" #include "mozilla/dom/network/Types.h"
#include "mozilla/dom/ScreenOrientation.h" #include "mozilla/dom/ScreenOrientation.h"
#include "mozilla/EnumeratedRange.h"
#include "mozilla/Observer.h" #include "mozilla/Observer.h"
#include "mozilla/Unused.h" #include "mozilla/Unused.h"
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
@ -404,9 +405,8 @@ public:
hal::UnregisterBatteryObserver(this); hal::UnregisterBatteryObserver(this);
hal::UnregisterNetworkObserver(this); hal::UnregisterNetworkObserver(this);
hal::UnregisterScreenConfigurationObserver(this); hal::UnregisterScreenConfigurationObserver(this);
for (int32_t sensor = SENSOR_UNKNOWN + 1; for (auto sensor : MakeEnumeratedRange(NUM_SENSOR_TYPE)) {
sensor < NUM_SENSOR_TYPE; ++sensor) { hal::UnregisterSensorObserver(sensor, this);
hal::UnregisterSensorObserver(SensorType(sensor), this);
} }
hal::UnregisterWakeLockObserver(this); hal::UnregisterWakeLockObserver(this);
hal::UnregisterSystemClockChangeObserver(this); hal::UnregisterSystemClockChangeObserver(this);