4

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.

  • Yeah i've read somewhere that android dozes only when the device physically at rest – mehulmpt Apr 11 '17 at 13:01
  • 1
    Movement is supposed to move the device out of full doze mode, though I haven't tested this. Android 7.0+ has a partial Doze mode that is still in force even if the device is moving. "Is there a way to programmatically tell what action woke the device from DOZE?" -- AFAIK, no. – CommonsWare Apr 11 '17 at 13:02
  • @MehulMohan Thanks, I've read that too and that is correct, but does moving the device wake it up from Doze? – Krzysztof Kubicki Apr 11 '17 at 13:03
  • @CommonsWare - Thank you.. I'll test it overnight and I'll post my results should they be meaningful. – Krzysztof Kubicki Apr 11 '17 at 13:07
  • @KrzysztofKubicki I can't say if it'll get fully out of doze, but android might start a maintenance window at the same time. https://developer.android.com/training/monitoring-device-state/doze-standby.html#understand_doze – mehulmpt Apr 11 '17 at 13:08
  • I've tested Nexus 6P and it looks like movement does wake the device up. It's just a matter of the intensity. I've also came up with a way to wake the device up from doze if we don't want it to be in doze, but that's offtopic. Generally I think this question might be marked as answered, but there isn't any answer attached :) – Krzysztof Kubicki Apr 18 '17 at 11:26

1 Answers1

1

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 :)

isamirkhaan1
  • 749
  • 7
  • 19