diff options
author | Feng Cao <fengcao@google.com> | 2020-06-12 15:47:49 -0700 |
---|---|---|
committer | Feng Cao <fengcao@google.com> | 2020-06-16 15:10:47 -0700 |
commit | 91dae475de3d00bf6b364e2ce87829f0cb5f0a3f (patch) | |
tree | 875eb52c8aeb2f9a358fc95e9e5a753f111014da /services/autofill/java | |
parent | f3e7dfe156660afda023be4d4d49bb8ec75a3efe (diff) |
Fix a bug where we didn't call IME before calling augmented autofill
* For inline autofill, we always need to get an IME callback before
calling the augmented autofill service. This is because although
autofill keeps a list of undestroyed sessions, the IME side
always discards the old callback for autofill when a new one
is created. So in case of switching back to an existing autofill
session, we need to make sure we ask the IME to return a new
callback.
* we current have the check which missed a case where we are
re-entering an existing autofill session, but the standard
autofill was returning null the previous time,
so it goes to trigger augmented autofill directly. In this case,
we need to call IME onCreateInlineSuggestionsRequest to get a
callback before calling the augmented autofill. We didn't, and
this patch fixes it.
Test: atest android.autofillservice.cts.inline
Test: manual
Bug: 158877106
Change-Id: Ie15cf0763ae49a204ad09c2eaac798890388622e
Diffstat (limited to 'services/autofill/java')
-rw-r--r-- | services/autofill/java/com/android/server/autofill/Session.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java index a9a0ab69f633..995fd266fb3b 100644 --- a/services/autofill/java/com/android/server/autofill/Session.java +++ b/services/autofill/java/com/android/server/autofill/Session.java @@ -3208,16 +3208,19 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState }; // When the inline suggestion render service is available and the view is focused, there - // are 2 cases when augmented autofill should ask IME for inline suggestion request, + // are 3 cases when augmented autofill should ask IME for inline suggestion request, // because standard autofill flow didn't: // 1. the field is augmented autofill only (when standard autofill provider is None or // when it returns null response) // 2. standard autofill provider doesn't support inline suggestion + // 3. we re-entered the autofill session and standard autofill was not re-triggered, this is + // recognized by seeing mExpiredResponse == true final RemoteInlineSuggestionRenderService remoteRenderService = mService.getRemoteInlineSuggestionRenderServiceLocked(); if (remoteRenderService != null && (mForAugmentedAutofillOnly - || !isInlineSuggestionsEnabledByAutofillProviderLocked()) + || !isInlineSuggestionsEnabledByAutofillProviderLocked() + || mExpiredResponse) && isViewFocusedLocked(flags)) { if (sDebug) Slog.d(TAG, "Create inline request for augmented autofill"); remoteRenderService.getInlineSuggestionsRendererInfo(new RemoteCallback( |