Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

I followed steps described here:

https://developer.android.com/preview/testing/guide.html#doze-standby

Circumstances:

  • Android Debug Bridge version 1.0.32

  • Nexus 9 with Preview M

Shell:

$ adb shell dumpsys battery unplug 

=> worked, device unplugged

$ adb shell dumpsys deviceidle step 

=> Output: Stepped to: ACTIVE

$ adb shell dumpsys deviceidle -h 

=> does not work => Output:

Device idle controller (deviceidle) dump options:  [-h] [CMD]  -h: print this help text.  Commands:  step  disable  enable  whitelist 

I tried it with:

adb shell dumpsys deviceidle enable 

But it didn't work.

So my question, as mentioned above, how to shift the device in Doze-Mode? What did i make wrong?

EDIT - JUNE, 2016:

New Link: https://developer.android.com/training/monitoring-device-state/doze-standby.html

like image 753
A.D. Avatar asked Jul 21 '15 08:07

A.D.


People also ask

What is Doze mode Android?

If a user leaves a device unplugged and stationary for a period of time, with the screen off, the device enters Doze mode. In Doze mode, the system attempts to conserve battery by restricting apps' access to network and CPU-intensive services.


2 Answers

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.

like image 142
Piyush Avatar answered Sep 22 '22 21:09

Piyush


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

like image 44
A.D. Avatar answered Sep 18 '22 21:09

A.D.