summaryrefslogtreecommitdiff
path: root/core/java/android/inputmethodservice/InputMethodService.java
diff options
context:
space:
mode:
authorJoanne Chung <joannechung@google.com>2020-01-06 10:11:26 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-01-06 10:11:26 +0000
commitcd2547197dd39e94d19163a624dfa6040d6ad35a (patch)
tree3bf5d5e8ccb26fc1c5c6206b5d901638de5470df /core/java/android/inputmethodservice/InputMethodService.java
parent53af5b24a6e0ea0b5a581bbc06ef0db633fe8e0c (diff)
parentd9a916fe4da8d91f7a1e0d36fb1bde7d333e76b9 (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.java21
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);
}