From 5b7058f4c3265aff782e80ee147d29c01d536acf Mon Sep 17 00:00:00 2001 From: Wilson Wu Date: Mon, 29 Mar 2021 16:05:03 +0800 Subject: [PATCH] Fix keyboard remain after dismissing notification We introduced mRemoteEditImeVisible checking in RemoteInputController#removeRemoteInput by CL[1] to resolve a IME layer issue. Update this flag when remove notification to remove the active remote input. [1]: I7dbc8e656505f79b1bfb198c458d3b95a645c1cb Fix: 183678882 Test: Manual test with bug flow 1) Receive a chat notification 2) Tap direct reply to show the keyboard 3) Swipe to dismiss notification 4) Verify the keyboard will be dismiss as expected Test: atest NotificationRemoteInputManagerTest Change-Id: I7c1af7f0f26906361aa29425fb77e94e5ed4cd12 --- .../systemui/statusbar/NotificationRemoteInputManager.java | 1 + .../systemui/statusbar/NotificationRemoteInputManagerTest.java | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java index 2856ebb4066d8..23e6a9f5d1912 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java @@ -576,6 +576,7 @@ public class NotificationRemoteInputManager implements Dumpable { mKeysKeptForRemoteInputHistory.remove(key); } if (mRemoteInputController.isRemoteInputActive(entry)) { + entry.mRemoteEditImeVisible = false; mRemoteInputController.removeRemoteInput(entry, null); } } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java index eaef43d133af2..35c92b6e49414 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java @@ -108,6 +108,7 @@ public class NotificationRemoteInputManagerTest extends SysuiTestCase { when(mController.isRemoteInputActive(mEntry)).thenReturn(true); mRemoteInputManager.onPerformRemoveNotification(mEntry, mEntry.getKey()); + assertFalse(mEntry.mRemoteEditImeVisible); verify(mController).removeRemoteInput(mEntry, null); }