diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java index 7cd007bd0b8f2..b0923a13cf746 100644 --- a/services/core/java/com/android/server/InputMethodManagerService.java +++ b/services/core/java/com/android/server/InputMethodManagerService.java @@ -1706,6 +1706,13 @@ public class InputMethodManagerService extends IInputMethodManager.Stub if (cs != null) { clearClientSessionLocked(cs); if (mCurClient == cs) { + if (mBoundToMethod) { + mBoundToMethod = false; + if (mCurMethod != null) { + executeOrSendMessage(mCurMethod, mCaller.obtainMessageO( + MSG_UNBIND_INPUT, mCurMethod)); + } + } mCurClient = null; } if (mCurFocusedWindowClient == cs) {