Loading core/java/android/provider/Settings.java +2 −2 Original line number Diff line number Diff line Loading @@ -10750,14 +10750,14 @@ public final class Settings { public static final String LOW_POWER_MODE = "low_power"; /** * Battery level [1-99] at which low power mode automatically turns on. * Battery level [1-100] at which low power mode automatically turns on. * If 0, it will not automatically turn on. * @hide */ public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level"; private static final Validator LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR = new SettingsValidators.InclusiveIntegerRangeValidator(0, 99); new SettingsValidators.InclusiveIntegerRangeValidator(0, 100); /** * If not 0, the activity manager will aggressively finish activities and Loading packages/SystemUI/src/com/android/systemui/power/PowerUI.java +6 −2 Original line number Diff line number Diff line Loading @@ -142,8 +142,12 @@ public class PowerUI extends SystemUI { final int lowPowerModeTriggerLevel = Settings.Global.getInt(resolver, Settings.Global.LOW_POWER_MODE_TRIGGER_LEVEL, defWarnLevel); // NOTE: Keep the logic in sync with BatteryService. // TODO: Propagate this value from BatteryService to system UI, really. // Note LOW_POWER_MODE_TRIGGER_LEVEL can take any value between 0 and 100, but // for the UI purposes, let's cap it at 15% -- i.e. even if the trigger level is higher // like 50%, let's not show the "low battery" notification until it hits // config_lowBatteryWarningLevel, which is 15% by default. // LOW_POWER_MODE_TRIGGER_LEVEL is still used in other places as-is. For example, if it's // 50, then battery saver kicks in when the battery level hits 50%. int warnLevel = Math.min(defWarnLevel, lowPowerModeTriggerLevel); if (warnLevel == 0) { Loading Loading
core/java/android/provider/Settings.java +2 −2 Original line number Diff line number Diff line Loading @@ -10750,14 +10750,14 @@ public final class Settings { public static final String LOW_POWER_MODE = "low_power"; /** * Battery level [1-99] at which low power mode automatically turns on. * Battery level [1-100] at which low power mode automatically turns on. * If 0, it will not automatically turn on. * @hide */ public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level"; private static final Validator LOW_POWER_MODE_TRIGGER_LEVEL_VALIDATOR = new SettingsValidators.InclusiveIntegerRangeValidator(0, 99); new SettingsValidators.InclusiveIntegerRangeValidator(0, 100); /** * If not 0, the activity manager will aggressively finish activities and Loading
packages/SystemUI/src/com/android/systemui/power/PowerUI.java +6 −2 Original line number Diff line number Diff line Loading @@ -142,8 +142,12 @@ public class PowerUI extends SystemUI { final int lowPowerModeTriggerLevel = Settings.Global.getInt(resolver, Settings.Global.LOW_POWER_MODE_TRIGGER_LEVEL, defWarnLevel); // NOTE: Keep the logic in sync with BatteryService. // TODO: Propagate this value from BatteryService to system UI, really. // Note LOW_POWER_MODE_TRIGGER_LEVEL can take any value between 0 and 100, but // for the UI purposes, let's cap it at 15% -- i.e. even if the trigger level is higher // like 50%, let's not show the "low battery" notification until it hits // config_lowBatteryWarningLevel, which is 15% by default. // LOW_POWER_MODE_TRIGGER_LEVEL is still used in other places as-is. For example, if it's // 50, then battery saver kicks in when the battery level hits 50%. int warnLevel = Math.min(defWarnLevel, lowPowerModeTriggerLevel); if (warnLevel == 0) { Loading