Commit 8c168359 authored by Muyuan Li's avatar Muyuan Li Committed by The Android Automerger

Fixed a bug in DisplayUtils in which the length of entries will be added

twice, causing IndexOutOfBound exception at runtime when using custom
DPI

Change-Id: Ib106f0ee8044893e2c1f3b4f334b741194171e2a
(cherry picked from commit d4ed8400ff7bc60e1391f4ea248390342a9f90dd)
parent 7f4e5a4c
......@@ -154,10 +154,11 @@ class DisplayDensityUtils {
} else {
// We don't understand the current density. Must have been set by
// someone else. Make room for another entry...
values = Arrays.copyOf(values, values.length + 1);
int newLength = values.length + 1;
values = Arrays.copyOf(values, newLength);
values[curIndex] = currentDensity;
entries = Arrays.copyOf(entries, values.length + 1);
entries = Arrays.copyOf(entries, newLength);
entries[curIndex] = res.getString(SUMMARY_CUSTOM, currentDensity);
displayIndex = curIndex;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment