Use BatterySaverReceiver in battery saver settings

Use this receiver to listen to following updates:
1. Plug state: if it is plugged in, disable this two state
button, otherwise make it enabled
2. low power mode: If mode on, show "turn off" otherwise show
"turn on"

Bug: 72228477
Test: RunSettingsRoboTests
Change-Id: Ib3d3df9f9a5fbac8b1b876c9e193beb75f522ebd
This commit is contained in:
jackqdyulei
2018-02-06 14:03:30 -08:00
parent 92757b2454
commit a2df26e9b3
4 changed files with 45 additions and 21 deletions

View File

@@ -69,7 +69,7 @@ public class BatterySaverReceiver extends BroadcastReceiver {
mBatterySaverListener = lsn;
}
interface BatterySaverListener {
public interface BatterySaverListener {
void onPowerSaveModeChanged();
void onBatteryChanged(boolean pluggedIn);
}