From cd94caf2bb94f07522ea5bbf0e37dea960b38220 Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Sun, 3 Jun 2012 19:34:34 -0700 Subject: Touch exploration gesture end not delivered to clients. 1. Touch exploration gestures are demarcated by start and end events. Due to a bug in the AccessibilityManagerService the gesture end event was not dispatched. This caused the AccessibilityNodeInfoCache to be off sync since it relies on getting such events not to mention that the clients were not getting the end but only the start event. The issue was that the notified service types variable was not reset after every event so when the manager sends the last hover exit it flags that the service type is already notified resulting in dropping on the floor the following gesture end event. bug:6539306 Change-Id: I2b96bcecea3b2240199d67f01afa6a033afce1de --- .../server/accessibility/AccessibilityManagerService.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'services') diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java index 3e8f512..617a7f3 100644 --- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -384,9 +384,11 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } public boolean sendAccessibilityEvent(AccessibilityEvent event) { + final int eventType = event.getEventType(); + // The event for gesture start should be strictly before the // first hover enter event for the gesture. - if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_HOVER_ENTER + if (eventType == AccessibilityEvent.TYPE_VIEW_HOVER_ENTER && mTouchExplorationGestureStarted) { mTouchExplorationGestureStarted = false; AccessibilityEvent gestureStartEvent = AccessibilityEvent.obtain( @@ -400,11 +402,14 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { notifyAccessibilityServicesDelayedLocked(event, false); notifyAccessibilityServicesDelayedLocked(event, true); } + + event.recycle(); + mHandledFeedbackTypes = 0; } // The event for gesture end should be strictly after the // last hover exit event for the gesture. - if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_HOVER_EXIT + if (eventType == AccessibilityEvent.TYPE_VIEW_HOVER_EXIT && mTouchExplorationGestureEnded) { mTouchExplorationGestureEnded = false; AccessibilityEvent gestureEndEvent = AccessibilityEvent.obtain( @@ -412,9 +417,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { sendAccessibilityEvent(gestureEndEvent); } - event.recycle(); - mHandledFeedbackTypes = 0; - return (OWN_PROCESS_ID != Binder.getCallingPid()); } -- cgit v1.1