Android M Doze state has several states?

I changed this application a bit: https://github.com/commonsguy/cw-omnibus/tree/master/JobScheduler

It sets alarms using setExactAndAllowWhileIdle and starts an alarm that goes off every 1 minute and logs it.

According to the Doze documentation, if this application works when the phone is in "Dose" mode, only one alarm should go away within 15 minutes. I do not see this behavior.

On one side 5, running Android M. After starting the application and the entire alarm planning process, I insert the phone into Doze using the provided abd ...

Disconnect the battery adb shell dumpsys step adb shell dumpsys deviceidle adb shell dumpsys deviceidle -h

... From the magazine I saw about 30 minutes of alarms that came out once a minute, then, finally, they were 15 minutes for an hour. Then return to once per minute, and then back to 15 minutes. During the test, the phone was not completely damaged.

Does anyone know why this is? I got the impression that after these adb commands the phone will immediately be in the "Dose" mode, and the alarms will be turned off for 15 minutes from the start.

Thanks for your help.

+4
source share
2 answers

On the one hand, the corresponding adb command documents are incomplete, as you noted in the ISSUE 2930 link.

The following command simply prints usage information:

adb shell dumpsys deviceidle -h 

The following command displays the current state, including preconditions (on, not moving, not charging, turning off) to get into IDLE:

 adb shell dumpsys deviceidle Settings: ... Whitelist (except idle) system apps: ... Whitelist (except idle) all app ids: ... mEnabled=true mForceIdle=false mSigMotionSensor=null mCurDisplay=... mScreenOn=false mCharging=false mSigMotionActive=false mState=INACTIVE 

This shows if you need to make more settings. For instance. To get mScreenOn=false , it seems that you need 2 or 3 taps on the emulator power button.

The following command goes into IDLE mode, but ISSUE 2930 explains that you need to take a step several times to go to INACTIVE, IDLE_PENDING, SENSING, then IDLE:

 adb shell dumpsys deviceidle step 

The following command will make it idle:

 adb shell dumpsys deviceidle force-idle 

Recently, the documents of the developers of Doze and App Standby have been improved.

+1
source

The speed limit for setExactAndAllowWhileIdle is different when the device is in standby mode. I assume that it will take you 30 minutes for your phone to go into standby mode through Doze, after which you will be limited to calling setExactAndAllowWhileIdle once every 15 minutes.

In the "Dose" mode, your phone will periodically wake up for a standby time of up to 10 minutes in standby mode. During these 10 minutes it wakes up from standby mode and your speed limit will be adjusted once per minute. After the service window finishes, you will see that it returns once every 15 minutes.

Idle Maintenance windows are described in the docs: http://developer.android.com/training/monitoring-device-state/doze-standby.html#understand_doze

+1
source

All Articles