From 7bc8f60377e6fef99f9fdb2ac5cd70716abe9526 Mon Sep 17 00:00:00 2001 From: Adam He Date: Thu, 12 Dec 2019 17:00:34 -0800 Subject: Added attributes for IME and AutofillService to indicate they support inline suggestions. Fixes: 146452946 Test: atest FrameworksCoreTests:android.view.inputmethod.InputMethodInfoTest Change-Id: I709b16d3f12c693bc670600bdcb9125630eb9b8e --- .../inputmethodservice/InputMethodService.java | 24 +++------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'core/java/android/inputmethodservice/InputMethodService.java') diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index a45f70316953..fe4f860484cf 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -721,15 +721,6 @@ public class InputMethodService extends AbstractInputMethodService { return false; } - /** - * Returns whether inline suggestions are enabled on this service. - * - * TODO(b/137800469): check XML for value. - */ - private boolean isInlineSuggestionsEnabled() { - return true; - } - /** * Sends an {@link InlineSuggestionsRequest} obtained from * {@link #onCreateInlineSuggestionsRequest()} to the current Autofill Session through @@ -763,23 +754,14 @@ public class InputMethodService extends AbstractInputMethodService { private void handleOnCreateInlineSuggestionsRequest(@NonNull ComponentName componentName, @NonNull AutofillId autofillId, @NonNull IInlineSuggestionsRequestCallback callback) { - mInlineSuggestionsRequestInfo = new InlineSuggestionsRequestInfo(componentName, autofillId, - callback); - - if (!isInlineSuggestionsEnabled()) { - try { - callback.onInlineSuggestionsUnsupported(); - } catch (RemoteException e) { - Log.w(TAG, "handleMakeInlineSuggestionsRequest() RemoteException:" + e); - } - return; - } - if (!mInputStarted) { Log.w(TAG, "onStartInput() not called yet"); return; } + mInlineSuggestionsRequestInfo = new InlineSuggestionsRequestInfo(componentName, autofillId, + callback); + makeInlineSuggestionsRequest(); } -- cgit v1.2.3