Flip the preference for sticky battery saver

Instead of toggled on being to keep battery saver on, the UX
writers would like to make toggled on be turn battery saver off
automatically. Also turns the controller into a
TogglePreferenceController, because those exist apparently.

Test: visual inspection, tests pass
Fixes: 126938839
Change-Id: Iffac536d0b1956d4534ca1b5fa5c6440c4d3a3ff
This commit is contained in:
Salvador Martinez
2019-03-22 13:42:39 -07:00
parent 12256ca49f
commit d12d722099
4 changed files with 49 additions and 34 deletions

View File

@@ -5661,12 +5661,6 @@
<!-- Battery saver: Title for battery saver schedule screen [CHAR_LIMIT=40] -->
<string name="battery_saver_schedule_settings_title">Set a schedule</string>
<!-- Battery Saver: Title for sticky battery saver preference [CHAR_LIMIT=60] -->
<string name="battery_saver_sticky_title">Keep battery saver on</string>
<!-- Battery Saver: Description for sticky battery saver preference [CHAR_LIMIT=NONE] -->
<string name="battery_saver_sticky_description">Battery saver will stay on even after device is fully charged</string>
<!-- Battery Saver: Title for sticky battery saver preference [CHAR_LIMIT=60] -->
<string name="battery_saver_sticky_title_new">Turn off when fully charged</string>

View File

@@ -28,8 +28,8 @@
<SwitchPreference
android:key="battery_saver_sticky"
android:title="@string/battery_saver_sticky_title"
android:summary="@string/battery_saver_sticky_description"
android:title="@string/battery_saver_sticky_title_new"
android:summary="@string/summary_placeholder"
settings:keywords="@string/keywords_battery_saver_sticky"
settings:controller="com.android.settings.fuelgauge.batterysaver.BatterySaverStickyPreferenceController"/>