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

Commit 018b5fa5 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

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

This reverts commit 965419af.

Bug: 71707409
Test: Manual test

Change-Id: I4f1c46183189b454bc981a65b992b80668f7a59a
parent 66792c48
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;
        }