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.
source share