Loading src/com/android/settings/fuelgauge/BatterySettingsMigrateChecker.java +3 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.provider.Settings; import android.util.Log; import com.android.settings.fuelgauge.batterysaver.BatterySaverScheduleRadioButtonsController; import com.android.settingslib.fuelgauge.BatterySaverUtils; /** Execute battery settings migration tasks in the device booting stage. */ public final class BatterySettingsMigrateChecker extends BroadcastReceiver { Loading Loading @@ -52,5 +53,7 @@ public final class BatterySettingsMigrateChecker extends BroadcastReceiver { BatterySaverScheduleRadioButtonsController.TRIGGER_LEVEL_MIN); Log.w(TAG, "Reset invalid scheduled battery level from: " + threshold); } // Force removing the 'schedule by routine' state. BatterySaverUtils.revertScheduleToNoneIfNeeded(context); } } src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleRadioButtonsController.java +3 −1 Original line number Diff line number Diff line Loading @@ -117,7 +117,9 @@ public class BatterySaverScheduleRadioButtonsController { if (mode == PowerManager.POWER_SAVE_MODE_TRIGGER_DYNAMIC || triggerLevel != 0) { BatterySaverUtils.suppressAutoBatterySaver(mContext); } if (mSeekBarController != null) { mSeekBarController.updateSeekBar(); } return true; } } src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleSettings.java +1 −13 Original line number Diff line number Diff line Loading @@ -122,24 +122,12 @@ public class BatterySaverScheduleSettings extends RadioButtonPickerFragment { protected List<? extends CandidateInfo> getCandidates() { Context context = getContext(); List<CandidateInfo> candidates = Lists.newArrayList(); String routineProviderApp = getContext().getResources() .getString(com.android.internal.R.string.config_batterySaverScheduleProvider); candidates.add(new BatterySaverScheduleCandidateInfo( context.getText(R.string.battery_saver_auto_no_schedule), /* summary */ null, BatterySaverScheduleRadioButtonsController.KEY_NO_SCHEDULE, /* enabled */ true)); // only add routine option if an app has been specified if (!TextUtils.isEmpty(routineProviderApp)) { candidates.add(new BatterySaverScheduleCandidateInfo( context.getText(R.string.battery_saver_auto_routine), context.getText(R.string.battery_saver_auto_routine_summary), BatterySaverScheduleRadioButtonsController.KEY_ROUTINE, /* enabled */ true)); } else { // Make sure routine is not selected if no provider app is configured BatterySaverUtils.revertScheduleToNoneIfNeeded(context); } candidates.add(new BatterySaverScheduleCandidateInfo( context.getText(R.string.battery_saver_auto_percentage), /* summary */ null, Loading Loading
src/com/android/settings/fuelgauge/BatterySettingsMigrateChecker.java +3 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.provider.Settings; import android.util.Log; import com.android.settings.fuelgauge.batterysaver.BatterySaverScheduleRadioButtonsController; import com.android.settingslib.fuelgauge.BatterySaverUtils; /** Execute battery settings migration tasks in the device booting stage. */ public final class BatterySettingsMigrateChecker extends BroadcastReceiver { Loading Loading @@ -52,5 +53,7 @@ public final class BatterySettingsMigrateChecker extends BroadcastReceiver { BatterySaverScheduleRadioButtonsController.TRIGGER_LEVEL_MIN); Log.w(TAG, "Reset invalid scheduled battery level from: " + threshold); } // Force removing the 'schedule by routine' state. BatterySaverUtils.revertScheduleToNoneIfNeeded(context); } }
src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleRadioButtonsController.java +3 −1 Original line number Diff line number Diff line Loading @@ -117,7 +117,9 @@ public class BatterySaverScheduleRadioButtonsController { if (mode == PowerManager.POWER_SAVE_MODE_TRIGGER_DYNAMIC || triggerLevel != 0) { BatterySaverUtils.suppressAutoBatterySaver(mContext); } if (mSeekBarController != null) { mSeekBarController.updateSeekBar(); } return true; } }
src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleSettings.java +1 −13 Original line number Diff line number Diff line Loading @@ -122,24 +122,12 @@ public class BatterySaverScheduleSettings extends RadioButtonPickerFragment { protected List<? extends CandidateInfo> getCandidates() { Context context = getContext(); List<CandidateInfo> candidates = Lists.newArrayList(); String routineProviderApp = getContext().getResources() .getString(com.android.internal.R.string.config_batterySaverScheduleProvider); candidates.add(new BatterySaverScheduleCandidateInfo( context.getText(R.string.battery_saver_auto_no_schedule), /* summary */ null, BatterySaverScheduleRadioButtonsController.KEY_NO_SCHEDULE, /* enabled */ true)); // only add routine option if an app has been specified if (!TextUtils.isEmpty(routineProviderApp)) { candidates.add(new BatterySaverScheduleCandidateInfo( context.getText(R.string.battery_saver_auto_routine), context.getText(R.string.battery_saver_auto_routine_summary), BatterySaverScheduleRadioButtonsController.KEY_ROUTINE, /* enabled */ true)); } else { // Make sure routine is not selected if no provider app is configured BatterySaverUtils.revertScheduleToNoneIfNeeded(context); } candidates.add(new BatterySaverScheduleCandidateInfo( context.getText(R.string.battery_saver_auto_percentage), /* summary */ null, Loading