[PM-43211] Recognize HTML card hints in Android autofill - #7364
Draft
erabti wants to merge 1 commit into
Draft
Conversation
Collaborator
|
Thank you for your contribution! We've added this to our internal Community PR board for review. Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process. |
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎟️ Tracking
Reproduced Android card-autofill failure on the Arabic Moamalat payment form (
npg.moamalat.net). Switching the same form to English makes the card picker work. Related community report: https://community.bitwarden.com/t/credit-card-autofill-issue-with-website-in-language-other-than-english/93355 (not claiming identical underlying behavior).📔 Objective
Recognize HTML card autocomplete tokens supplied directly in
AssistStructure.ViewNode.autofillHints, without relying on an English label or placeholder.On Pixel 10 Pro / Android 17, Bitwarden 2026.8.0, Chrome 152.0.7977.76, the Arabic card-number field offers no cards. Expiration/security-code fields open a login picker instead. Chrome's third-party autofill integration is enabled. Sanitized Android structure inspection confirms the card field reaches Android with
autofillHints=[cc-number], a localized hint, and HTML attributesid=cc-number,name=cardNumber,type=text.The source HTML includes:
Chrome normalizes the unknown input type to text. Changing that type alone did not fix recognition. A fresh field with the English placeholder
Card numberopened the card picker, and the reporter independently confirmed that the site's normal English-language option works after refresh. No payment was submitted. These are observations of the released app, not validation of a patched APK.The current explicit-hint allowlist accepts Android's
creditCardNumber, but not the HTMLcc-numbertoken observed in the Android structure. Once rejected, matching falls back to heuristic labels. This patch accepts the seven standard HTML card hints (cc-number,cc-exp,cc-exp-month,cc-exp-year,cc-csc,cc-name,cc-type) and maps them to the existing Card partitions before those heuristics. It retains the order of supported hints and leaves unknown hints unsupported. No URI matching, vault schema, credential storage, or new dependency changes.Validation
git diff --checkpassed../gradlew :app:testStandardDebugUnitTest --tests 'com.x8bit.bitwarden.data.autofill.util.ViewNodeExtensionsTest'.Prepared with AI assistance from reporter-confirmed device behavior and sanitized field metadata. No vault contents, payment details, screenshots, or private diagnostics are included.