Identify if sensor works when screen is OFF in android Identify if sensor works when screen is OFF in android android android

Identify if sensor works when screen is OFF in android


After a little bit of searching I found this documentation which states

Up to KitKat, whether a sensor was a wake-up or a non-wake-up sensor was dictated by the sensor type: most were non-wake-up sensors, with the exception of the proximity sensor and the significant motion detector.

On the other hand, the significant motion detector page says

Implement only the wake-up version of this sensor. getDefaultSensor(SENSOR_TYPE_SIGNIFICANT_MOTION) returns a non-wake-up sensor

which confuses me. It is, however, a composite sensor, which means that it's wake-up-ness depends on the underlying actual sensors (I would imagine).

More research into this suggests that significant motion detector was added in Android 4.3 (API 18), so you're left with the proximity sensor for available wake-up sensors in API 14 devices, which is primarily intended to be used to turn the screen on and off when making phone calls.

Seems to me like there is no way to do exactly what you have in mind without a wake lock.