diff options
| author | Joanne Chung <joannechung@google.com> | 2020-01-06 10:11:26 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-01-06 10:11:26 +0000 |
| commit | cd2547197dd39e94d19163a624dfa6040d6ad35a (patch) | |
| tree | 3bf5d5e8ccb26fc1c5c6206b5d901638de5470df /core/java/android/inputmethodservice/InputMethodService.java | |
| parent | 53af5b24a6e0ea0b5a581bbc06ef0db633fe8e0c (diff) | |
| parent | d9a916fe4da8d91f7a1e0d36fb1bde7d333e76b9 (diff) | |
Merge "Finish autofill integration with keyboard cleanup tasks"
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
| -rw-r--r-- | core/java/android/inputmethodservice/InputMethodService.java | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index fe4f860484cf..ffb97c09a905 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -517,7 +517,9 @@ public class InputMethodService extends AbstractInputMethodService { @Override public void onCreateInlineSuggestionsRequest(ComponentName componentName, AutofillId autofillId, IInlineSuggestionsRequestCallback cb) { - Log.d(TAG, "InputMethodService received onCreateInlineSuggestionsRequest()"); + if (DEBUG) { + Log.d(TAG, "InputMethodService received onCreateInlineSuggestionsRequest()"); + } handleOnCreateInlineSuggestionsRequest(componentName, autofillId, cb); } @@ -755,7 +757,12 @@ public class InputMethodService extends AbstractInputMethodService { private void handleOnCreateInlineSuggestionsRequest(@NonNull ComponentName componentName, @NonNull AutofillId autofillId, @NonNull IInlineSuggestionsRequestCallback callback) { if (!mInputStarted) { - Log.w(TAG, "onStartInput() not called yet"); + try { + Log.w(TAG, "onStartInput() not called yet"); + callback.onInlineSuggestionsUnsupported(); + } catch (RemoteException e) { + Log.w(TAG, "Failed to call onInlineSuggestionsUnsupported.", e); + } return; } @@ -768,8 +775,12 @@ public class InputMethodService extends AbstractInputMethodService { private void handleOnInlineSuggestionsResponse(@NonNull ComponentName componentName, @NonNull AutofillId autofillId, @NonNull InlineSuggestionsResponse response) { if (!mInlineSuggestionsRequestInfo.validate(componentName)) { - Log.d(TAG, "Response component=" + componentName + " differs from request component=" - + mInlineSuggestionsRequestInfo.mComponentName + ", ignoring response"); + if (DEBUG) { + Log.d(TAG, + "Response component=" + componentName + " differs from request component=" + + mInlineSuggestionsRequestInfo.mComponentName + + ", ignoring response"); + } return; } onInlineSuggestionsResponse(response); @@ -841,7 +852,7 @@ public class InputMethodService extends AbstractInputMethodService { */ public boolean validate(ComponentName componentName) { final boolean result = componentName.equals(mComponentName); - if (!result) { + if (DEBUG && !result) { Log.d(TAG, "Cached request info ComponentName=" + mComponentName + " differs from received ComponentName=" + componentName); } |
