Fix last change -- don't call startInputInner() with lock held.

Change-Id: Ie7a145c5a07f08ae8a3f5954a1c389bfbd946b69
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index 4e85425..925e781 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -336,6 +336,7 @@
                 }
                 case MSG_UNBIND: {
                     final int sequence = msg.arg1;
+                    boolean startInput = false;
                     synchronized (mH) {
                         if (mBindSequence == sequence) {
                             if (false) {
@@ -356,10 +357,13 @@
                                 mServedConnecting = true;
                             }
                             if (mActive) {
-                                startInputInner();
+                                startInput = true;
                             }
                         }
                     }
+                    if (startInput) {
+                        startInputInner();
+                    }
                     return;
                 }
                 case MSG_SET_ACTIVE: {
@@ -1209,12 +1213,13 @@
                 mService.windowGainedFocus(mClient, rootView.getWindowToken(),
                         focusedView != null, isTextEditor, softInputMode, first,
                         windowFlags);
-                if (startInput) {
-                    startInputInner();
-                }
             } catch (RemoteException e) {
             }
         }
+
+        if (startInput) {
+            startInputInner();
+        }
     }
     
     /** @hide */