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

Commit de159c8d authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Small fixes to power save UI.

Use the correct default setting, and don't crash.

Change-Id: I33fd612aba404e13c8bbe9110535dff1cfba12a4
parent e9ee5e2c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -59,7 +59,9 @@ public class BatterySaverSettings extends SettingsPreferenceFragment
        mSwitchBar = ((SettingsActivity) mContext).getSwitchBar();
        updateSwitchBar();
        mTriggerPref = new SettingPref(SettingPref.TYPE_GLOBAL, KEY_TURN_ON_AUTOMATICALLY,
                Global.LOW_POWER_MODE_TRIGGER_LEVEL, 0,
                Global.LOW_POWER_MODE_TRIGGER_LEVEL,
                mContext.getResources().getInteger(
                        com.android.internal.R.integer.config_lowBatteryWarningLevel),
                getResources().getIntArray(R.array.battery_saver_trigger_values)) {
            @Override
            protected String getCaption(Resources res, int value) {
@@ -103,6 +105,7 @@ public class BatterySaverSettings extends SettingsPreferenceFragment
        mSettingsObserver.setListening(false);
        if (mSwitchBarListenerAdded) {
            mSwitchBar.removeOnSwitchChangeListener(this);
            mSwitchBarListenerAdded = false;
        }
        mSwitchBar.hide();
    }