Merge "Small fixes to power save UI." into lmp-preview-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
2f2cbbc760
@@ -59,7 +59,9 @@ public class BatterySaverSettings extends SettingsPreferenceFragment
|
|||||||
mSwitchBar = ((SettingsActivity) mContext).getSwitchBar();
|
mSwitchBar = ((SettingsActivity) mContext).getSwitchBar();
|
||||||
updateSwitchBar();
|
updateSwitchBar();
|
||||||
mTriggerPref = new SettingPref(SettingPref.TYPE_GLOBAL, KEY_TURN_ON_AUTOMATICALLY,
|
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)) {
|
getResources().getIntArray(R.array.battery_saver_trigger_values)) {
|
||||||
@Override
|
@Override
|
||||||
protected String getCaption(Resources res, int value) {
|
protected String getCaption(Resources res, int value) {
|
||||||
@@ -103,6 +105,7 @@ public class BatterySaverSettings extends SettingsPreferenceFragment
|
|||||||
mSettingsObserver.setListening(false);
|
mSettingsObserver.setListening(false);
|
||||||
if (mSwitchBarListenerAdded) {
|
if (mSwitchBarListenerAdded) {
|
||||||
mSwitchBar.removeOnSwitchChangeListener(this);
|
mSwitchBar.removeOnSwitchChangeListener(this);
|
||||||
|
mSwitchBarListenerAdded = false;
|
||||||
}
|
}
|
||||||
mSwitchBar.hide();
|
mSwitchBar.hide();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user