Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force Doze on Marshmallow?

Everything seems to point to these two commands:

adb shell dumpsys battery unplug
adb shell dumpsys deviceidle step

I followed the instructions on my Nexus 6 running the Marshmallow official release. I plug in my phone to my test machine. I set up my app for testing the piece I want to test with doze. I turn off my screen. After running battery unplug above I get no output so I assume it works, but every time I run deviceidle step the output is always Stepped to: ACTIVE.

I'm not sure if it matters, but the particular feature of my app I'm trying to test is an alarm I'm setting that should wake the phone out of Doze. I'm wanting my device to be mid-doze when my PendingIntent scheduled by AlarmManager.setAlarmClock goes off. Could that prevent my device from entering Doze?

like image 913
Corey Ogburn Avatar asked Oct 30 '15 15:10

Corey Ogburn


People also ask

What is force doze mode?

ForceDoze allows you to forcefully enable Doze right after you turn off your. screen, and on top of that, it also disables motion sensors so Doze stays active. even if your device is not stationary while screen off. Doze will only deactivate.


1 Answers

use below commands to force idle you device.

To unplug battery

adb shell dumpsys battery unplug

You can use below commands to Force Idle state

adb shell dumpsys deviceidle force-idle
or
adb shell dumpsys deviceidle enable

Check you are in doze more or not with below command

adb shell dumpsys deviceidle enabled 

disable mode:

adb shell dumpsys deviceidle disable 

Reset device battery status:

adb shell dumpsys battery reset
like image 92
prGD Avatar answered Oct 19 '22 18:10

prGD