Bug 764051 - Fix crasher when accessibility is turned off. r=blassey
authorEitan Isaacson <eitan@monotonous.org>
Wed, 13 Jun 2012 12:22:51 -0700
changeset 101422 7ff8130ad590f43741e9a77e0cf79e3ec6d17cae
parent 101421 584ae96f6c9568fd830c2a356c57397c9b26e906
child 101423 a90627b90bba1f7cd0440ea81af6015524cfa0c1
push id1316
push userakeybl@mozilla.com
push dateMon, 27 Aug 2012 22:37:00 +0000
treeherdermozilla-beta@db4b09302ee2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs764051
milestone16.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 764051 - Fix crasher when accessibility is turned off. r=blassey
mobile/android/base/GeckoApp.java
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -1157,17 +1157,21 @@ abstract public class GeckoApp
                 accEvent.setItemCount(message.optInt("itemCount"));
                 accEvent.setCurrentItemIndex(message.optInt("currentItemIndex"));
                 accEvent.setBeforeText(message.optString("beforeText"));
 
                 mMainHandler.post(new Runnable() {
                     public void run() {
                         AccessibilityManager accessibilityManager =
                             (AccessibilityManager) mAppContext.getSystemService(Context.ACCESSIBILITY_SERVICE);
-                        accessibilityManager.sendAccessibilityEvent(accEvent);
+                        try {
+                            accessibilityManager.sendAccessibilityEvent(accEvent);
+                        } catch (IllegalStateException e) {
+                            // Accessibility is off.
+                        }
                     }
                 });
             } else if (event.equals("Accessibility:Ready")) {
                 mMainHandler.post(new Runnable() {
                     public void run() {
                         JSONObject ret = new JSONObject();
                         AccessibilityManager accessibilityManager =
                             (AccessibilityManager) mAppContext.getSystemService(Context.ACCESSIBILITY_SERVICE);