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

Commit bd206d12 authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

Touch explorer does not perform tap with the right pointer.

The touch explorer was using the id of the last pointer that
went up while injecting up and down to tap through the last
touch explore event incorrectly assuming that the last up
pointer did touch explore. This was leading to a system crash.

bug:5319315

Change-Id: Iffe8ef753795ad685abe6f493cc09adac8bfea94
parent 68901a3e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -659,8 +659,8 @@ public class TouchExplorer implements Explorer {
     * @param policyFlags The policy flags associated with the event.
     */
    private void sendActionDownAndUp(MotionEvent prototype, int policyFlags) {
        // Tap with the pointer that last went up - we may have inactive pointers.
        final int pointerId = mPointerTracker.getLastReceivedUpPointerId();
        // Tap with the pointer that last explored - we may have inactive pointers.
        final int pointerId = prototype.getPointerId(prototype.getActionIndex());
        final int pointerIdBits = (1 << pointerId);
        sendMotionEvent(prototype, MotionEvent.ACTION_DOWN, pointerIdBits, policyFlags);
        sendMotionEvent(prototype, MotionEvent.ACTION_UP, pointerIdBits, policyFlags);