diff options
| author | 2023-12-14 14:02:07 +0000 | |
|---|---|---|
| committer | 2023-12-19 18:51:44 +0000 | |
| commit | 14d75607fc9e268234ab9291c3e04a8b51f66432 (patch) | |
| tree | 13dc36010524930ba07f2ab5cfd0d6878da6659d | |
| parent | 55a2964681119f6594aa8036c3c7db25a2a6a86b (diff) | |
Remove RemoteInput onWindowDetach
ag/20794576 caused regressions related to Notification's Keyboard usages in Heads Up b/295134107 and b/303437237.
RemoteInputView with ag/20794576 removes all remote input instances on keyboard close and notifications can't capture the keyboard focus again.
This CL basically reverts ag/20794576 and solves b/227115380 by removing specific remote input on Window Detach. As RemoteInputView is detached from window, we don't need its RemoteInput entry in RemoteInput Controller.
Flag: NONE
Fixes: 295134107
Fixes: 303437237
Fixes: 227115380
Test: 295134107-> Receive HUN Notification with Reply. Press Inline Reply to launch IME. Close IME via click down arrow left corner. Press inline Reply Again. Observe IME is launched.
Test: 303437237 -> Receive HUN Notification with Reply. Press Inline Reply to launch IME. Pull down the shade. Observe IME is not closed and focus is protected.
Test: 227115380 -> Receive HUN Notification without style that removes RemoteInput actions after inline reply. Click Inline Reply and Reply notification. Observe footer menu is visible.
Change-Id: Iafe1c0306499a662823912a4bda125954e05643a
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java | 8 |
1 files changed, 6 insertions, 2 deletions
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 4864fb8ca634..5bced934be7a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java @@ -303,8 +303,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene mEntry.mRemoteEditImeVisible = editTextRootWindowInsets != null && editTextRootWindowInsets.isVisible(WindowInsets.Type.ime()); if (!mEntry.mRemoteEditImeVisible && !mEditText.mShowImeOnInputConnection) { - // Pass null to ensure all inputs are cleared for this entry b/227115380 - mController.removeRemoteInput(mEntry, null, + mController.removeRemoteInput(mEntry, mToken, /* reason= */"RemoteInputView$WindowInsetAnimation#onEnd"); } } @@ -536,6 +535,11 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene if (mEntry.getRow().isChangingPosition() || isTemporarilyDetached()) { return; } + // RemoteInputView can be detached from window before IME close event in some cases like + // remote input view removal with notification update. As a result of this, RemoteInputView + // will stop ime animation updates, which results in never removing remote input. That's why + // we have to set mRemoteEditImeAnimatingAway false on detach to remove remote input. + mEntry.mRemoteEditImeAnimatingAway = false; mController.removeRemoteInput(mEntry, mToken, /* reason= */"RemoteInputView#onDetachedFromWindow"); mController.removeSpinning(mEntry.getKey(), mToken); |