Skip to content

Commit

Permalink
[DO NOT MERGE] Clear properties after interaction is ended
Browse files Browse the repository at this point in the history
The properties populated when double-tap and hold is detected is not
cleared after interaction end. It cuases an offset on hoverevent.

Bug: 160463594
Test: atest TouchExplorerTest
Change-Id: Id5115fe64e4bda9c7657f67bef62290858442de9
  • Loading branch information
ryanlwlin committed Jul 8, 2020
1 parent 76cfda5 commit 1145db5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,12 @@ public boolean longPressWithTouchEvents(MotionEvent event, int policyFlags) {
return true;
}

void clear() {
mLongPressingPointerId = -1;
mLongPressingPointerDeltaX = 0;
mLongPressingPointerDeltaY = 0;
}

public void clickWithTouchEvents(MotionEvent event, MotionEvent rawEvent, int policyFlags) {
final int pointerIndex = event.getActionIndex();
final int pointerId = event.getPointerId(pointerIndex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ private void handleMotionEventStateDelegating(

// Announce the end of a the touch interaction.
mAms.onTouchInteractionEnd();
mDispatcher.clear();
mDispatcher.sendAccessibilityEvent(AccessibilityEvent.TYPE_TOUCH_INTERACTION_END);

} break;
Expand Down

0 comments on commit 1145db5

Please sign in to comment.