Bug 829912 - Check for null IME hints. r=jchen, a=lsblakk
authorChris Peterson <cpeterson@mozilla.com>
Mon, 14 Jan 2013 16:57:50 -0800
changeset 127193 003d8353090e31fef67381d7c4e330975c0ffcef
parent 127192 d39c44ce7f8b6aec65bc1f70a9a244800bd9de55
child 127194 c26befa04d806cad5c6b06903eb8b5872af5ca0a
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjchen, lsblakk
bugs829912
milestone20.0a2
Bug 829912 - Check for null IME hints. r=jchen, a=lsblakk
mobile/android/base/GeckoInputConnection.java
--- a/mobile/android/base/GeckoInputConnection.java
+++ b/mobile/android/base/GeckoInputConnection.java
@@ -510,20 +510,23 @@ class GeckoInputConnection
         }
     }
 
     public void notifyIMEEnabled(final int state, final String typeHint,
                                  final String modeHint, final String actionHint) {
         // For some input type we will use a widget to display the ui, for those we must not
         // display the ime. We can display a widget for date and time types and, if the sdk version
         // is greater than 11, for datetime/month/week as well.
-        if (typeHint.equals("date") || typeHint.equals("time") ||
-            (Build.VERSION.SDK_INT > 10 &&
-            (typeHint.equals("datetime") || typeHint.equals("month") ||
-            typeHint.equals("week") || typeHint.equals("datetime-local")))) {
+        if (typeHint != null &&
+            (typeHint.equals("date") ||
+             typeHint.equals("time") ||
+             (Build.VERSION.SDK_INT > 10 && (typeHint.equals("datetime") ||
+                                             typeHint.equals("month") ||
+                                             typeHint.equals("week") ||
+                                             typeHint.equals("datetime-local"))))) {
             mIMEState = IME_STATE_DISABLED;
             return;
         }
 
         /* When IME is 'disabled', IME processing is disabled.
            In addition, the IME UI is hidden */
         mIMEState = state;
         mIMETypeHint = (typeHint == null) ? "" : typeHint;