From 8893d30bd5764c9878a8fa5affc71f7dced75585 Mon Sep 17 00:00:00 2001 From: Ahaan Ugale Date: Tue, 24 Mar 2020 19:27:26 -0700 Subject: [PATCH] Don't filter pinned inline suggestions. Test: manual Test: atest android.autofillservice.cts.inline Bug: 152350380 Change-Id: I98b2e18bef4f9b291fe93e8b8d9aa1331630a7d8 --- core/java/android/service/autofill/InlinePresentation.java | 3 ++- .../android/server/autofill/ui/InlineSuggestionFactory.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/java/android/service/autofill/InlinePresentation.java b/core/java/android/service/autofill/InlinePresentation.java index a9addba375af0..b6a8ced29f729 100644 --- a/core/java/android/service/autofill/InlinePresentation.java +++ b/core/java/android/service/autofill/InlinePresentation.java @@ -49,7 +49,8 @@ public final class InlinePresentation implements Parcelable { private final @NonNull InlinePresentationSpec mInlinePresentationSpec; /** - * Indicates whether the UI should be pinned, hence non-scrollable, in the host. + * Indicates whether the UI should be pinned, hence non-scrollable and non-filterable, in the + * host. */ private final boolean mPinned; diff --git a/services/autofill/java/com/android/server/autofill/ui/InlineSuggestionFactory.java b/services/autofill/java/com/android/server/autofill/ui/InlineSuggestionFactory.java index c39e93a84b487..2306329e689cc 100644 --- a/services/autofill/java/com/android/server/autofill/ui/InlineSuggestionFactory.java +++ b/services/autofill/java/com/android/server/autofill/ui/InlineSuggestionFactory.java @@ -165,7 +165,8 @@ public final class InlineSuggestionFactory { Slog.w(TAG, "InlinePresentation not found in dataset"); continue; } - if (!includeDataset(dataset, fieldIndex, filterText)) { + if (!inlinePresentation.isPinned() // don't filter pinned suggestions + && !includeDataset(dataset, fieldIndex, filterText)) { continue; } InlineSuggestion inlineSuggestion = createInlineSuggestion(isAugmented, dataset,