Loading services/java/com/android/server/accessibility/TouchExplorer.java +12 −8 Original line number Original line Diff line number Diff line Loading @@ -226,8 +226,9 @@ public class TouchExplorer implements Explorer { // Send a hover for every finger down so the user gets feedback // Send a hover for every finger down so the user gets feedback // where she is currently touching. // where she is currently touching. mSendHoverDelayed.forceSendAndRemove(); mSendHoverDelayed.forceSendAndRemove(); mSendHoverDelayed.post(event, MotionEvent.ACTION_HOVER_ENTER, 1, policyFlags, final int pointerIdBits = (1 << event.getActionIndex()); DELAY_SEND_HOVER_MOVE); mSendHoverDelayed.post(event, MotionEvent.ACTION_HOVER_ENTER, pointerIdBits, policyFlags, DELAY_SEND_HOVER_MOVE); } break; } break; case MotionEvent.ACTION_POINTER_DOWN: { case MotionEvent.ACTION_POINTER_DOWN: { switch (activePointerCount) { switch (activePointerCount) { Loading Loading @@ -355,6 +356,7 @@ public class TouchExplorer implements Explorer { sendAccessibilityEvent(TYPE_TOUCH_EXPLORATION_GESTURE_END); sendAccessibilityEvent(TYPE_TOUCH_EXPLORATION_GESTURE_END); mTouchExploreGestureInProgress = false; mTouchExploreGestureInProgress = false; } } mLastTouchExploreEvent = null; mDraggingPointerId = pointerId; mDraggingPointerId = pointerId; sendMotionEvent(event, MotionEvent.ACTION_DOWN, pointerIdBits, sendMotionEvent(event, MotionEvent.ACTION_DOWN, pointerIdBits, policyFlags); policyFlags); Loading @@ -365,6 +367,7 @@ public class TouchExplorer implements Explorer { sendAccessibilityEvent(TYPE_TOUCH_EXPLORATION_GESTURE_END); sendAccessibilityEvent(TYPE_TOUCH_EXPLORATION_GESTURE_END); mTouchExploreGestureInProgress = false; mTouchExploreGestureInProgress = false; } } mLastTouchExploreEvent = null; sendDownForAllActiveNotInjectedPointers(event, policyFlags); sendDownForAllActiveNotInjectedPointers(event, policyFlags); } } } break; } break; Loading @@ -382,6 +385,7 @@ public class TouchExplorer implements Explorer { sendAccessibilityEvent(TYPE_TOUCH_EXPLORATION_GESTURE_END); sendAccessibilityEvent(TYPE_TOUCH_EXPLORATION_GESTURE_END); mTouchExploreGestureInProgress = false; mTouchExploreGestureInProgress = false; } } mLastTouchExploreEvent = null; sendDownForAllActiveNotInjectedPointers(event, policyFlags); sendDownForAllActiveNotInjectedPointers(event, policyFlags); } } } } Loading Loading @@ -728,7 +732,7 @@ public class TouchExplorer implements Explorer { /** /** * Sends an event. * Sends an event. * * * @param event The event to send. * @param prototype The prototype from which to create the injected events. * @param action The action of the event. * @param action The action of the event. * @param pointerIdBits The bits of the pointers to send. * @param pointerIdBits The bits of the pointers to send. * @param policyFlags The policy flags associated with the event. * @param policyFlags The policy flags associated with the event. Loading Loading @@ -979,7 +983,7 @@ public class TouchExplorer implements Explorer { case MotionEvent.ACTION_DOWN: { case MotionEvent.ACTION_DOWN: { // New gesture so restart tracking injected down pointers. // New gesture so restart tracking injected down pointers. mInjectedPointersDown = 0; mInjectedPointersDown = 0; handleReceivedPointerDown(0, event); handleReceivedPointerDown(event.getActionIndex(), event); } break; } break; case MotionEvent.ACTION_POINTER_DOWN: { case MotionEvent.ACTION_POINTER_DOWN: { handleReceivedPointerDown(event.getActionIndex(), event); handleReceivedPointerDown(event.getActionIndex(), event); Loading @@ -988,7 +992,7 @@ public class TouchExplorer implements Explorer { handleReceivedPointerMove(event); handleReceivedPointerMove(event); } break; } break; case MotionEvent.ACTION_UP: { case MotionEvent.ACTION_UP: { handleReceivedPointerUp(0, event); handleReceivedPointerUp(event.getActionIndex(), event); } break; } break; case MotionEvent.ACTION_POINTER_UP: { case MotionEvent.ACTION_POINTER_UP: { handleReceivedPointerUp(event.getActionIndex(), event); handleReceivedPointerUp(event.getActionIndex(), event); Loading @@ -1008,13 +1012,13 @@ public class TouchExplorer implements Explorer { final int action = event.getActionMasked(); final int action = event.getActionMasked(); switch (action) { switch (action) { case MotionEvent.ACTION_DOWN: { case MotionEvent.ACTION_DOWN: { handleInjectedPointerDown(0, event); handleInjectedPointerDown(event.getActionIndex(), event); } break; } break; case MotionEvent.ACTION_POINTER_DOWN: { case MotionEvent.ACTION_POINTER_DOWN: { handleInjectedPointerDown(event.getActionIndex(), event); handleInjectedPointerDown(event.getActionIndex(), event); } break; } break; case MotionEvent.ACTION_UP: { case MotionEvent.ACTION_UP: { handleInjectedPointerUp(0, event); handleInjectedPointerUp(event.getActionIndex(), event); } break; } break; case MotionEvent.ACTION_POINTER_UP: { case MotionEvent.ACTION_POINTER_UP: { handleInjectedPointerUp(event.getActionIndex(), event); handleInjectedPointerUp(event.getActionIndex(), event); Loading Loading
services/java/com/android/server/accessibility/TouchExplorer.java +12 −8 Original line number Original line Diff line number Diff line Loading @@ -226,8 +226,9 @@ public class TouchExplorer implements Explorer { // Send a hover for every finger down so the user gets feedback // Send a hover for every finger down so the user gets feedback // where she is currently touching. // where she is currently touching. mSendHoverDelayed.forceSendAndRemove(); mSendHoverDelayed.forceSendAndRemove(); mSendHoverDelayed.post(event, MotionEvent.ACTION_HOVER_ENTER, 1, policyFlags, final int pointerIdBits = (1 << event.getActionIndex()); DELAY_SEND_HOVER_MOVE); mSendHoverDelayed.post(event, MotionEvent.ACTION_HOVER_ENTER, pointerIdBits, policyFlags, DELAY_SEND_HOVER_MOVE); } break; } break; case MotionEvent.ACTION_POINTER_DOWN: { case MotionEvent.ACTION_POINTER_DOWN: { switch (activePointerCount) { switch (activePointerCount) { Loading Loading @@ -355,6 +356,7 @@ public class TouchExplorer implements Explorer { sendAccessibilityEvent(TYPE_TOUCH_EXPLORATION_GESTURE_END); sendAccessibilityEvent(TYPE_TOUCH_EXPLORATION_GESTURE_END); mTouchExploreGestureInProgress = false; mTouchExploreGestureInProgress = false; } } mLastTouchExploreEvent = null; mDraggingPointerId = pointerId; mDraggingPointerId = pointerId; sendMotionEvent(event, MotionEvent.ACTION_DOWN, pointerIdBits, sendMotionEvent(event, MotionEvent.ACTION_DOWN, pointerIdBits, policyFlags); policyFlags); Loading @@ -365,6 +367,7 @@ public class TouchExplorer implements Explorer { sendAccessibilityEvent(TYPE_TOUCH_EXPLORATION_GESTURE_END); sendAccessibilityEvent(TYPE_TOUCH_EXPLORATION_GESTURE_END); mTouchExploreGestureInProgress = false; mTouchExploreGestureInProgress = false; } } mLastTouchExploreEvent = null; sendDownForAllActiveNotInjectedPointers(event, policyFlags); sendDownForAllActiveNotInjectedPointers(event, policyFlags); } } } break; } break; Loading @@ -382,6 +385,7 @@ public class TouchExplorer implements Explorer { sendAccessibilityEvent(TYPE_TOUCH_EXPLORATION_GESTURE_END); sendAccessibilityEvent(TYPE_TOUCH_EXPLORATION_GESTURE_END); mTouchExploreGestureInProgress = false; mTouchExploreGestureInProgress = false; } } mLastTouchExploreEvent = null; sendDownForAllActiveNotInjectedPointers(event, policyFlags); sendDownForAllActiveNotInjectedPointers(event, policyFlags); } } } } Loading Loading @@ -728,7 +732,7 @@ public class TouchExplorer implements Explorer { /** /** * Sends an event. * Sends an event. * * * @param event The event to send. * @param prototype The prototype from which to create the injected events. * @param action The action of the event. * @param action The action of the event. * @param pointerIdBits The bits of the pointers to send. * @param pointerIdBits The bits of the pointers to send. * @param policyFlags The policy flags associated with the event. * @param policyFlags The policy flags associated with the event. Loading Loading @@ -979,7 +983,7 @@ public class TouchExplorer implements Explorer { case MotionEvent.ACTION_DOWN: { case MotionEvent.ACTION_DOWN: { // New gesture so restart tracking injected down pointers. // New gesture so restart tracking injected down pointers. mInjectedPointersDown = 0; mInjectedPointersDown = 0; handleReceivedPointerDown(0, event); handleReceivedPointerDown(event.getActionIndex(), event); } break; } break; case MotionEvent.ACTION_POINTER_DOWN: { case MotionEvent.ACTION_POINTER_DOWN: { handleReceivedPointerDown(event.getActionIndex(), event); handleReceivedPointerDown(event.getActionIndex(), event); Loading @@ -988,7 +992,7 @@ public class TouchExplorer implements Explorer { handleReceivedPointerMove(event); handleReceivedPointerMove(event); } break; } break; case MotionEvent.ACTION_UP: { case MotionEvent.ACTION_UP: { handleReceivedPointerUp(0, event); handleReceivedPointerUp(event.getActionIndex(), event); } break; } break; case MotionEvent.ACTION_POINTER_UP: { case MotionEvent.ACTION_POINTER_UP: { handleReceivedPointerUp(event.getActionIndex(), event); handleReceivedPointerUp(event.getActionIndex(), event); Loading @@ -1008,13 +1012,13 @@ public class TouchExplorer implements Explorer { final int action = event.getActionMasked(); final int action = event.getActionMasked(); switch (action) { switch (action) { case MotionEvent.ACTION_DOWN: { case MotionEvent.ACTION_DOWN: { handleInjectedPointerDown(0, event); handleInjectedPointerDown(event.getActionIndex(), event); } break; } break; case MotionEvent.ACTION_POINTER_DOWN: { case MotionEvent.ACTION_POINTER_DOWN: { handleInjectedPointerDown(event.getActionIndex(), event); handleInjectedPointerDown(event.getActionIndex(), event); } break; } break; case MotionEvent.ACTION_UP: { case MotionEvent.ACTION_UP: { handleInjectedPointerUp(0, event); handleInjectedPointerUp(event.getActionIndex(), event); } break; } break; case MotionEvent.ACTION_POINTER_UP: { case MotionEvent.ACTION_POINTER_UP: { handleInjectedPointerUp(event.getActionIndex(), event); handleInjectedPointerUp(event.getActionIndex(), event); Loading