Replace dynamic summary text for SettingPref

All SettingPrefs that have dynamic summaries are replaced
by placeholder text. Changes are for:
- Battery Saver "Turn on automatically"
- Notification "Dock speaker plays"
- Notification "Emergency tone"

Bug: 36101902
Test: make RunSettingsRoboTests
Change-Id: Ic2556055c155989015dbef6b507d3e3b45b779b5
This commit is contained in:
Matthew Fritze
2017-05-08 13:30:52 -07:00
parent 8fc602fed8
commit 03dfa50996
5 changed files with 83 additions and 4 deletions

View File

@@ -121,6 +121,19 @@ public class SettingPref {
if (mTwoState != null) {
mTwoState.setChecked(val != 0);
} else if (mDropDown != null) {
if (mValues != null) {
int index = 0;
for (int len = mValues.length; index < len; index++) {
if (mValues[index] == val) {
break;
}
}
if (index < mValues.length) {
CharSequence entry = mDropDown.getEntries()[index];
mDropDown.setSummary(entry);
}
}
mDropDown.setValue(Integer.toString(val));
}
}