From 0e766c11b021064ee17de5a29b1297b62dd6b520 Mon Sep 17 00:00:00 2001 From: Ming-Shin Lu Date: Tue, 7 Apr 2020 23:09:29 +0800 Subject: [PATCH] Fix IME insets animation applies again when restartInput called Since previously mShowRequested will never set as false once the first showSoftInput calls, unless hideSoftInput be called, As new insets feature enabled, showSoftInput will always apply insets animation, that will have a problem that when the app calls restartInput to re-create input method session, showCurrentInputLocked will be called and IME insets animation will be applied again. Set mShowRequested as false when showSoftInput has done. Fix: 153026470 Test: atest CtsInputMethodTestCases Change-Id: Ia1ceb8e0e939376eb1d387c864aecd88504f3126 --- .../android/server/inputmethod/InputMethodManagerService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index e6cb37185d71d..846d09915fba1 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -3106,10 +3106,14 @@ public class InputMethodManagerService extends IInputMethodManager.Stub MSG_SHOW_SOFT_INPUT, getImeShowFlags(), reason, mCurMethod, resultReceiver, showInputToken)); mInputShown = true; + if (mHaveConnection && !mVisibleBound) { bindCurrentInputMethodServiceLocked( mCurIntent, mVisibleConnection, IME_VISIBLE_BIND_FLAGS); mVisibleBound = true; + } else { + // Clear the show request after the input shown. + mShowRequested = false; } res = true; } else if (mHaveConnection && SystemClock.uptimeMillis()