Loading core/java/android/provider/Settings.java +6 −0 Original line number Diff line number Diff line Loading @@ -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. Loading services/java/com/android/server/status/StatusBarPolicy.java +3 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading
core/java/android/provider/Settings.java +6 −0 Original line number Diff line number Diff line Loading @@ -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. Loading
services/java/com/android/server/status/StatusBarPolicy.java +3 −2 Original line number Diff line number Diff line Loading @@ -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; Loading