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
This commit is contained in:
Wilson Wu
2021-03-29 16:05:03 +08:00
parent 0abe732778
commit 5b7058f4c3
2 changed files with 2 additions and 0 deletions

View File

@@ -576,6 +576,7 @@ public class NotificationRemoteInputManager implements Dumpable {
mKeysKeptForRemoteInputHistory.remove(key);
}
if (mRemoteInputController.isRemoteInputActive(entry)) {
entry.mRemoteEditImeVisible = false;
mRemoteInputController.removeRemoteInput(entry, null);
}
}

View File

@@ -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);
}