summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2012-10-22 18:03:49 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-10-22 18:03:49 -0700
commit6e158a91f6668c0275ccfd764c8bbf45603ddc79 (patch)
tree81119c2c6b375730b1e567cee190ddcab168a9de /src/com
parentfa84e686b8241aefb5712afce9ec320fb8265069 (diff)
parentefc9458b46cdbab7abe5df169d83a09582e8e6cd (diff)
downloadpackages_apps_Settings-6e158a91f6668c0275ccfd764c8bbf45603ddc79.zip
packages_apps_Settings-6e158a91f6668c0275ccfd764c8bbf45603ddc79.tar.gz
packages_apps_Settings-6e158a91f6668c0275ccfd764c8bbf45603ddc79.tar.bz2
am efc9458b: am 4f5555ab: am b80b8bb2: Merge "Fixes an AIOOBE when device admin enforces a small timeout for screen lock" into jb-mr1-dev
* commit 'efc9458b46cdbab7abe5df169d83a09582e8e6cd': Fixes an AIOOBE when device admin enforces a small timeout for screen lock
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/settings/DisplaySettings.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/com/android/settings/DisplaySettings.java b/src/com/android/settings/DisplaySettings.java
index 9f812fe..fb839a7 100644
--- a/src/com/android/settings/DisplaySettings.java
+++ b/src/com/android/settings/DisplaySettings.java
@@ -154,15 +154,19 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
} else {
final CharSequence[] entries = preference.getEntries();
final CharSequence[] values = preference.getEntryValues();
- int best = 0;
- for (int i = 0; i < values.length; i++) {
- long timeout = Long.parseLong(values[i].toString());
- if (currentTimeout >= timeout) {
- best = i;
+ if (entries == null || entries.length == 0) {
+ summary = "";
+ } else {
+ int best = 0;
+ for (int i = 0; i < values.length; i++) {
+ long timeout = Long.parseLong(values[i].toString());
+ if (currentTimeout >= timeout) {
+ best = i;
+ }
}
+ summary = preference.getContext().getString(R.string.screen_timeout_summary,
+ entries[best]);
}
- summary = preference.getContext().getString(R.string.screen_timeout_summary,
- entries[best]);
}
preference.setSummary(summary);
}