How long does it take to switch to dose mode on Android?

In Android version 6.0+, assuming the user left the android somewhere, disconnected from the network, the power button was pressed to lock it, etc.

How long does an android take in each state, such as inactive, incomplete, etc., before it finally enters standby mode?

Now once in standby mode, how long does it take to switch to idle_maintenance mode and how long does it stay there in idle_maintenance mode?

Whether these values ​​are constant or custom, or are dependent on the version and manufacturer of Android.

Please inform me that it is important for me to make important decisions on how to configure my Android application version 6.0 / api 23 +

+6
source share
1 answer

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 # emulate unplugging the charging cable $ for i in {1..5}; do adb shell dumpsys deviceidle step; done Stepped to: IDLE_PENDING Stepped to: SENSING Stepped to: LOCATING Stepped to: IDLE Stepped to: IDLE_MAINTENANCE # repeats IDLE and IDLE_MAINTENANCE forever $ adb shell dumpsys battery reset $ adb shell dumpsys deviceidle step Stepped to: ACTIVE 

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.

+1
source

All Articles