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
This commit is contained in:
Svetoslav Ganov
2011-09-15 17:33:07 -07:00
parent 68901a3e81
commit bd206d129f

View File

@ -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);