Merge "TouchExplorer crashes if there is incative pointer while dragging." into ics-mr0

This commit is contained in:
Svetoslav Ganov
2011-10-18 11:51:29 -07:00
committed by Android (Google) Code Review

View File

@@ -487,8 +487,16 @@ public class TouchExplorer implements Explorer {
}
} break;
case MotionEvent.ACTION_POINTER_UP: {
// Send an event to the end of the drag gesture.
sendMotionEvent(event, MotionEvent.ACTION_UP, pointerIdBits, policyFlags);
final int activePointerCount = mPointerTracker.getActivePointerCount();
switch (activePointerCount) {
case 1: {
// Send an event to the end of the drag gesture.
sendMotionEvent(event, MotionEvent.ACTION_UP, pointerIdBits, policyFlags);
} break;
default: {
mCurrentState = STATE_TOUCH_EXPLORING;
}
}
} break;
case MotionEvent.ACTION_UP: {
mCurrentState = STATE_TOUCH_EXPLORING;