Bug 812480 - [AccessFu] Fix accessibility announcements in Android 4.2, r=blassey
authorEitan Isaacson <eitan@monotonous.org>
Fri, 16 Nov 2012 14:05:00 +0100
changeset 113670 66473f7c498fb2863803d189a81ad5371bbce029
parent 113669 8ab84754b53641eba91101529266fa9d59303a1c
child 113671 41bc47dfa5b24d0aeeeb49c212eb3bc99355d3e1
push id18301
push usermzehe@mozilla.com
push dateMon, 19 Nov 2012 12:44:01 +0000
treeherdermozilla-inbound@66473f7c498f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs812480
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 812480 - [AccessFu] Fix accessibility announcements in Android 4.2, r=blassey
mobile/android/base/GeckoAccessibility.java
--- a/mobile/android/base/GeckoAccessibility.java
+++ b/mobile/android/base/GeckoAccessibility.java
@@ -161,17 +161,20 @@ public class GeckoAccessibility {
                     public void run() {
                         // If this is an accessibility focus, a lot of internal voodoo happens so we perform an
                         // accessibility focus action on the view, and it in turn sends the right events.
                         switch (eventType) {
                         case AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED:
                             view.performAccessibilityAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS, null);
                             break;
                         case AccessibilityEvent.TYPE_ANNOUNCEMENT:
-                            sendDirectAccessibilityEvent(eventType, message);
+                            final AccessibilityEvent accEvent = AccessibilityEvent.obtain(eventType);
+                            view.onInitializeAccessibilityEvent(accEvent);
+                            populateEventFromJSON(accEvent, message);
+                            view.getParent().requestSendAccessibilityEvent(view, accEvent);
                             break;
                         default:
                             view.sendAccessibilityEvent(eventType);
                             break;
                         }
                     }
                 });