Bug 714708 - NullPointerException at GeckoInputConnection.notifyIME [r=dougt]
authorMark Finkle <mfinkle@mozilla.com>
Tue, 03 Jan 2012 00:54:29 -0500
changeset 84898 ddf371bc13f0d4ad827e0da6c2420352629f3955
parent 84890 6ff43da616bed93b5264b0cdf62aca4349f13006
child 84899 0284b1ff46c6c7decbc14d1492be1964a8580af1
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdougt
bugs714708
milestone12.0a1
Bug 714708 - NullPointerException at GeckoInputConnection.notifyIME [r=dougt]
mobile/android/base/GeckoInputConnection.java
--- a/mobile/android/base/GeckoInputConnection.java
+++ b/mobile/android/base/GeckoInputConnection.java
@@ -575,45 +575,45 @@ public class GeckoInputConnection
 
         if (v == null)
             return;
 
         if (DEBUG) Log.d(LOGTAG, "notifyIME v!= null");
 
         switch (type) {
         case NOTIFY_IME_RESETINPUTSTATE:
+            if (DEBUG) Log.d(LOGTAG, "notifyIME = reset");
 
-        if (DEBUG) Log.d(LOGTAG, "notifyIME = reset");
             // Composition event is already fired from widget.
             // So reset IME flags.
             reset();
 
             // Don't use IMEStateUpdater for reset.
             // Because IME may not work showSoftInput()
             // after calling restartInput() immediately.
             // So we have to call showSoftInput() delay.
             InputMethodManager imm = (InputMethodManager) v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
-            if (imm != null) {
+            if (imm == null) {
                 // no way to reset IME status directly
                 IMEStateUpdater.resetIME();
             } else {
                 imm.restartInput(v);
             }
 
             // keep current enabled state
             IMEStateUpdater.enableIME();
             break;
 
         case NOTIFY_IME_CANCELCOMPOSITION:
-        if (DEBUG) Log.d(LOGTAG, "notifyIME = cancel");
+            if (DEBUG) Log.d(LOGTAG, "notifyIME = cancel");
             IMEStateUpdater.resetIME();
             break;
 
         case NOTIFY_IME_FOCUSCHANGE:
-        if (DEBUG) Log.d(LOGTAG, "notifyIME = focus");
+            if (DEBUG) Log.d(LOGTAG, "notifyIME = focus");
             IMEStateUpdater.resetIME();
             break;
         }
     }
 
     public void notifyIMEEnabled(int state, String typeHint,
                                         String actionHint, boolean landscapeFS)
     {