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?
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With