How to customize Android’s built-in battery saving mode – XDA Developers

0

Android has had a built-in battery saving mode for years now. If your phone is about to run out of battery, you can turn it on to keep the device running for a few more hours. Battery Saver turns off several power-hungry features and changes a number of settings to extend battery life. While this is useful enough for most people, some people might want to change it to not turn off certain settings or make it even more aggressive to save battery power. If that describes you, here’s a tutorial on customizing Android’s battery saving mode.

Before we start, we need to explain what Battery Saver Mode actually does. According to a Google support page, here are the battery saver limits on a Pixel phone:

What limits of the battery saver

  • Apps refresh their content, such as emails or news, only when you open the app.
  • Location services stop when your screen is turned off.
  • Apps don’t run in the background unless you turn off battery optimization.
  • Your phone does not listen to “Ok Google” and cannot continue a conversation. Instead, each time, tap Google Assistant Assistant.
  • The dark theme is activated.
  • Your notifications may be delayed.
  • “Always show time and information” goes out.
  • Pixel phones with Active Edge do not respond to press.
  • On Pixel 3, Pixel 4, and later Pixel phones, car crash detection is disabled.
  • On Pixel 4 phones, Motion Sense turns off.
  • On Pixel 4 phones and later Pixel phones, Fluid Display is disabled.
  • Pixel phones with 5G are returning to 4G service.

(Exclusive to Google’s Pixel 3 and later, there’s an even more powerful Extreme Battery Saver mode, but since it’s a Pixel-exclusive feature, we’ll cover that later.)

The above list is actually incomplete: Battery Saver Mode on Android phones actually does more than what Google says on the support page. In fact, Battery Saver also turns off things like app launch, vibration, and animation, and also limits the panel’s maximum brightness. Since Android’s battery saving mode is open source and can be controlled through the command line interface of the settings tables, it is possible to change the battery saving mode to make it more or less aggressive in what it deactivates.

Customize Android’s battery saving mode

Method 1 – ADB Shell

  1. Follow this guide to configure ADB on your PC or read this article to learn how to configure a local ADB shell.
  2. Once ADB is up and running, open a command prompt or terminal window and run the following command in the shell:
    settings put global battery_saver_constants "advertise_is_enabled=BOOLEAN,datasaver_disabled=BOOLEAN,enable_night_mode=BOOLEAN,launch_boost_disabled=BOOLEAN,vibration_disabled=BOOLEAN,animation_disabled=BOOLEAN,soundtrigger_disabled=BOOLEAN,fullbackup_deferred=BOOLEAN,keyvaluebackup_deferred=BOOLEAN,firewall_disabled=BOOLEAN,gps_mode=INTEGER,adjust_brightness_disabled=BOOLEAN,adjust_brightness_factor=FLOAT,force_all_apps_standby=BOOLEAN,force_background_check=BOOLEAN,optional_sensors_disabled=BOOLEAN,aod_disabled=BOOLEAN,quick_doze_enabled=BOOLEAN"

    where BOOLEAN is either true or false, INTEGER is an integer, and FLOAT is a decimal number.

  3. If you want to know which parameters are currently set the battery saving mode parameters, you can run the following ADB shell:
    dumpsys power | grep -A 128 "Battery saver policy"

    This will show you the current battery saving policy and all parameter values. You can also check the output of:

    settings get global battery_saver_constants

    … However, this will only be displayed after making changes to this parameter value at least once.

  4. If you want to restore the battery saving mode to its default settings, you can run either:
    settings delete global battery_saver_constants

    or

    settings put global battery_saver_constants "advertise_is_enabled=true,datasaver_disabled=true,enable_night_mode=true,launch_boost_disabled=true,vibration_disabled=true,animation_disabled=false,soundtrigger_disabled=true,fullbackup_deferred=true,keyvaluebackup_deferred=true,firewall_disabled=true,gps_mode=2,adjust_brightness_disabled=true,adjust_brightness_factor=0.5,force_all_apps_standby=true,force_background_check=true,optional_sensors_disabled=true,aod_disabled=true,quick_doze_enabled=true"

Since we discussed how to change Android’s built-in battery saving mode via the command line, a developer has come up with an app that provides a GUI to change each of these settings. If you don’t want to manually run shell commands and / or browse AOSP to find out exactly what each parameter does, then read on.

Method 2 – Buoy application

XDA-recognized developer tytydraco, the developer of the LADB app we talked about the other day, is back with another app called Buoy. It’s described as an “extension of the built-in Android battery saver,” and it exposes hidden Android settings to customize the behavior of battery saver mode. The app allows you to switch between the following:

  • Advertising on other applications for which the low consumption mode is activated
  • Android data saver for measured Wi-Fi or mobile data connections
  • Built-in dark mode
  • Launch Boost to speed up the application start-up
  • Vibration
  • Viewing window and activity animations
  • Allow apps to use SoundTrigger HAL
  • Defer full device backups for later
  • Postponing backups of application settings for later
  • Using the built-in web firewall to protect against potentially malicious sites
  • Changing location access mode restrictions for apps
  • Reduce maximum panel brightness
  • Force all apps to sleep mode
  • Force all apps not to check background data
  • Disabling unnecessary sensors
  • Using the always-on display
  • Put the device in deep standby as soon as the screen turns off

It also allows you to switch to “sticky” low consumption mode, a function added in Android 9 Pie which allows the battery saving mode to reactivate automatically when the device is unplugged from power or restarted.

To use Buoy, you will need an Android device running Android 8.0 Oreo or later, although the available settings vary depending on the version of Android. You will also need to grant the application WRITE_SECURE_SETTINGS permission or root access so that it can change the value of Settings.Global.battery_saver_constants. Again, I refer you to our article on how to set up tytydraco’s ADB or LADB app for you to do so.

If you install the app and make any changes, be aware that the changes will not be automatically rolled back when you uninstall the app. You will either need to press the “reset” button in Buoy or send one of the commands mentioned in step 4 above in order to reset the battery saver mode settings to their defaults.

Buoy costs $ 0.99 on Google Play in the US, but it’s also open source so you can compile it yourself if you want. Alternatively, you can just manually set the battery saving mode settings as I mentioned earlier. If you want to make things easier and support the developer, you can purchase the app from the Play Store. If you have any questions or comments, check out the developer’s thread on the XDA forums linked below.

Buoy – XDA Forum Thread



T
WRITTEN BY

Related posts