Skip to content

Commit cc822a7

Browse files
sganovAndroid (Google) Code Review
authored andcommitted
Merge "Touch exploration gesture end not delivered to clients." into jb-dev
2 parents b6585d1 + cd94caf commit cc822a7

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)