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

Commit e39304db authored by lijilou's avatar lijilou Committed by Jilou li
Browse files

Fix array index out of bounds exception problem.

The getPrimaryPointerId method may return the  INVALID_POINTER_ID(-1) value and result to  array index out of bounds exception.The crash log:
java.lang.ArrayIndexOutOfBoundsException: length=32; index=-1
at com.android.server.accessibility.gestures.TouchState$ReceivedPointerTracker.getReceivedPointerDownX(TouchState.java:482)
at com.android.server.accessibility.gestures.TouchExplorer.handleActionMoveStateTouchExploring(TouchExplorer.java:910)
.....

Test: monkey test
Flag: EXEMPT bugfix
Bug: 399557645
Change-Id: Ib0b14471953d8f78cf98122dd868be8b80059a75
parent 42401c8b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -901,6 +901,9 @@ public class TouchExplorer extends BaseEventStreamTransformation
                    mSendHoverEnterAndMoveDelayed.cancel();
                    mSendHoverExitDelayed.cancel();
                }
                if (pointerIndex < 0) {
                    return;
                }
                // If the user is touch exploring the second pointer may be
                // performing a double tap to activate an item without need
                // for the user to lift their exploring finger.