summaryrefslogtreecommitdiff
path: root/core/java/android/inputmethodservice/InputMethodService.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
-rw-r--r--core/java/android/inputmethodservice/InputMethodService.java15
1 files changed, 3 insertions, 12 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index 923be5e06582..4799773d9ed6 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -1714,18 +1714,9 @@ public class InputMethodService extends AbstractInputMethodService {
private void clearInsetOfPreviousIme() {
if (DEBUG) Log.v(TAG, "clearInsetOfPreviousIme() "
+ " mShouldClearInsetOfPreviousIme=" + mShouldClearInsetOfPreviousIme);
- if (!mShouldClearInsetOfPreviousIme || mWindow == null) return;
- try {
- // We do not call onWindowShown() and onWindowHidden() so as not to make the IME author
- // confused.
- // TODO: Find out a better way which has less side-effect.
- mWindow.show();
- mWindow.hide();
- } catch (WindowManager.BadTokenException e) {
- if (DEBUG) Log.v(TAG, "clearInsetOfPreviousIme: BadTokenException: IME is done.");
- mWindowVisible = false;
- mWindowAdded = false;
- }
+ if (!mShouldClearInsetOfPreviousIme) return;
+
+ mImm.clearLastInputMethodWindowForTransition(mToken);
mShouldClearInsetOfPreviousIme = false;
}