diff options
| author | Craig Mautner <cmautner@google.com> | 2013-03-15 18:59:51 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-03-15 18:59:51 +0000 |
| commit | 8dfe99ce20f2f7c08dd8d3cefcd18eb2d4fb10d8 (patch) | |
| tree | 83d9c880b4671e5968ad26b855fb0dd08e9d0ec2 /core/java/android/inputmethodservice/InputMethodService.java | |
| parent | faf0e89ce3bdb2c50eb5da671bc4fc2a618ebf89 (diff) | |
| parent | e4bbb1cc451c7ebdad9f92968732fc4f6c21a70c (diff) | |
Merge "Catch BadTokenException and continue." into jb-mr2-dev
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
| -rw-r--r-- | core/java/android/inputmethodservice/InputMethodService.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 288cefff55df..5a9cde170b70 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -39,7 +39,6 @@ import android.text.method.MovementMethod; import android.util.Log; import android.util.PrintWriterPrinter; import android.util.Printer; -import android.util.Slog; import android.view.KeyCharacterMap; import android.view.KeyEvent; import android.view.LayoutInflater; @@ -49,6 +48,7 @@ import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.view.Window; import android.view.WindowManager; +import android.view.WindowManager.BadTokenException; import android.view.animation.AnimationUtils; import android.view.inputmethod.CompletionInfo; import android.view.inputmethod.EditorInfo; @@ -352,7 +352,6 @@ public class InputMethodService extends AbstractInputMethodService { * Take care of attaching the given window token provided by the system. */ public void attachToken(IBinder token) { - Slog.i(TAG, "attachToken: Existing token=" + mToken + " new token=" + token); if (mToken == null) { mToken = token; mWindow.setToken(token); @@ -419,11 +418,16 @@ public class InputMethodService extends AbstractInputMethodService { * Handle a request by the system to show the soft input area. */ public void showSoftInput(int flags, ResultReceiver resultReceiver) { - if (true || DEBUG) Slog.v(TAG, "showSoftInput()"); + if (DEBUG) Log.v(TAG, "showSoftInput()"); boolean wasVis = isInputViewShown(); mShowInputFlags = 0; if (onShowInputRequested(flags, false)) { - showWindow(true); + try { + showWindow(true); + } catch (BadTokenException e) { + if (DEBUG) Log.v(TAG, "BadTokenException: IME is done."); + mWindowVisible = false; + } } // If user uses hard keyboard, IME button should always be shown. boolean showing = onEvaluateInputViewShown(); @@ -1390,7 +1394,7 @@ public class InputMethodService extends AbstractInputMethodService { } public void showWindow(boolean showInput) { - if (true || DEBUG) Slog.v(TAG, "Showing window: showInput=" + showInput + if (DEBUG) Log.v(TAG, "Showing window: showInput=" + showInput + " mShowInputRequested=" + mShowInputRequested + " mWindowAdded=" + mWindowAdded + " mWindowCreated=" + mWindowCreated |
