Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b97cff52 authored by Steve Kondik's avatar Steve Kondik
Browse files

Make the battery percentage display optional.

parent f54829a5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1438,6 +1438,12 @@ public final class Settings {
         */
        public static final String TRACKBALL_WAKE_SCREEN = "trackball_wake_screen";

        /**
         * Whether to show the battery level percentage overlayed on the icon.
         * @hide
         */
        public static final String BATTERY_PERCENTAGE_STATUS_ICON = "battery_percentage_status_icon";
        
        /**
         * Settings to backup. This is here so that it's in the same place as the settings
         * keys and easy to update.
+3 −2
Original line number Diff line number Diff line
@@ -559,8 +559,9 @@ public class StatusBarPolicy {
        boolean plugged = intent.getIntExtra("plugged", 0) != 0;
        int level = intent.getIntExtra("level", -1);

        //show battery percentage if not plugged in
        if (plugged) {
        //show battery percentage if not plugged in and status is enabled
        if (plugged || Settings.System.getInt(mContext.getContentResolver(),
                Settings.System.BATTERY_PERCENTAGE_STATUS_ICON, 1) == 0) {
            mBatteryData.number = -1;
        } else {
            mBatteryData.number = level;