Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64516a19 authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Fixes an AIOOBE when device admin enforces a small timeout for screen lock

Bug: 7378871

If the timeout choices are empty, set an empty summary.

Change-Id: I20dbe61af56f9c41337a7c284580511322e5a45e
parent 56a166e9
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -154,6 +154,9 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
        } else {
            final CharSequence[] entries = preference.getEntries();
            final CharSequence[] values = preference.getEntryValues();
            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());
@@ -164,6 +167,7 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
                summary = preference.getContext().getString(R.string.screen_timeout_summary,
                        entries[best]);
            }
        }
        preference.setSummary(summary);
    }