diff options
| author | Yohei Yukawa <yukawa@google.com> | 2016-05-16 15:22:20 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-05-16 15:22:21 +0000 |
| commit | cef3337cb5e27d4f571fb350be055c26d339833d (patch) | |
| tree | 2b881885e3e2d6396df3f928c8910272bc5c8500 /core/java/android/inputmethodservice/InputMethodService.java | |
| parent | a1e4cbe2116bef9fad7c98836926317bde95d33e (diff) | |
| parent | 833bdcedceee60a873694a77587393abfc830eb5 (diff) | |
Merge "Make IMS#clearInsetOfPreviousIme() reliable." into nyc-dev
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
| -rw-r--r-- | core/java/android/inputmethodservice/InputMethodService.java | 15 |
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; } |
