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

Commit 0bc3cc9c authored by Zachary Kuznia's avatar Zachary Kuznia Committed by Zach Kuznia
Browse files

Fix crash when cancelling an accessibility gesture with ACTION_UP.

b/27090049

Change-Id: I7a5b65c4e96513539d820c9a2bef99272fb24680
(cherry picked from commit 3951e354)
parent 18026642
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
@@ -467,19 +467,20 @@ class TouchExplorer implements EventStreamTransformation, AccessibilityGestureDe
      if (mCurrentState == STATE_GESTURE_DETECTING) {
          endGestureDetection();
      } else if (mCurrentState == STATE_TOUCH_EXPLORING) {
          // If the finger is still moving, pass the event on.
          if (event.getActionMasked() == MotionEvent.ACTION_MOVE) {
              final int pointerId = mReceivedPointerTracker.getPrimaryPointerId();
              final int pointerIdBits = (1 << pointerId);

          // Cache the event until we discern exploration from gesturing.
          mSendHoverEnterAndMoveDelayed.addEvent(event);

              // We have just decided that the user is touch,
              // exploring so start sending events.
              mSendHoverEnterAndMoveDelayed.addEvent(event);
              mSendHoverEnterAndMoveDelayed.forceSendAndRemove();
              mSendHoverExitDelayed.cancel();
              sendMotionEvent(event, MotionEvent.ACTION_HOVER_MOVE, pointerIdBits, policyFlags);
          }
      }
    }

    /**
     * Handles a motion event in touch exploring state.