summaryrefslogtreecommitdiff
path: root/services/autofill/java
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-06-10 21:56:03 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-06-10 21:56:03 +0000
commitb9aeb6ca22dc8b3520bc3c31d34e2b78e9eed139 (patch)
treef3b19b137cf3fece6a317d05ac7894c8fe9a25ab /services/autofill/java
parent3ef506d5468d855c9936bdc718b0393ceb892140 (diff)
parent1e0e1238e0c25ceb797fc05040e37393843d2a79 (diff)
Merge "Send empty inline response to IME if augmented autofill returns no suggestion" into rvc-dev
Diffstat (limited to 'services/autofill/java')
-rw-r--r--services/autofill/java/com/android/server/autofill/AutofillInlineSuggestionsRequestSession.java4
-rw-r--r--services/autofill/java/com/android/server/autofill/RemoteAugmentedAutofillService.java5
2 files changed, 7 insertions, 2 deletions
diff --git a/services/autofill/java/com/android/server/autofill/AutofillInlineSuggestionsRequestSession.java b/services/autofill/java/com/android/server/autofill/AutofillInlineSuggestionsRequestSession.java
index e7a43b75f9d5..48895ad42e99 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillInlineSuggestionsRequestSession.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillInlineSuggestionsRequestSession.java
@@ -93,7 +93,7 @@ final class AutofillInlineSuggestionsRequestSession {
@Nullable
private InlineFillUi mInlineFillUi;
@GuardedBy("mLock")
- private boolean mPreviousResponseIsNotEmpty;
+ private Boolean mPreviousResponseIsNotEmpty = null;
@GuardedBy("mLock")
private boolean mDestroyed = false;
@@ -213,7 +213,7 @@ final class AutofillInlineSuggestionsRequestSession {
// if IME is visible, and response is not null, send the response
InlineSuggestionsResponse response = mInlineFillUi.getInlineSuggestionsResponse();
boolean isEmptyResponse = response.getInlineSuggestions().isEmpty();
- if (isEmptyResponse && !mPreviousResponseIsNotEmpty) {
+ if (isEmptyResponse && Boolean.FALSE.equals(mPreviousResponseIsNotEmpty)) {
// No-op if both the previous response and current response are empty.
return;
}
diff --git a/services/autofill/java/com/android/server/autofill/RemoteAugmentedAutofillService.java b/services/autofill/java/com/android/server/autofill/RemoteAugmentedAutofillService.java
index 851e4cc0bfd1..a7d0061cc043 100644
--- a/services/autofill/java/com/android/server/autofill/RemoteAugmentedAutofillService.java
+++ b/services/autofill/java/com/android/server/autofill/RemoteAugmentedAutofillService.java
@@ -245,6 +245,11 @@ final class RemoteAugmentedAutofillService
if (inlineSuggestionsData == null || inlineSuggestionsData.isEmpty()
|| inlineSuggestionsCallback == null || request == null
|| remoteRenderService == null) {
+ // If it was an inline request and the response doesn't have any inline suggestions,
+ // we will send an empty response to IME.
+ if (inlineSuggestionsCallback != null && request != null) {
+ inlineSuggestionsCallback.apply(InlineFillUi.emptyUi(focusedId));
+ }
return;
}
mCallbacks.setLastResponse(sessionId);