Loading src/com/android/settings/DisplaySettings.java +7 −2 Original line number Diff line number Diff line Loading @@ -193,13 +193,18 @@ public class DisplaySettings extends SettingsPreferenceFragment implements } } if (revisedEntries.size() != entries.length || revisedValues.size() != values.length) { final int userPreference = Integer.parseInt(screenTimeoutPreference.getValue()); screenTimeoutPreference.setEntries( revisedEntries.toArray(new CharSequence[revisedEntries.size()])); screenTimeoutPreference.setEntryValues( revisedValues.toArray(new CharSequence[revisedValues.size()])); final int userPreference = Integer.parseInt(screenTimeoutPreference.getValue()); if (userPreference <= maxTimeout) { screenTimeoutPreference.setValue(String.valueOf(userPreference)); } else if (revisedValues.size() > 0 && Long.parseLong(revisedValues.get(revisedValues.size() - 1).toString()) == maxTimeout) { // If the last one happens to be the same as the max timeout, select that screenTimeoutPreference.setValue(String.valueOf(maxTimeout)); } else { // There will be no highlighted selection since nothing in the list matches // maxTimeout. The user can still select anything less than maxTimeout. Loading Loading
src/com/android/settings/DisplaySettings.java +7 −2 Original line number Diff line number Diff line Loading @@ -193,13 +193,18 @@ public class DisplaySettings extends SettingsPreferenceFragment implements } } if (revisedEntries.size() != entries.length || revisedValues.size() != values.length) { final int userPreference = Integer.parseInt(screenTimeoutPreference.getValue()); screenTimeoutPreference.setEntries( revisedEntries.toArray(new CharSequence[revisedEntries.size()])); screenTimeoutPreference.setEntryValues( revisedValues.toArray(new CharSequence[revisedValues.size()])); final int userPreference = Integer.parseInt(screenTimeoutPreference.getValue()); if (userPreference <= maxTimeout) { screenTimeoutPreference.setValue(String.valueOf(userPreference)); } else if (revisedValues.size() > 0 && Long.parseLong(revisedValues.get(revisedValues.size() - 1).toString()) == maxTimeout) { // If the last one happens to be the same as the max timeout, select that screenTimeoutPreference.setValue(String.valueOf(maxTimeout)); } else { // There will be no highlighted selection since nothing in the list matches // maxTimeout. The user can still select anything less than maxTimeout. Loading