Android: completely disabling deviceidle ("Doze") in Android M?
Asked Answered
W

2

10

In a rooted Android M device, I want to completely disable deviceidle mode ("Doze"), all the time. Yes, I know this affects my battery life, and that's fine with me.

I know that I can invoke the following:

dumpsys deviceidle disable

However, I haven't been able to find detailed docs for that subcommand. Does it actually disable "Doze" completely and permanently on my device (or at least until the next boot), or does it perform some other related function?

If that "dumpsys deviceidle disable" command isn't the way to permanently disable "Doze", is there some other way, perhaps via the Android Java API? Actually, a Java-API solution would be ideal, if one exists.

Winther answered 23/10, 2016 at 15:28 Comment(3)
related #39873917Ligneous
Use adb shell dumpsys deviceidle -h for docsLigneous
Also check this newcircle.com/s/post/1739/2015/06/12/diving-into-android-m-dozeLigneous
C
13

That command disables Doze mode even without root, but then you will have to execute the commands again after reboot. Some people also use another command to enable the doze whitelist, as it seems that Marshmallow has it disabled by default and it does nothing.

adb shell dumpsys deviceidle disable
adb shell dumpsys deviceidle whitelist

If you have root, you can download an app to execute this script every time on system boot, effectively disabling Doze mode forever.

Corolla answered 4/4, 2017 at 9:46 Comment(3)
dumpsys deviceidle whitelist only shows the whitelist for me. It doesn't change the mode or anything else.Roast
Hmm... could it be that said command only works for Oneplus and Nexus phones? I personally have only tested the first one, but the second line is mentioned in several threads on android forums, so I included it in the answer.Corolla
This is still a valid fix on my Galaxy S22 running Android 13. Tested several times over a period of weeks with reboots reintroducing the issue. I only needed the first command.Maisey
V
7

If anyone likes to know, to change something in the whitelist:

adb shell dumpsys deviceidle whitelist +com.app.package

(I assume '-com.app.package' will remove one)

Currently on Huawei P Smart 2019 with android 10, that change sticks after reboot.

also: https://dontkillmyapp.com/ for more app-killers

Vacuva answered 14/3, 2020 at 8:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.