Bug 854006 - Don't cache a11y events that are directly emitted. r=kats,sriram; Additional tweaks by MarcoZ, r=eeejay,kats

This commit is contained in:
Eitan Isaacson 2013-03-26 18:23:03 +01:00
Родитель f60ea4137a
Коммит fc8aade1b0
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -31,6 +31,7 @@ public class GeckoAccessibility {
private static final int VIRTUAL_CURSOR_NEXT = 3;
private static boolean sEnabled = false;
// Used to store the JSON message and populate the event later in the code path.
private static JSONObject sEventMessage = null;
private static AccessibilityNodeInfo sVirtualCursorNode = null;
@ -160,8 +161,6 @@ public class GeckoAccessibility {
sVirtualCursorNode.setBoundsInScreen(screenBounds);
}
// Store the JSON message and use it to populate the event later in the code path.
sEventMessage = message;
ThreadUtils.postToUiThread(new Runnable() {
@Override
public void run() {
@ -169,16 +168,19 @@ public class GeckoAccessibility {
// accessibility focus action on the view, and it in turn sends the right events.
switch (eventType) {
case AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED:
sEventMessage = message;
view.performAccessibilityAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS, null);
break;
case AccessibilityEvent.TYPE_ANNOUNCEMENT:
case AccessibilityEvent.TYPE_VIEW_SCROLLED:
sEventMessage = null;
final AccessibilityEvent accEvent = AccessibilityEvent.obtain(eventType);
view.onInitializeAccessibilityEvent(accEvent);
populateEventFromJSON(accEvent, message);
view.getParent().requestSendAccessibilityEvent(view, accEvent);
break;
default:
sEventMessage = message;
view.sendAccessibilityEvent(eventType);
break;
}