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

Commit 7b71dfe2 authored by Makoto Onuki's avatar Makoto Onuki Committed by Android (Google) Code Review
Browse files

Merge "Revert "Cap the low battery threshold at config_lowBatteryWarningLevel (=15)""

parents a30e47e2 018b5fa5
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -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;
        }