Merge "Fix a bug where we didn't call IME before calling augmented autofill" into rvc-dev am: 4add155920 am: cbbf9fea6b am: 80978cd88c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11840045

Change-Id: Ie8d11a9147667a27d73e4fbeda68f6e979ecd533
This commit is contained in:
Feng Cao
2020-06-17 17:43:01 +00:00
committed by Automerger Merge Worker

View File

@@ -3279,16 +3279,19 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
}; };
// When the inline suggestion render service is available and the view is focused, there // 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: // because standard autofill flow didn't:
// 1. the field is augmented autofill only (when standard autofill provider is None or // 1. the field is augmented autofill only (when standard autofill provider is None or
// when it returns null response) // when it returns null response)
// 2. standard autofill provider doesn't support inline suggestion // 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 = final RemoteInlineSuggestionRenderService remoteRenderService =
mService.getRemoteInlineSuggestionRenderServiceLocked(); mService.getRemoteInlineSuggestionRenderServiceLocked();
if (remoteRenderService != null if (remoteRenderService != null
&& (mForAugmentedAutofillOnly && (mForAugmentedAutofillOnly
|| !isInlineSuggestionsEnabledByAutofillProviderLocked()) || !isInlineSuggestionsEnabledByAutofillProviderLocked()
|| mExpiredResponse)
&& isViewFocusedLocked(flags)) { && isViewFocusedLocked(flags)) {
if (sDebug) Slog.d(TAG, "Create inline request for augmented autofill"); if (sDebug) Slog.d(TAG, "Create inline request for augmented autofill");
remoteRenderService.getInlineSuggestionsRendererInfo(new RemoteCallback( remoteRenderService.getInlineSuggestionsRendererInfo(new RemoteCallback(