Skip to content

Commit b772615

Browse files
sganovAndroid (Google) Code Review
authored andcommitted
Merge "Crash in the touch explorer." into jb-dev
2 parents 86bbf70 + e45c0b2 commit b772615

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
113113

114114
private static final int MSG_TOGGLE_TOUCH_EXPLORATION = 2;
115115

116+
private static final int MSG_SEND_ACCESSIBILITY_EVENT_TO_INPUT_FILTER = 3;
117+
116118
private static int sIdCounter = 0;
117119

118120
private static int sNextWindowId;
@@ -402,7 +404,9 @@ public boolean sendAccessibilityEvent(AccessibilityEvent event) {
402404
notifyAccessibilityServicesDelayedLocked(event, true);
403405
}
404406
if (mHasInputFilter && mInputFilter != null) {
405-
mInputFilter.onAccessibilityEvent(event);
407+
mMainHandler.obtainMessage(MSG_SEND_ACCESSIBILITY_EVENT_TO_INPUT_FILTER,
408+
AccessibilityEvent.obtain(event)).sendToTarget();
409+
406410
}
407411
event.recycle();
408412
mHandledFeedbackTypes = 0;
@@ -1104,7 +1108,14 @@ public void onClick(DialogInterface dialog, int which) {
11041108
mEnableTouchExplorationDialog.setCanceledOnTouchOutside(true);
11051109
mEnableTouchExplorationDialog.show();
11061110
}
1107-
}
1111+
} break;
1112+
case MSG_SEND_ACCESSIBILITY_EVENT_TO_INPUT_FILTER: {
1113+
AccessibilityEvent event = (AccessibilityEvent) msg.obj;
1114+
if (mHasInputFilter && mInputFilter != null) {
1115+
mInputFilter.onAccessibilityEvent(event);
1116+
}
1117+
event.recycle();
1118+
} break;
11081119
}
11091120
}
11101121
}

0 commit comments

Comments
 (0)