summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/InputMethodManagerService.java
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2013-03-15 19:04:20 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2013-03-15 19:04:20 +0000
commitd99b26285d840cb7d7a1f9976eb00f7f1d7c38e9 (patch)
tree2488884345a51bea50e5a93bfdb382dc6dd84114 /services/java/com/android/server/InputMethodManagerService.java
parent36b314587f187d631a471650dc37e04f38cb3e53 (diff)
parent20a402e0dc8d3052ac317e6c13afee22a9502c35 (diff)
downloadframeworks_base-d99b26285d840cb7d7a1f9976eb00f7f1d7c38e9.zip
frameworks_base-d99b26285d840cb7d7a1f9976eb00f7f1d7c38e9.tar.gz
frameworks_base-d99b26285d840cb7d7a1f9976eb00f7f1d7c38e9.tar.bz2
am 20a402e0: am 8dfe99ce: Merge "Catch BadTokenException and continue." into jb-mr2-dev
* commit '20a402e0dc8d3052ac317e6c13afee22a9502c35': Catch BadTokenException and continue.
Diffstat (limited to 'services/java/com/android/server/InputMethodManagerService.java')
-rw-r--r--services/java/com/android/server/InputMethodManagerService.java30
1 files changed, 8 insertions, 22 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index f037ea5..15121e2 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -1242,24 +1242,13 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
public void onServiceConnected(ComponentName name, IBinder service) {
synchronized (mMethodMap) {
if (mCurIntent != null && name.equals(mCurIntent.getComponent())) {
- IInputMethod prevMethod = mCurMethod;
mCurMethod = IInputMethod.Stub.asInterface(service);
if (mCurToken == null) {
Slog.w(TAG, "Service connected without a token!");
unbindCurrentMethodLocked(false, false);
return;
}
- // Remove messages relating to the previous service. Otherwise WindowManagerService
- // will throw a BadTokenException because the old token is being removed.
- if (prevMethod != null) {
- try {
- prevMethod.removeSoftInputMessages();
- } catch (RemoteException e) {
- }
- }
- mCaller.removeMessages(MSG_SHOW_SOFT_INPUT);
- mCaller.removeMessages(MSG_HIDE_SOFT_INPUT);
- if (true || DEBUG) Slog.v(TAG, "Initiating attach with token: " + mCurToken);
+ if (DEBUG) Slog.v(TAG, "Initiating attach with token: " + mCurToken);
executeOrSendMessage(mCurMethod, mCaller.obtainMessageOO(
MSG_ATTACH_TOKEN, mCurMethod, mCurToken));
if (mCurClient != null) {
@@ -1705,7 +1694,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
}
}
- if (true || DEBUG) Slog.v(TAG, "Client requesting input be shown");
+ if (DEBUG) Slog.v(TAG, "Client requesting input be shown");
return showCurrentInputLocked(flags, resultReceiver);
}
} finally {
@@ -1729,8 +1718,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
boolean res = false;
if (mCurMethod != null) {
- if (true ||DEBUG) Slog.d(TAG, "showCurrentInputLocked: mCurToken=" + mCurToken,
- new RuntimeException("here").fillInStackTrace());
+ if (DEBUG) Slog.d(TAG, "showCurrentInputLocked: mCurToken=" + mCurToken);
executeOrSendMessage(mCurMethod, mCaller.obtainMessageIOO(
MSG_SHOW_SOFT_INPUT, getImeShowFlags(), mCurMethod,
resultReceiver));
@@ -1802,13 +1790,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
boolean hideCurrentInputLocked(int flags, ResultReceiver resultReceiver) {
if ((flags&InputMethodManager.HIDE_IMPLICIT_ONLY) != 0
&& (mShowExplicitlyRequested || mShowForced)) {
- if (true ||DEBUG) Slog.v(TAG,
- "Not hiding: explicit show not cancelled by non-explicit hide");
+ if (DEBUG) Slog.v(TAG, "Not hiding: explicit show not cancelled by non-explicit hide");
return false;
}
if (mShowForced && (flags&InputMethodManager.HIDE_NOT_ALWAYS) != 0) {
- if (true ||DEBUG) Slog.v(TAG,
- "Not hiding: forced show not cancelled by not-always hide");
+ if (DEBUG) Slog.v(TAG, "Not hiding: forced show not cancelled by not-always hide");
return false;
}
boolean res;
@@ -2319,7 +2305,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
case MSG_SHOW_SOFT_INPUT:
args = (SomeArgs)msg.obj;
try {
- if (true || DEBUG) Slog.v(TAG, "Calling " + args.arg1 + ".showSoftInput("
+ if (DEBUG) Slog.v(TAG, "Calling " + args.arg1 + ".showSoftInput("
+ msg.arg1 + ", " + args.arg2 + ")");
((IInputMethod)args.arg1).showSoftInput(msg.arg1, (ResultReceiver)args.arg2);
} catch (RemoteException e) {
@@ -2329,7 +2315,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
case MSG_HIDE_SOFT_INPUT:
args = (SomeArgs)msg.obj;
try {
- if (true || DEBUG) Slog.v(TAG, "Calling " + args.arg1 + ".hideSoftInput(0, "
+ if (DEBUG) Slog.v(TAG, "Calling " + args.arg1 + ".hideSoftInput(0, "
+ args.arg2 + ")");
((IInputMethod)args.arg1).hideSoftInput(0, (ResultReceiver)args.arg2);
} catch (RemoteException e) {
@@ -2339,7 +2325,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
case MSG_ATTACH_TOKEN:
args = (SomeArgs)msg.obj;
try {
- if (true || DEBUG) Slog.v(TAG, "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) {
}