androidandroid-6.0-marshmallowandroid-7.0-nougatdoze

Does moving the device wake it up from DOZE


I'm seeking information regarding the specific behavior of Android device during DOZE mode, also known as Idle mode. My app provides sensor info periodically with setExactAndAllowIdle() method. This of course doesn't work perfectly, but since the device is (or should be) static (with screen turned off and unplug from charger) I do not need the access to the sensor. My question is: if the device is stationary and in DOZE mode, does moving the device wake it up from DOZE? I've tested with adb and the answer is no, but when I tested with a device it somewhat gave the impression that moving the device actually caused it to leave DOZE mode.

I'm specifically asking about the moving action (without turning on the screen) whether it does or does not wake the device from DOZE.

Another question is:

Is there a way to programmatically tell what action woke the device from DOZE? I'm aware of PowerManager.isDeviceIdle().

Thanks in advance for your answers.


Solution

  • As soon as the user wakes the device by moving it, turning on the screen, or connecting a charger, the system exits Doze and all apps return to normal activity
    source

    So, Yes it does make wakes up by moving.

    Is there a way to programmatically tell what action woke the device from DOZE?

    I don't think so.

    As CommonsWare have mentioned that he isn't sure about it, now I'm confident enough to simply tell you, No :)