How to shift device in Doze Mode (Android Preview M / Marshmallow)?

こ雲淡風輕ζ 提交于 2019-11-29 20:12:12
Piyush

There is a better way to achieve this in the new releases:

$ adb shell dumpsys deviceidle force-idle

No need to unplug from power, no need to wait for the screen to turn off.

Ok, i got it. The trick was to turn the screen off! After that

$ adb shell dumpsys deviceidle step outputs:

IDLE_PENDING

then

SENSING

then

IDLE

then

IDLE_MAINTENANCE

then

IDLE

then

IDLE_MAINTENANCE

and so on...

Many thanks to this site:

https://newcircle.com/s/post/1739/2015/06/12/diving-into-android-m-doze

Hypothetical inthe Clavicle

Yes, it appears that Google's developer testing guideline is incorrect. I just recently discovered this as well and posted a bug about it here with the correct steps to get the device to idle (aka doze).

You can find my full answer posted on the similar topic here: How to test Doze Mode on Android?

Idle State - In order to put the device into an Idle state you can use the following adb commands:

>adb shell dumpsys battery unplug
>adb shell dumpsys deviceidle force-idle

Active State - In order to put the device back into the Active state you may simulate the following key event:

> adb shell input keyevent KEYCODE_WAKEUP

I also needed a quick option to toggle between Active and Idle states so I wrote a batch script adbIdleModeSwitch.bat for these purposes, you may download and use it: https://drive.google.com/file/d/0B81qFnPX_eUUYTMxOTd1UG94NVk/view

Osamu Okano
$ adb shell dumpsys deviceidle -h

This command only outputs a help message like common unix program.

IDLE means Doze mode. In the article you linked, you can regard Doze mode as device idle mode.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!