summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2012-10-02 19:00:26 +0900
committerSatoshi Kataoka <satok@google.com>2012-10-03 12:07:23 +0900
commit3573950e0b30178dc963de3fa00aba2ebcfd552d (patch)
treeb3b03c8c35ea6537a031adad778ff02256105461
parentd27f1cd30b140f042e11032e4aa4381756e2998f (diff)
downloadframeworks_base-3573950e0b30178dc963de3fa00aba2ebcfd552d.zip
frameworks_base-3573950e0b30178dc963de3fa00aba2ebcfd552d.tar.gz
frameworks_base-3573950e0b30178dc963de3fa00aba2ebcfd552d.tar.bz2
Close the current input method when attached view doesn't have a handler
Bug: 7187452 Change-Id: Iba4f7ac89f5806e871aaeb97f366935b83b95a5a
-rw-r--r--core/java/android/view/inputmethod/InputMethodManager.java7
-rw-r--r--services/java/com/android/server/InputMethodManagerService.java2
2 files changed, 6 insertions, 3 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index 3ea6df3..4a3f846 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -1078,8 +1078,11 @@ public final class InputMethodManager {
Handler vh = view.getHandler();
if (vh == null) {
// If the view doesn't have a handler, something has changed out
- // from under us, so just bail.
- if (DEBUG) Log.v(TAG, "ABORT input: no handler for view!");
+ // from under us, so just close the current input.
+ // If we don't close the current input, the current input method can remain on the
+ // screen without a connection.
+ if (DEBUG) Log.v(TAG, "ABORT input: no handler for view! Close current input.");
+ closeCurrentInput();
return false;
}
if (vh.getLooper() != Looper.myLooper()) {
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index f06bf8e..22fd508 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -1843,7 +1843,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
if (mCurFocusedWindow == windowToken) {
Slog.w(TAG, "Window already focused, ignoring focus gain of: " + client
- + " attribute=" + attribute);
+ + " attribute=" + attribute + ", token = " + windowToken);
if (attribute != null) {
return startInputUncheckedLocked(cs, inputContext, attribute,
controlFlags);