Implement new BS warning / notification flow (2/2)

Bug: 74120126
Test: Manual tests
Change-Id: Ieea6ee97695cd5a30e55f5c6ccec8135ec2d0ef4
This commit is contained in:
Makoto Onuki
2018-03-20 13:05:22 -07:00
parent 940630bae1
commit 5b60fdba81
4 changed files with 15 additions and 16 deletions

View File

@@ -23,6 +23,7 @@ import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.fuelgauge.batterysaver.BatterySaverSettings;
import com.android.settingslib.fuelgauge.BatterySaverUtils;
public class BatterySaverCondition extends Condition {
public BatterySaverCondition(ConditionManager manager) {
@@ -68,7 +69,8 @@ public class BatterySaverCondition extends Condition {
@Override
public void onActionClick(int index) {
if (index == 0) {
mManager.getContext().getSystemService(PowerManager.class).setPowerSaveMode(false);
BatterySaverUtils.setPowerSaveMode(mManager.getContext(), false,
/*needFirstTimeWarning*/ false);
refreshState();
} else {
throw new IllegalArgumentException("Unexpected index " + index);