Bug 812480 - [AccessFu] Fix accessibility announcements in Android 4.2, r=blassey, a=akeybl
authorEitan Isaacson <eitan@monotonous.org>
Fri, 16 Nov 2012 14:05:00 +0100
changeset 118329 25369927b36453122892d1f00721e2b78c688f78
parent 118328 2f801d18884d51008b7fcf72fa1f281004fd1ca0
child 118330 221d912483141d2f03a702ff3089b3890fedde8a
push id2748
push usermzehe@mozilla.com
push dateWed, 21 Nov 2012 08:37:47 +0000
treeherdermozilla-aurora@25369927b364 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey, akeybl
bugs812480
milestone19.0a2
Bug 812480 - [AccessFu] Fix accessibility announcements in Android 4.2, r=blassey, a=akeybl
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;
                         }
                     }
                 });