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

Commit fd43c315 authored by Ameer Armaly's avatar Ameer Armaly
Browse files

Fix NullPointerException on double tap on hold.

We don't need to confirm that pointers are non-zero in TouchExplorer#onDoubleTapAndHold; it is the job of the gesture matcher and the gesture manifold to prevent weirdness.
Bug: 146997332
Test: atest AccessibilityGestureDetectorTest TouchExplorerTest GestureManifoldTest
Change-Id: I12eb42155c1e55b13840bacea962be4759354214
parent af56f015
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -37,6 +37,12 @@ class MultiTapAndHold extends MultiTap {
        }
        }
    }
    }


    @Override
    protected void onUp(MotionEvent event, MotionEvent rawEvent, int policyFlags) {
        super.onUp(event, rawEvent, policyFlags);
        cancelAfterDoubleTapTimeout(event, rawEvent, policyFlags);
    }

    @Override
    @Override
    public String getGestureName() {
    public String getGestureName() {
        switch (mTargetTaps) {
        switch (mTargetTaps) {
+0 −4
Original line number Original line Diff line number Diff line
@@ -286,10 +286,6 @@ public class TouchExplorer extends BaseEventStreamTransformation


    @Override
    @Override
    public void onDoubleTapAndHold() {
    public void onDoubleTapAndHold() {
        // Pointers should not be zero when running this command.
        if (mState.getLastReceivedEvent().getPointerCount() == 0) {
            return;
        }
        // Try to use the standard accessibility API to long click
        // Try to use the standard accessibility API to long click
        if (!mAms.performActionOnAccessibilityFocusedItem(
        if (!mAms.performActionOnAccessibilityFocusedItem(
                AccessibilityNodeInfo.AccessibilityAction.ACTION_LONG_CLICK)) {
                AccessibilityNodeInfo.AccessibilityAction.ACTION_LONG_CLICK)) {