I am following instructions on this android page to switch android to doz mode to test my app, I have used a real device as well as emulator. But in both cases when I give the second command once or several times, which is
adb shell dympsys deviceidle step
it only says Stepped: ACTIVE Before giving the commands I turned off/locked the device as well but no use. I wanted how my app behaves in doze mode but nothing seems to work,
I also tried
adb shell dumpsys deviceidle force-idle
but this gives me the message below.
Unable to go idle; not enabled
Please advise. I am using motorola Moto G 2nd generation android 6.0 and also used emulator x86_64 bit image with android studio version 1.5.1
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.
For persistent work, use WorkManager. Alarms only. Unlike WorkManager, AlarmManager wakes a device from Doze mode.
try using
adb shell dumpsys deviceidle enable
that should enable the deep and light idle modes, then use
adb shell dumpsys deviceidle force-idle
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