Skip to content

Commit cd94caf

Browse files
committed
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
1 parent 01827ce commit cd94caf

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

services/java/com/android/server/accessibility/AccessibilityManagerService.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,11 @@ public void binderDied() {
384384
}
385385

386386
public boolean sendAccessibilityEvent(AccessibilityEvent event) {
387+
final int eventType = event.getEventType();
388+
387389
// The event for gesture start should be strictly before the
388390
// first hover enter event for the gesture.
389-
if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_HOVER_ENTER
391+
if (eventType == AccessibilityEvent.TYPE_VIEW_HOVER_ENTER
390392
&& mTouchExplorationGestureStarted) {
391393
mTouchExplorationGestureStarted = false;
392394
AccessibilityEvent gestureStartEvent = AccessibilityEvent.obtain(
@@ -400,21 +402,21 @@ public boolean sendAccessibilityEvent(AccessibilityEvent event) {
400402
notifyAccessibilityServicesDelayedLocked(event, false);
401403
notifyAccessibilityServicesDelayedLocked(event, true);
402404
}
405+
406+
event.recycle();
407+
mHandledFeedbackTypes = 0;
403408
}
404409

405410
// The event for gesture end should be strictly after the
406411
// last hover exit event for the gesture.
407-
if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_HOVER_EXIT
412+
if (eventType == AccessibilityEvent.TYPE_VIEW_HOVER_EXIT
408413
&& mTouchExplorationGestureEnded) {
409414
mTouchExplorationGestureEnded = false;
410415
AccessibilityEvent gestureEndEvent = AccessibilityEvent.obtain(
411416
AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_END);
412417
sendAccessibilityEvent(gestureEndEvent);
413418
}
414419

415-
event.recycle();
416-
mHandledFeedbackTypes = 0;
417-
418420
return (OWN_PROCESS_ID != Binder.getCallingPid());
419421
}
420422

0 commit comments

Comments
 (0)