am 778fa81f: Merge "Fixing a crash in the TouchExplorer." into jb-dev
* commit '778fa81f5da05dcc45260caa70c97971bdccf8bb': Fixing a crash in the TouchExplorer.
This commit is contained in:
@@ -327,9 +327,10 @@ public class TouchExplorer {
|
|||||||
if (mSendHoverEnterDelayed.isPending()) {
|
if (mSendHoverEnterDelayed.isPending()) {
|
||||||
mSendHoverEnterDelayed.remove();
|
mSendHoverEnterDelayed.remove();
|
||||||
mSendHoverExitDelayed.remove();
|
mSendHoverExitDelayed.remove();
|
||||||
mPerformLongPressDelayed.remove();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mPerformLongPressDelayed.remove();
|
||||||
|
|
||||||
// If we have the first tap schedule a long press and break
|
// If we have the first tap schedule a long press and break
|
||||||
// since we do not want to schedule hover enter because
|
// since we do not want to schedule hover enter because
|
||||||
// the delayed callback will kick in before the long click.
|
// the delayed callback will kick in before the long click.
|
||||||
@@ -396,6 +397,7 @@ public class TouchExplorer {
|
|||||||
// exploring so start sending events.
|
// exploring so start sending events.
|
||||||
mSendHoverEnterDelayed.forceSendAndRemove();
|
mSendHoverEnterDelayed.forceSendAndRemove();
|
||||||
mSendHoverExitDelayed.remove();
|
mSendHoverExitDelayed.remove();
|
||||||
|
mPerformLongPressDelayed.remove();
|
||||||
sendMotionEvent(event, MotionEvent.ACTION_HOVER_MOVE,
|
sendMotionEvent(event, MotionEvent.ACTION_HOVER_MOVE,
|
||||||
pointerIdBits, policyFlags);
|
pointerIdBits, policyFlags);
|
||||||
}
|
}
|
||||||
@@ -422,6 +424,7 @@ public class TouchExplorer {
|
|||||||
mSendHoverExitDelayed.remove();
|
mSendHoverExitDelayed.remove();
|
||||||
mPerformLongPressDelayed.remove();
|
mPerformLongPressDelayed.remove();
|
||||||
} else {
|
} else {
|
||||||
|
mPerformLongPressDelayed.remove();
|
||||||
// If the user is touch exploring the second pointer may be
|
// If the user is touch exploring the second pointer may be
|
||||||
// performing a double tap to activate an item without need
|
// performing a double tap to activate an item without need
|
||||||
// for the user to lift his exploring finger.
|
// for the user to lift his exploring finger.
|
||||||
@@ -446,9 +449,6 @@ public class TouchExplorer {
|
|||||||
if (isDraggingGesture(event)) {
|
if (isDraggingGesture(event)) {
|
||||||
// Two pointers moving in the same direction within
|
// Two pointers moving in the same direction within
|
||||||
// a given distance perform a drag.
|
// a given distance perform a drag.
|
||||||
mSendHoverEnterDelayed.remove();
|
|
||||||
mSendHoverExitDelayed.remove();
|
|
||||||
mPerformLongPressDelayed.remove();
|
|
||||||
mCurrentState = STATE_DRAGGING;
|
mCurrentState = STATE_DRAGGING;
|
||||||
mDraggingPointerId = pointerId;
|
mDraggingPointerId = pointerId;
|
||||||
sendMotionEvent(event, MotionEvent.ACTION_DOWN, pointerIdBits,
|
sendMotionEvent(event, MotionEvent.ACTION_DOWN, pointerIdBits,
|
||||||
@@ -469,6 +469,7 @@ public class TouchExplorer {
|
|||||||
mSendHoverExitDelayed.remove();
|
mSendHoverExitDelayed.remove();
|
||||||
mPerformLongPressDelayed.remove();
|
mPerformLongPressDelayed.remove();
|
||||||
} else {
|
} else {
|
||||||
|
mPerformLongPressDelayed.remove();
|
||||||
// We are sending events so send exit and gesture
|
// We are sending events so send exit and gesture
|
||||||
// end since we transition to another state.
|
// end since we transition to another state.
|
||||||
sendExitEventsIfNeeded(policyFlags);
|
sendExitEventsIfNeeded(policyFlags);
|
||||||
@@ -1247,6 +1248,11 @@ public class TouchExplorer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
// Active pointers should not be zero when running this command.
|
||||||
|
if (mReceivedPointerTracker.getActivePointerCount() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// If the last touched explored location is not within the focused
|
// If the last touched explored location is not within the focused
|
||||||
// window we will long press at that exact spot, otherwise we find the
|
// window we will long press at that exact spot, otherwise we find the
|
||||||
// accessibility focus and if the tap is within its bounds we long press
|
// accessibility focus and if the tap is within its bounds we long press
|
||||||
|
|||||||
Reference in New Issue
Block a user