From 910fe6f8b0e7afc619886ae590ac4b9bc2dbfa60 Mon Sep 17 00:00:00 2001 From: Justin Weir Date: Tue, 20 Dec 2022 16:22:19 -0500 Subject: [PATCH] Make an ending IME animation clean up old inputs for the same entry This change fixes b/227115380 which is a fairly severe issue caused by remote inputs remaining added to RemoteInputController because their attempts to remove themselves on defocus/detach are all blocked by conditions like an in-progress animation. I checked all the bugs mentioned in the commit messages of the surrounding code, and the only one that regressed was already broken (b/264552438). Fixes: 227115380 Test: manual and atest Change-Id: Iba895abdbe087d85f00ab8823580baed90117fef --- .../com/android/systemui/statusbar/policy/RemoteInputView.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java index f8c17e8c83791..4866f73b8d9fb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java @@ -303,7 +303,8 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene mEntry.mRemoteEditImeVisible = editTextRootWindowInsets != null && editTextRootWindowInsets.isVisible(WindowInsets.Type.ime()); if (!mEntry.mRemoteEditImeVisible && !mEditText.mShowImeOnInputConnection) { - mController.removeRemoteInput(mEntry, mToken); + // Pass null to ensure all inputs are cleared for this entry b/227115380 + mController.removeRemoteInput(mEntry, null); } } }