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

Commit 4b72c1eb authored by Android (Google) Code Review's avatar Android (Google) Code Review Committed by The Android Open Source Project
Browse files

am b7ce28c6: Merge change 962 into donut

Merge commit 'b7ce28c6'

* commit 'b7ce28c6':
  Fixes #1603191. GridView could provoke NPEs during layout passes initiated from key events.
parents d52d8dee b7ce28c6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1534,14 +1534,14 @@ public class GridView extends AbsListView {
            case FOCUS_LEFT:
                if (selectedPosition > startOfRowPos) {
                    mLayoutMode = LAYOUT_MOVE_SELECTION;
                    setSelectionInt(selectedPosition - 1);
                    setSelectionInt(Math.max(0, selectedPosition - 1));
                    moved = true;
                }
                break;
            case FOCUS_RIGHT:
                if (selectedPosition < endOfRowPos) {
                    mLayoutMode = LAYOUT_MOVE_SELECTION;
                    setSelectionInt(selectedPosition + 1);
                    setSelectionInt(Math.min(selectedPosition + 1, mItemCount - 1));
                    moved = true;
                }
                break;