I have tried to find the file corresponding to the battery optimization. Found it at /data/system/deviceidle.xml
Code: Select all
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<config>
<wl n="com.whatsapp" />
<wl n="com.mixplorer.silver" />
<wl n="com.goodmooddroid.gesturecontrol" />
<wl n="com.android.chrome" />
<wl n="nl.jolanrensen.hotwordPluginFree" />
<wl n="vocalizer_e2.tts" />
</config>
This is the example of the content at mine. I have whitelisted some, including Automagic. But somehow Automagic is not shown here, probably because it is running foreground service.
You can try to find using MiXplorer. Install
MiXplorer from xda, grant it root. Go to /data/system, change the sort to Date (newer). Then change the view to Detailed (so you can see modification date). Go to your setting, change OruxMaps to don't optimize. Then go back to MiXplorer, refresh and see what is the file that is the top most one, which has the modification time "Just now".
Yours probably can be different file, as Oneplus has different optimization system. Mine is RN5, RR 7.0.1 Pie 9.0 ROM, which is based on LineageOS.
================
But after a furious search, I have found the terminal command to change it (yay, thanks to your question
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
). Use
dumpsys deviceidle
Found it here :
https://android.stackexchange.com/quest ... -from-doze
As you have root already, you can use it directly from action Execute Root Command
To list all whitelisted app
Code: Select all
dumpsys deviceidle whitelist | grep user
To add OruxMaps to the whitelist
Code: Select all
dumpsys deviceidle whitelist +com.orux.oruxmapsDonate
To remove it from whitelist, just change + to -
Code: Select all
dumpsys deviceidle whitelist -com.orux.oruxmapsDonate
However the UI won't show up properly until next reboot (or system UI reboot). So, if you go to the battery optimization, it still shows as optimized, although dumpsys already show it is whitelisted.
This is for standard AOSP. Oneplus might implement their own method. And if that is the case, unfortunately you have to find it by yourself.
Your flow will contain shortcut to start OruxMaps and add it to whitelist. After finish, use the shortcut again to remove it from whitelist, so your battery can last longer.