summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/InputMethodManagerService.java
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2013-03-11 12:28:07 -0700
committerCraig Mautner <cmautner@google.com>2013-03-12 11:25:54 -0700
commitb11b1f267996a77782dd49baaefd281b1fc181c3 (patch)
tree87d6140134bf8c17e5e6c18aa88cb36f3711f2f8 /services/java/com/android/server/InputMethodManagerService.java
parentbbc30a032d74c4d4ced35183820c44a3e2a9647a (diff)
downloadframeworks_base-b11b1f267996a77782dd49baaefd281b1fc181c3.zip
frameworks_base-b11b1f267996a77782dd49baaefd281b1fc181c3.tar.gz
frameworks_base-b11b1f267996a77782dd49baaefd281b1fc181c3.tar.bz2
Remove old show/hide messages on new ime
The previous show/hide messages in the queue were still trying to be honored even after a new ime was attached. Fixes bug 8263462. Change-Id: Ie85369346cd3f843389a8e7837f5d97b56885309
Diffstat (limited to 'services/java/com/android/server/InputMethodManagerService.java')
-rw-r--r--services/java/com/android/server/InputMethodManagerService.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index a835dc3..1e921e1 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -1204,7 +1204,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
mCurId = info.getId();
mCurToken = new Binder();
try {
- if (true || DEBUG) Slog.v(TAG, "b8263462 Adding window token: " + mCurToken);
+ if (DEBUG) Slog.v(TAG, "Adding window token: " + mCurToken);
mIWindowManager.addWindowToken(mCurToken,
WindowManager.LayoutParams.TYPE_INPUT_METHOD);
} catch (RemoteException e) {
@@ -1248,7 +1248,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
unbindCurrentMethodLocked(false, false);
return;
}
- if (true || DEBUG) Slog.v(TAG, "b8263462 Initiating attach with token: " + mCurToken);
+ // Remove commands relating to the previous service. Otherwise WindowManagerService
+ // will reject the command because the token attached to these messages is invalid.
+ mCaller.removeMessages(MSG_SHOW_SOFT_INPUT);
+ mCaller.removeMessages(MSG_HIDE_SOFT_INPUT);
+ if (DEBUG) Slog.v(TAG, "Initiating attach with token: " + mCurToken);
executeOrSendMessage(mCurMethod, mCaller.obtainMessageOO(
MSG_ATTACH_TOKEN, mCurMethod, mCurToken));
if (mCurClient != null) {
@@ -2324,7 +2328,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
case MSG_ATTACH_TOKEN:
args = (SomeArgs)msg.obj;
try {
- if (true || DEBUG) Slog.v(TAG, "b8263462 Sending attach of token: " + args.arg2);
+ if (DEBUG) Slog.v(TAG, "Sending attach of token: " + args.arg2);
((IInputMethod)args.arg1).attachToken((IBinder)args.arg2);
} catch (RemoteException e) {
}