theblixguy / ForceDoze

Enable Doze mode immediately after screen off and turn off motion sensing to get best battery life
https://play.google.com/store/apps/details?id=com.suyashsrijan.forcedoze&hl=en
GNU General Public License v3.0
179 stars 37 forks source link

ForceDoze does not read/display Tunables/settings from the system #57

Open BlessDeix92 opened 6 years ago

BlessDeix92 commented 6 years ago

Today I was playing with ForceDoze for the first time and immediately noticed that it is not correctly reading doze settings from the system. Instead, it appears to be using it's own internal set of stored settings and merely assumes that the system is using a default set of settings or the last setting which ForceDoze was configured to use, neither of which may be the actual configured setting on the system.

For example, I manually set idle_to to be 5s, down from the default of 3600 seconds. I verified this change with "dumpsys deviceidle" in a shell, but ForceDoze still displays the current setting as being "3600000"(ms).

This behavior is probably intentional, but a user would be correct to reasonably believe that the setting being displayed was read from the system.

It would probably be best to display the current-applied setting taken from the system, the ForceDoze-configured settings, and perhaps the system defaults at the same time (all three are potentially different). This would allow the user to inspect the system defaults, the current settings, and would reveal any inconsistency between what the system should be as configured in ForceDoze and what it actually is.

If you need an example for reading settings, there is a "Doze Setting Editor" out on XDA which correctly reads and displays system doze settings: https://forum.xda-developers.com/android/apps-games/root-doze-settings-editor-android-t3235130

theblixguy commented 6 years ago

That is correct, it does not read the values from the system. At the moment, it uses the default values from AOSP. I will be adding support for reading values directly from the system rather than showing default values to remove confusion, when I get some free time.