Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not switch to Doze mode

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

like image 340
Ahmed Avatar asked Apr 06 '16 16:04

Ahmed


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.

Does Work Manager work in doze mode?

For persistent work, use WorkManager. Alarms only. Unlike WorkManager, AlarmManager wakes a device from Doze mode.


1 Answers

try using

adb shell dumpsys deviceidle enable

that should enable the deep and light idle modes, then use

adb shell dumpsys deviceidle force-idle 
like image 161
BrianMiz Avatar answered Sep 22 '22 11:09

BrianMiz