Convert BatterySaverController to TogglePrefController.
This was the first MasterSwitchController, so we needed
to add the preference case to updateState.
Test: Robotests
Change-Id: I32f3dee0b183807c66c19513b8b064af8f369c2a
Fixes: 67996992
Cherry-picked from oc-dev
This cl elicits BatterySaverReceiver that listen to the change about
battery state and battery saver state.
BatterySaverController and BatterySaverSettings will use this receiver
to update the UI.
Bug: 32410757
Test: RunSettingsRoboTests
Change-Id: Ia92c6776985b89fe6a8d5b8d80898e502942b9b5
Previously everything lived in an inner class method of
SettingsRobolectricTestRunner. That method has now been turned into
a static method so that it can be called by other runners.
Bug: 62460102
Test: robotests
Change-Id: I6612b1f26404587301c534c8ba60e39d59d6c840
The implementations have been imported into SettingsLib. Setting's copy
can now be removed, which this change also does.
Test: Manually check battery status, which uses FooterMixin, looks OK.
make RunSettingsLibRobotTests && make RunSettingsRoboTests
&& make RunSettingsGoogleRoboTests
Change-Id: I6539605fdad80d156ff5ff249e68df4a1c412067
By using MasterSwitchPreference, we make "battery saver" to have
two parts: left part is the clickable summary jumping to other
fragment while right part is a switch toggle.
Also remove the previous battery saver preference.
Bug: 34279051
Test: RunSettingsRoboTests
Change-Id: If36fa9741e413a9bbdd57fa67a2c15b6e457afd7