From 560bcb34fad8bfe642d9ab6f38d973185d253af5 Mon Sep 17 00:00:00 2001 From: satok Date: Fri, 3 Jun 2011 01:05:45 +0900 Subject: Update internal states stored in InputMethodManager properly Bug: 4517456 "startInputInner" in InputMethodManager.java will call "startInput" in InputMethodManagerService.java In startInputLocked in IMMS, mCurSeq (Bind sequence) is incremented, but if mCurMethod stored in InputMethodManager.java is not null, mBindSequence in InputMethodManager.java will not be updated to the incremented sequence. Hence, after this procedure, unbinding IME will be cancelled by the mismatch of the bind sequence. This situation happens when user changes the focused text view. If I remember correctly, some behaviors of showing or hiding IME at switching text view were changed. And I think this bug appeared because of that change. Change-Id: Icec380f3ca05cf798cc4b82155d0cecf178633a5 --- core/java/android/view/inputmethod/InputMethodManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index ea66d6761c52..4df237b60783 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -1024,13 +1024,13 @@ public final class InputMethodManager { if (DEBUG) Log.v(TAG, "START INPUT: " + view + " ic=" + ic + " tba=" + tba + " initial=" + initial); InputBindResult res = mService.startInput(mClient, - servedContext, tba, initial, mCurMethod == null); + servedContext, tba, initial, true); if (DEBUG) Log.v(TAG, "Starting input: Bind result=" + res); if (res != null) { if (res.id != null) { mBindSequence = res.sequence; mCurMethod = res.method; - } else { + } else if (mCurMethod == null) { // This means there is no input method available. if (DEBUG) Log.v(TAG, "ABORT input: no input method!"); return; -- cgit v1.2.3-59-g8ed1b