Fix service touch exploration.

We were queueing up ACTION_HOVER_EXIT when initiating touch exploration which doesn't make sense. ACTION_HOVER_EXIT only makes sense on ACTION_UP when touch exploring.

Fix: 219814318
Fix: 220387502
Test: Verify that entering a pin works as expected.
Test: Verify that touch exploration does not get stuck often, only occasionally per b/215654623
Change-Id: Iab29f7736ab4ff3ea24c26109073481a876ffb58
This commit is contained in:
Ameer Armaly
2022-03-04 15:48:59 -08:00
parent 836db75e0f
commit 0d352887e2

View File

@@ -1327,14 +1327,13 @@ public class TouchExplorer extends BaseEventStreamTransformation
if (mState.isServiceDetectingGestures() && mState.isTouchInteracting()) {
// Cancel without deleting events.
mHandler.removeCallbacks(mSendHoverEnterAndMoveDelayed);
mSendHoverEnterAndMoveDelayed.run();
mSendHoverEnterAndMoveDelayed.clear();
final MotionEvent prototype = mState.getLastReceivedEvent();
final MotionEvent rawEvent = mState.getLastReceivedRawEvent();
final int pointerId = mReceivedPointerTracker.getPrimaryPointerId();
final int pointerIdBits = (1 << pointerId);
final int policyFlags = mState.getLastReceivedPolicyFlags();
mSendHoverExitDelayed.post(prototype, rawEvent, pointerIdBits, policyFlags);
mSendHoverEnterAndMoveDelayed.setPointerIdBits(pointerIdBits);
mSendHoverEnterAndMoveDelayed.setPolicyFlags(policyFlags);
mSendHoverEnterAndMoveDelayed.run();
mSendHoverEnterAndMoveDelayed.clear();
}
}