Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dcfbb618 authored by Seigo Nonaka's avatar Seigo Nonaka Committed by Android (Google) Code Review
Browse files

Merge "Catch BadTokenException and continue in clearInsetofPreviousIme." into mnc-dev

parents dc540ea0 e937216c
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -1565,11 +1565,17 @@ public class InputMethodService extends AbstractInputMethodService {
        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;
        }
        mShouldClearInsetOfPreviousIme = false;
    }