Merge "Revert "Cap the low battery threshold at config_lowBatteryWarningLevel (=15)""
This commit is contained in:
@@ -293,15 +293,10 @@ public final class BatteryService extends SystemService {
|
||||
|
||||
private void updateBatteryWarningLevelLocked() {
|
||||
final ContentResolver resolver = mContext.getContentResolver();
|
||||
final int defWarnLevel = mContext.getResources().getInteger(
|
||||
int defWarnLevel = mContext.getResources().getInteger(
|
||||
com.android.internal.R.integer.config_lowBatteryWarningLevel);
|
||||
final int lowPowerModeTriggerLevel = Settings.Global.getInt(resolver,
|
||||
mLowBatteryWarningLevel = Settings.Global.getInt(resolver,
|
||||
Settings.Global.LOW_POWER_MODE_TRIGGER_LEVEL, defWarnLevel);
|
||||
|
||||
// NOTE: Keep the logic in sync with PowerUI.java in systemUI.
|
||||
// TODO: Propagate this value from BatteryService to system UI, really.
|
||||
mLowBatteryWarningLevel = Math.min(defWarnLevel, lowPowerModeTriggerLevel);
|
||||
|
||||
if (mLowBatteryWarningLevel == 0) {
|
||||
mLowBatteryWarningLevel = defWarnLevel;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user