diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-09-11 14:24:50 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-09-11 14:24:50 +0200 |
commit | 2dd5387cc7b2c0831c6628eca6462e5d03dec6e5 (patch) | |
tree | e18cb3acf71dfb2bf8a038c274eccfd6b9070ae0 /hal | |
parent | 580de72a3fb7bfb0e1bc45138249668399165283 (diff) | |
download | uxp-2dd5387cc7b2c0831c6628eca6462e5d03dec6e5.tar.gz |
Bug 1469309 - Remove an unused sensor type.
Diffstat (limited to 'hal')
-rw-r--r-- | hal/Hal.cpp | 1 | ||||
-rw-r--r-- | hal/HalSensor.h | 3 | ||||
-rw-r--r-- | hal/sandbox/SandboxHal.cpp | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/hal/Hal.cpp b/hal/Hal.cpp index 16201a2d8d..e60a3ee618 100644 --- a/hal/Hal.cpp +++ b/hal/Hal.cpp @@ -590,6 +590,7 @@ UnregisterSensorObserver(SensorType aSensor, ISensorObserver *aObserver) { AssertMainThread(); if (!gSensorObservers) { + HAL_ERR("Un-registering a sensor when none have been registered"); return; } diff --git a/hal/HalSensor.h b/hal/HalSensor.h index 551c4271d5..5175629c9a 100644 --- a/hal/HalSensor.h +++ b/hal/HalSensor.h @@ -18,7 +18,6 @@ namespace hal { * If you add or change any here, do the same in GeckoHalDefines.java. */ enum SensorType { - SENSOR_UNKNOWN = -1, SENSOR_ORIENTATION = 0, SENSOR_ACCELERATION = 1, SENSOR_PROXIMITY = 2, @@ -63,7 +62,7 @@ namespace IPC { struct ParamTraits<mozilla::hal::SensorType>: public ContiguousEnumSerializer< mozilla::hal::SensorType, - mozilla::hal::SENSOR_UNKNOWN, + mozilla::hal::SENSOR_ORIENTATION, mozilla::hal::NUM_SENSOR_TYPE> { }; diff --git a/hal/sandbox/SandboxHal.cpp b/hal/sandbox/SandboxHal.cpp index 9771b3ef64..5501d459bd 100644 --- a/hal/sandbox/SandboxHal.cpp +++ b/hal/sandbox/SandboxHal.cpp @@ -16,6 +16,7 @@ #include "mozilla/dom/battery/Types.h" #include "mozilla/dom/network/Types.h" #include "mozilla/dom/ScreenOrientation.h" +#include "mozilla/EnumeratedRange.h" #include "mozilla/Observer.h" #include "mozilla/Unused.h" #include "nsAutoPtr.h" @@ -404,9 +405,8 @@ public: hal::UnregisterBatteryObserver(this); hal::UnregisterNetworkObserver(this); hal::UnregisterScreenConfigurationObserver(this); - for (int32_t sensor = SENSOR_UNKNOWN + 1; - sensor < NUM_SENSOR_TYPE; ++sensor) { - hal::UnregisterSensorObserver(SensorType(sensor), this); + for (auto sensor : MakeEnumeratedRange(NUM_SENSOR_TYPE)) { + hal::UnregisterSensorObserver(sensor, this); } hal::UnregisterWakeLockObserver(this); hal::UnregisterSystemClockChangeObserver(this); |