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

Commit ce7bd8dc authored by Jiangyi's avatar Jiangyi Committed by Gerrit Code Review
Browse files

SystemUI: NavbarEditor: Fix saveKeys logic

In landscape, the keys are saved backwards in the for-loop, but it would crash out due from
an IndexOutOfBounds error since it's subtracting i from the array length while i = 0.

Change-Id: I405c5d962d8c575cfee57b09a7e55a8a6efc2d24
parent ce37355c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -341,7 +341,7 @@ public class NavbarEditor implements View.OnTouchListener {
    protected void saveKeys() {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < BUTTON_IDS.length; i++) {
            int idIndex = mVertical ? BUTTON_IDS.length - i : i;
            int idIndex = mVertical ? BUTTON_IDS.length - (i + 1) : i;
            ButtonInfo info = (ButtonInfo) mButtonViews.get(idIndex).getTag();
            if (i != 0) sb.append("|");
            sb.append(info.key);