diff options
| author | Feng Cao <fengcao@google.com> | 2020-03-24 18:19:54 -0700 |
|---|---|---|
| committer | Feng Cao <fengcao@google.com> | 2020-03-24 21:56:30 -0700 |
| commit | a873cd12c888b710c2d1a60247494d4e7b3d186e (patch) | |
| tree | 9b46d7027fcb937fff3f11ba26666d299dc67034 /core/java/android | |
| parent | 84d1c3c61867ab382bd3e399283b5999a5cf2382 (diff) | |
Fix the validation for showing inline suggestion in webview
Test: m -j & manual varification
Test: CtsInputMethodTestCases
Test: CtsAutoFillServiceTestCases
Bug: 151846600
Change-Id: I350b199455e77f769915e7d457dbcab31c20134d
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/inputmethodservice/InlineSuggestionSession.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/java/android/inputmethodservice/InlineSuggestionSession.java b/core/java/android/inputmethodservice/InlineSuggestionSession.java index c31cb4e61b6e..9b3e8c9c137d 100644 --- a/core/java/android/inputmethodservice/InlineSuggestionSession.java +++ b/core/java/android/inputmethodservice/InlineSuggestionSession.java @@ -166,9 +166,14 @@ class InlineSuggestionSession { } return; } - + // The IME doesn't have information about the virtual view id for the child views in the + // web view, so we are only comparing the parent view id here. This means that for cases + // where there are two input fields in the web view, they will have the same view id + // (although different virtual child id), and we will not be able to distinguish them. + final AutofillId imeClientFieldId = mClientAutofillIdSupplier.get(); if (!mComponentName.getPackageName().equals(mClientPackageNameSupplier.get()) - || !fieldId.equalsIgnoreSession(mClientAutofillIdSupplier.get())) { + || imeClientFieldId == null + || fieldId.getViewId() != imeClientFieldId.getViewId()) { if (DEBUG) { Log.d(TAG, "handleOnInlineSuggestionsResponse() called on the wrong package/field " |
