diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2012-10-07 09:02:27 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-10-07 09:02:27 -0700 |
commit | 70c0a168d02146e6f5d43adb13cc0edf0ea8490a (patch) | |
tree | be969e6f7feb0b994ebc5f3ef3ecf642ae03701a /services | |
parent | 1a5c9ecee0a99c3f5eee6e524911e2f6ff5eb747 (diff) | |
parent | 1ad0fd9c04ae2e352c59129b979145e662f25cbc (diff) | |
download | frameworks_base-70c0a168d02146e6f5d43adb13cc0edf0ea8490a.zip frameworks_base-70c0a168d02146e6f5d43adb13cc0edf0ea8490a.tar.gz frameworks_base-70c0a168d02146e6f5d43adb13cc0edf0ea8490a.tar.bz2 |
am 1ad0fd9c: Merge "Accessibility active window not updated on time." into jb-mr1-dev
* commit '1ad0fd9c04ae2e352c59129b979145e662f25cbc':
Accessibility active window not updated on time.
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/accessibility/AccessibilityManagerService.java | 22 | ||||
-rw-r--r-- | services/java/com/android/server/accessibility/TouchExplorer.java | 5 |
2 files changed, 22 insertions, 5 deletions
diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java index 5e9e223..6782f5e 100644 --- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -643,6 +643,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { return mSecurityPolicy.mActiveWindowId; } + void onTouchInteractionEnd() { + mSecurityPolicy.onTouchInteractionEnd(); + } + private void switchUser(int userId) { synchronized (mLock) { // The user switched so we do not need to restore the current user @@ -2178,16 +2182,24 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { mActiveWindowId = windowId; } } break; - case AccessibilityEvent.TYPE_VIEW_HOVER_ENTER: - case AccessibilityEvent.TYPE_VIEW_HOVER_EXIT: { + case AccessibilityEvent.TYPE_VIEW_HOVER_ENTER: { mActiveWindowId = windowId; } 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() { return mActiveWindowId; } diff --git a/services/java/com/android/server/accessibility/TouchExplorer.java b/services/java/com/android/server/accessibility/TouchExplorer.java index b3bf6fe..2688776 100644 --- a/services/java/com/android/server/accessibility/TouchExplorer.java +++ b/services/java/com/android/server/accessibility/TouchExplorer.java @@ -304,6 +304,7 @@ class TouchExplorer implements EventStreamTransformation { mNext.clear(); } mTouchExplorationInProgress = false; + mAms.onTouchInteractionEnd(); } @Override @@ -615,6 +616,7 @@ class TouchExplorer implements EventStreamTransformation { } } break; case MotionEvent.ACTION_UP: + mAms.onTouchInteractionEnd(); // We know that we do not need the pre-fed gesture points are not // needed anymore since the last pointer just went up. mStrokeBuffer.clear(); @@ -737,6 +739,7 @@ class TouchExplorer implements EventStreamTransformation { } } break; case MotionEvent.ACTION_UP: { + mAms.onTouchInteractionEnd(); // Announce the end of a new touch interaction. sendAccessibilityEvent( AccessibilityEvent.TYPE_TOUCH_INTERACTION_END); @@ -782,6 +785,7 @@ class TouchExplorer implements EventStreamTransformation { AccessibilityEvent.TYPE_TOUCH_INTERACTION_END); //$FALL-THROUGH$ case MotionEvent.ACTION_POINTER_UP: { + mAms.onTouchInteractionEnd(); mLongPressingPointerId = -1; mLongPressingPointerDeltaX = 0; mLongPressingPointerDeltaY = 0; @@ -819,6 +823,7 @@ class TouchExplorer implements EventStreamTransformation { } } break; case MotionEvent.ACTION_UP: { + mAms.onTouchInteractionEnd(); // Announce the end of gesture recognition. sendAccessibilityEvent( AccessibilityEvent.TYPE_GESTURE_DETECTION_END); |