import from UXP: Bug 1469309 - Remove an unused sensor type. (d3a845d2)

This commit is contained in:
2022-03-28 14:52:27 +08:00
parent 91e20b02ea
commit c0d13ec40c
3 changed files with 5 additions and 5 deletions
+1
View File
@@ -593,6 +593,7 @@ UnregisterSensorObserver(SensorType aSensor, ISensorObserver *aObserver) {
AssertMainThread();
if (!gSensorObservers) {
HAL_ERR("Un-registering a sensor when none have been registered");
return;
}
+1 -2
View File
@@ -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> {
};
+3 -3
View File
@@ -15,6 +15,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"
@@ -432,9 +433,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);