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

Commit ab15e923 authored by Muyuan Li's avatar Muyuan Li Committed by Alan Viverette
Browse files

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 d553f4f9
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;