summaryrefslogtreecommitdiff
path: root/core/java/android/inputmethodservice/InputMethodService.java
diff options
context:
space:
mode:
authorFeng Cao <fengcao@google.com>2020-02-28 11:39:56 -0800
committerFeng Cao <fengcao@google.com>2020-02-28 22:08:32 -0800
commite65a97cef4e9a9b801e0ff985349d4059364ed59 (patch)
tree8cbc262fcf182bce5626d333c7c1dba37bb6aa30 /core/java/android/inputmethodservice/InputMethodService.java
parentec496000ec89664e2eaa6da610fbcd48374dbb62 (diff)
Populate the autofillId in the IMS EditorInfo
* So it can be checked against the autofillId from autofill manager service * Currently not checking due to race condition, will find a fix in follow up CL Test: manual verification Bug: 149522488 Change-Id: I49457e33c7a1acb028023cb70f248805a96c5346
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
-rw-r--r--core/java/android/inputmethodservice/InputMethodService.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index 27839e780494..d27d1382e09d 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -73,6 +73,7 @@ import android.view.Window;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.view.animation.AnimationUtils;
+import android.view.autofill.AutofillId;
import android.view.inputmethod.CompletionInfo;
import android.view.inputmethod.CursorAnchorInfo;
import android.view.inputmethod.EditorInfo;
@@ -825,7 +826,7 @@ public class InputMethodService extends AbstractInputMethodService {
mInlineSuggestionSession.invalidateSession();
}
mInlineSuggestionSession = new InlineSuggestionSession(requestInfo.getComponentName(),
- callback, this::getEditorInfoPackageName,
+ callback, this::getEditorInfoPackageName, this::getEditorInfoAutofillId,
() -> onCreateInlineSuggestionsRequest(requestInfo.getUiExtras()),
this::getHostInputToken, this::onInlineSuggestionsResponse);
}
@@ -838,6 +839,14 @@ public class InputMethodService extends AbstractInputMethodService {
return null;
}
+ @Nullable
+ private AutofillId getEditorInfoAutofillId() {
+ if (mInputEditorInfo != null) {
+ return mInputEditorInfo.autofillId;
+ }
+ return null;
+ }
+
/**
* Returns the {@link IBinder} input token from the host view root.
*/