diff options
| author | 2021-07-14 14:01:38 -0400 | |
|---|---|---|
| committer | 2021-07-15 10:14:59 -0400 | |
| commit | b13ce85b5b6104e552021d73301b6ecf5b4faa37 (patch) | |
| tree | 3776ef4df17aa2fa90e66c0765a617696db14095 | |
| parent | bb8ed302c8f079742681fbc905e3ade617d2e8f8 (diff) | |
Hide the keyboard when remote input hides.
This fixes a regression introduced by ag/13410424, while preserving the delay introduced by that change.
Bug: 193556445
Test: manual fuzz testing the remote input / keyboard
Change-Id: I4e4cdac0886d21aff63638f05d97b765c36f7ba6
3 files changed, 4 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java b/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java index b6aed23e64ee..180f81c22a9d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java @@ -131,7 +131,7 @@ public class RemoteInputController { */ public void removeRemoteInput(NotificationEntry entry, Object token) { Objects.requireNonNull(entry); - if (entry.mRemoteEditImeVisible) return; + if (entry.mRemoteEditImeVisible && entry.mRemoteEditImeAnimatingAway) return; // If the view is being removed, this may be called even though we're not active if (!isRemoteInputActive(entry)) return; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java index 96b0e7819c7a..94ee868ceebc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java @@ -183,6 +183,7 @@ public final class NotificationEntry extends ListEntry { private boolean mIsMarkedForUserTriggeredMovement; private boolean mIsAlerting; + public boolean mRemoteEditImeAnimatingAway; public boolean mRemoteEditImeVisible; private boolean mExpandAnimationRunning; 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 b18dfd2866c4..1a85ea1daa17 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java @@ -272,6 +272,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene public void onEnd(@NonNull WindowInsetsAnimation animation) { super.onEnd(animation); if (animation.getTypeMask() == WindowInsets.Type.ime()) { + mEntry.mRemoteEditImeAnimatingAway = false; mEntry.mRemoteEditImeVisible = mEditText.getRootWindowInsets().isVisible(WindowInsets.Type.ime()); if (!mEntry.mRemoteEditImeVisible && !mEditText.mShowImeOnInputConnection) { @@ -392,6 +393,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene mSendButton.setVisibility(INVISIBLE); mProgressBar.setVisibility(VISIBLE); mEntry.lastRemoteInputSent = SystemClock.elapsedRealtime(); + mEntry.mRemoteEditImeAnimatingAway = true; mController.addSpinning(mEntry.getKey(), mToken); mController.removeRemoteInput(mEntry, mToken); mEditText.mShowImeOnInputConnection = false; |