summaryrefslogtreecommitdiff
path: root/services/autofill
diff options
context:
space:
mode:
authorFeng Cao <fengcao@google.com>2020-06-01 00:31:12 -0700
committerFeng Cao <fengcao@google.com>2020-06-01 00:37:59 -0700
commitfaee762b1c66d5f5f5c2be962e1f55a8e4943755 (patch)
treeb12abd3c88cd81d52691ba792f6cc23b78b72a11 /services/autofill
parent829ac140f8f5914d5cff3ab36a1b86eb59ead2c6 (diff)
Make autofill manager service to not clear inline suggestions when IME input finishes
* This, together with the change on the sample IME, gets rid of the flicker on the notification pull down/up case, as well as switch from username to password. * This doesn't fix the flicker when coming back from the attribution dialog, yet. As in that case the framework sends an empty suggsetion upon dismissing the dialog. Will explore fix for that in a separate patch. Test: atest android.autofillservice.cts.inline Bug: 157515522 Change-Id: Ia6d5d2b517cf400980fb602094c1abafb7100786
Diffstat (limited to 'services/autofill')
-rw-r--r--services/autofill/java/com/android/server/autofill/AutofillInlineSuggestionsRequestSession.java14
1 files changed, 2 insertions, 12 deletions
diff --git a/services/autofill/java/com/android/server/autofill/AutofillInlineSuggestionsRequestSession.java b/services/autofill/java/com/android/server/autofill/AutofillInlineSuggestionsRequestSession.java
index 687b75a8b949..e7a43b75f9d5 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillInlineSuggestionsRequestSession.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillInlineSuggestionsRequestSession.java
@@ -40,7 +40,6 @@ import com.android.server.autofill.ui.InlineFillUi;
import com.android.server.inputmethod.InputMethodManagerInternal;
import java.lang.ref.WeakReference;
-import java.util.Collections;
import java.util.Optional;
import java.util.function.Consumer;
@@ -209,18 +208,9 @@ final class AutofillInlineSuggestionsRequestSession {
if (mDestroyed || mResponseCallback == null) {
return;
}
- if (!mImeInputStarted && mPreviousResponseIsNotEmpty) {
- // 1. if previous response is not empty, and IME is just disconnected from the view,
- // then send empty response to make sure existing responses don't stick around.
- // Although the inline suggestions should disappear when IME hides which removes them
- // from the view hierarchy, but we still send an empty response to indicate that the
- // previous suggestions are invalid now.
- if (sVerbose) Slog.v(TAG, "Send empty inline response");
- updateResponseToImeUncheckLocked(new InlineSuggestionsResponse(Collections.EMPTY_LIST));
- mPreviousResponseIsNotEmpty = false;
- } else if (mImeInputViewStarted && mInlineFillUi != null && match(mAutofillId,
+ if (mImeInputViewStarted && mInlineFillUi != null && match(mAutofillId,
mImeCurrentFieldId)) {
- // 2. if IME is visible, and response is not null, send the response
+ // if IME is visible, and response is not null, send the response
InlineSuggestionsResponse response = mInlineFillUi.getInlineSuggestionsResponse();
boolean isEmptyResponse = response.getInlineSuggestions().isEmpty();
if (isEmptyResponse && !mPreviousResponseIsNotEmpty) {