When starting new session, make autofill manager service to not clear inline suggestions

* This is to handle the case where when coming back from the
  attribution dialog, the augmented autofill is retriggered which
  cause the old inline session with the IME to be destroyed and a
  new one created, in which case we used to send an empty response
  to IME to clear the suggestions. But this would cause flicker in
  the IME side, between the time when it's cleared and the new
  suggestions arrive.
* It's safe to remove this becasue we now rely on the onStartInput
  (or onFinishInput)  in the IME side to clear the suggestions
  anyways.

Test: atest android.autofillservice.cts.inline
Bug: 157515522

Change-Id: Ie7cb8b164b7f5352632ee509ea978a2d421f5e5b
This commit is contained in:
Feng Cao
2020-06-02 14:26:02 -07:00
parent faee762b1c
commit 5c2f11d4ae

View File

@@ -75,9 +75,7 @@ final class AutofillInlineSessionController {
@NonNull Consumer<InlineSuggestionsRequest> requestConsumer, @NonNull Bundle uiExtras) {
// TODO(b/151123764): rename the method to better reflect what it does.
if (mSession != null) {
// Send an empty response to IME and destroy the existing session.
mSession.onInlineSuggestionsResponseLocked(
InlineFillUi.emptyUi(mSession.getAutofillIdLocked()));
// Destroy the existing session.
mSession.destroySessionLocked();
mInlineFillUi = null;
}