Loading services/java/com/android/server/accessibility/AccessibilityManagerService.java +17 −5 Original line number Original line Diff line number Diff line Loading @@ -643,6 +643,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { return mSecurityPolicy.mActiveWindowId; return mSecurityPolicy.mActiveWindowId; } } void onTouchInteractionEnd() { mSecurityPolicy.onTouchInteractionEnd(); } private void switchUser(int userId) { private void switchUser(int userId) { synchronized (mLock) { synchronized (mLock) { // The user switched so we do not need to restore the current user // The user switched so we do not need to restore the current user Loading Loading @@ -2178,16 +2182,24 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { mActiveWindowId = windowId; mActiveWindowId = windowId; } } } break; } break; case AccessibilityEvent.TYPE_VIEW_HOVER_ENTER: case AccessibilityEvent.TYPE_VIEW_HOVER_ENTER: { case AccessibilityEvent.TYPE_VIEW_HOVER_EXIT: { mActiveWindowId = windowId; mActiveWindowId = windowId; } break; } break; case AccessibilityEvent.TYPE_TOUCH_INTERACTION_END: { mActiveWindowId = getFocusedWindowId(); } break; } } } } public void onTouchInteractionEnd() { // We want to set the active window to be current immediately // after the user has stopped touching the screen since if the // user types with the IME he should get a feedback for the // letter typed in the text view which is in the input focused // window. Note that we always deliver hover accessibility events // (they are a result of user touching the screen) so change of // the active window before all hover accessibility events from // the touched window are delivered is fine. mActiveWindowId = getFocusedWindowId(); } public int getRetrievalAllowingWindowLocked() { public int getRetrievalAllowingWindowLocked() { return mActiveWindowId; return mActiveWindowId; } } Loading services/java/com/android/server/accessibility/TouchExplorer.java +5 −0 Original line number Original line Diff line number Diff line Loading @@ -304,6 +304,7 @@ class TouchExplorer implements EventStreamTransformation { mNext.clear(); mNext.clear(); } } mTouchExplorationInProgress = false; mTouchExplorationInProgress = false; mAms.onTouchInteractionEnd(); } } @Override @Override Loading Loading @@ -615,6 +616,7 @@ class TouchExplorer implements EventStreamTransformation { } } } break; } break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_UP: mAms.onTouchInteractionEnd(); // We know that we do not need the pre-fed gesture points are not // We know that we do not need the pre-fed gesture points are not // needed anymore since the last pointer just went up. // needed anymore since the last pointer just went up. mStrokeBuffer.clear(); mStrokeBuffer.clear(); Loading Loading @@ -737,6 +739,7 @@ class TouchExplorer implements EventStreamTransformation { } } } break; } break; case MotionEvent.ACTION_UP: { case MotionEvent.ACTION_UP: { mAms.onTouchInteractionEnd(); // Announce the end of a new touch interaction. // Announce the end of a new touch interaction. sendAccessibilityEvent( sendAccessibilityEvent( AccessibilityEvent.TYPE_TOUCH_INTERACTION_END); AccessibilityEvent.TYPE_TOUCH_INTERACTION_END); Loading Loading @@ -782,6 +785,7 @@ class TouchExplorer implements EventStreamTransformation { AccessibilityEvent.TYPE_TOUCH_INTERACTION_END); AccessibilityEvent.TYPE_TOUCH_INTERACTION_END); //$FALL-THROUGH$ //$FALL-THROUGH$ case MotionEvent.ACTION_POINTER_UP: { case MotionEvent.ACTION_POINTER_UP: { mAms.onTouchInteractionEnd(); mLongPressingPointerId = -1; mLongPressingPointerId = -1; mLongPressingPointerDeltaX = 0; mLongPressingPointerDeltaX = 0; mLongPressingPointerDeltaY = 0; mLongPressingPointerDeltaY = 0; Loading Loading @@ -819,6 +823,7 @@ class TouchExplorer implements EventStreamTransformation { } } } break; } break; case MotionEvent.ACTION_UP: { case MotionEvent.ACTION_UP: { mAms.onTouchInteractionEnd(); // Announce the end of gesture recognition. // Announce the end of gesture recognition. sendAccessibilityEvent( sendAccessibilityEvent( AccessibilityEvent.TYPE_GESTURE_DETECTION_END); AccessibilityEvent.TYPE_GESTURE_DETECTION_END); Loading Loading
services/java/com/android/server/accessibility/AccessibilityManagerService.java +17 −5 Original line number Original line Diff line number Diff line Loading @@ -643,6 +643,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { return mSecurityPolicy.mActiveWindowId; return mSecurityPolicy.mActiveWindowId; } } void onTouchInteractionEnd() { mSecurityPolicy.onTouchInteractionEnd(); } private void switchUser(int userId) { private void switchUser(int userId) { synchronized (mLock) { synchronized (mLock) { // The user switched so we do not need to restore the current user // The user switched so we do not need to restore the current user Loading Loading @@ -2178,16 +2182,24 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { mActiveWindowId = windowId; mActiveWindowId = windowId; } } } break; } break; case AccessibilityEvent.TYPE_VIEW_HOVER_ENTER: case AccessibilityEvent.TYPE_VIEW_HOVER_ENTER: { case AccessibilityEvent.TYPE_VIEW_HOVER_EXIT: { mActiveWindowId = windowId; mActiveWindowId = windowId; } break; } break; case AccessibilityEvent.TYPE_TOUCH_INTERACTION_END: { mActiveWindowId = getFocusedWindowId(); } break; } } } } public void onTouchInteractionEnd() { // We want to set the active window to be current immediately // after the user has stopped touching the screen since if the // user types with the IME he should get a feedback for the // letter typed in the text view which is in the input focused // window. Note that we always deliver hover accessibility events // (they are a result of user touching the screen) so change of // the active window before all hover accessibility events from // the touched window are delivered is fine. mActiveWindowId = getFocusedWindowId(); } public int getRetrievalAllowingWindowLocked() { public int getRetrievalAllowingWindowLocked() { return mActiveWindowId; return mActiveWindowId; } } Loading
services/java/com/android/server/accessibility/TouchExplorer.java +5 −0 Original line number Original line Diff line number Diff line Loading @@ -304,6 +304,7 @@ class TouchExplorer implements EventStreamTransformation { mNext.clear(); mNext.clear(); } } mTouchExplorationInProgress = false; mTouchExplorationInProgress = false; mAms.onTouchInteractionEnd(); } } @Override @Override Loading Loading @@ -615,6 +616,7 @@ class TouchExplorer implements EventStreamTransformation { } } } break; } break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_UP: mAms.onTouchInteractionEnd(); // We know that we do not need the pre-fed gesture points are not // We know that we do not need the pre-fed gesture points are not // needed anymore since the last pointer just went up. // needed anymore since the last pointer just went up. mStrokeBuffer.clear(); mStrokeBuffer.clear(); Loading Loading @@ -737,6 +739,7 @@ class TouchExplorer implements EventStreamTransformation { } } } break; } break; case MotionEvent.ACTION_UP: { case MotionEvent.ACTION_UP: { mAms.onTouchInteractionEnd(); // Announce the end of a new touch interaction. // Announce the end of a new touch interaction. sendAccessibilityEvent( sendAccessibilityEvent( AccessibilityEvent.TYPE_TOUCH_INTERACTION_END); AccessibilityEvent.TYPE_TOUCH_INTERACTION_END); Loading Loading @@ -782,6 +785,7 @@ class TouchExplorer implements EventStreamTransformation { AccessibilityEvent.TYPE_TOUCH_INTERACTION_END); AccessibilityEvent.TYPE_TOUCH_INTERACTION_END); //$FALL-THROUGH$ //$FALL-THROUGH$ case MotionEvent.ACTION_POINTER_UP: { case MotionEvent.ACTION_POINTER_UP: { mAms.onTouchInteractionEnd(); mLongPressingPointerId = -1; mLongPressingPointerId = -1; mLongPressingPointerDeltaX = 0; mLongPressingPointerDeltaX = 0; mLongPressingPointerDeltaY = 0; mLongPressingPointerDeltaY = 0; Loading Loading @@ -819,6 +823,7 @@ class TouchExplorer implements EventStreamTransformation { } } } break; } break; case MotionEvent.ACTION_UP: { case MotionEvent.ACTION_UP: { mAms.onTouchInteractionEnd(); // Announce the end of gesture recognition. // Announce the end of gesture recognition. sendAccessibilityEvent( sendAccessibilityEvent( AccessibilityEvent.TYPE_GESTURE_DETECTION_END); AccessibilityEvent.TYPE_GESTURE_DETECTION_END); Loading