You should not worry about when the device goes into dose mode, and not how the application works when the phone is in dose mode. To test this, you just need to make your phone doze and watch the behavior of your application:
$ adb version Android Debug Bridge version 1.0.32 Revision eac51f2bb6a8-android $ adb shell dumpsys deviceidle | grep mState mState=ACTIVE $ adb shell dumpsys deviceidle force-idle Now forced in to idle mode $ adb shell dumpsys deviceidle | grep mState mState=IDLE
Even better, you should test your application in all different conditions before a dose:
$ adb shell dumpsys deviceidle step Stepped to: ACTIVE $ adb shell dumpsys battery unplug
You must test your application in all of the above conditions to ensure proper operation. See also white papers .
Now, if you insist on knowing the dosage and maintenance parameters, you should consult with the full release of adb shell dumpsys deviceidle . When the device is IDLE , near the end of the output you will see:
mNextAlarmTime=+59m35s863ms
which comes from:
idle_to=+60m0s0ms
In addition, if the user has not woken up the phone, the following waiting timeout will be longer, which will be affected by this parameter:
mNextIdleDelay=+2h0m0s0ms
etc .. I don't know anything about any official documentation about this, so take my interpretation with salt.
source share