Merge "Save input method subtype even if the current IME is not running." into honeycomb
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index a2684fb..5b56082 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -427,6 +427,7 @@
                             // Uh oh, current input method is no longer around!
                             // Pick another one...
                             Slog.i(TAG, "Current input method removed: " + curInputMethodId);
+                            mStatusBar.setIMEButtonVisible(mCurToken, false);
                             if (!chooseNewDefaultIMELocked()) {
                                 changed = true;
                                 curIm = null;
@@ -1020,9 +1021,11 @@
             }
             if (subtype != mCurrentSubtype) {
                 synchronized (mMethodMap) {
+                    if (subtype != null) {
+                        setSelectedInputMethodAndSubtypeLocked(info, subtypeId, true);
+                    }
                     if (mCurMethod != null) {
                         try {
-                            setSelectedInputMethodAndSubtypeLocked(info, subtypeId, true);
                             if (mInputShown) {
                                 // If mInputShown is false, there is no IME button on the
                                 // system bar.