From 88fc7ff9009138022280574da5b7c322b46b1e81 Mon Sep 17 00:00:00 2001 From: Feng Cao Date: Mon, 9 Mar 2020 22:37:14 -0700 Subject: [PATCH] Send inline actions to IME even when inline suggestions are empty Test: manual Bug: 150952929 Change-Id: Ia0429936f65cd1fe82c7d33d76c4e885be875103 --- .../autofill/java/com/android/server/autofill/Session.java | 2 +- .../android/server/autofill/ui/InlineSuggestionFactory.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java index 56194788358df..538082d2f67eb 100644 --- a/services/autofill/java/com/android/server/autofill/Session.java +++ b/services/autofill/java/com/android/server/autofill/Session.java @@ -2681,7 +2681,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState response, filterText, response.getInlineActions(), mCurrentViewId, this, () -> { synchronized (mLock) { - requestHideFillUi(mCurrentViewId); + mInlineSuggestionSession.hideInlineSuggestionsUi(mCurrentViewId); } }, remoteRenderService); if (inlineSuggestionsResponse == null) { 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 82e5003d3961e..ee59d89b7f159 100644 --- a/services/autofill/java/com/android/server/autofill/ui/InlineSuggestionFactory.java +++ b/services/autofill/java/com/android/server/autofill/ui/InlineSuggestionFactory.java @@ -167,8 +167,7 @@ public final class InlineSuggestionFactory { inlineSuggestions.add(inlineSuggestion); } - // We should only add inline actions if there is at least one suggestion. - if (!inlineSuggestions.isEmpty() && inlineActions != null) { + if (inlineActions != null) { for (InlineAction inlineAction : inlineActions) { final InlineSuggestion inlineActionSuggestion = createInlineAction(isAugmented, mergedInlinePresentation(request, 0, inlineAction.getInlinePresentation()),