Allow matching password fields based on hints only (#1129)

Filling passwords is usually only offered for fields with a password
input type, which ensures that they are always properly masked. Certain
custom views (e.g., the Termux terminal view), may apply their own
masking that is not based on the standard views.

With this commit, we allow filling passwords into arbitrary fields as
long as they have an Autofill hint that indicates a password.
This commit is contained in:
Fabian Henneke 2020-10-02 12:19:20 +02:00 committed by GitHub
parent 8f3fd99472
commit eac1c6f1d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -243,7 +243,7 @@ class FormField(
// Password field heuristics (based only on the current field)
private val isPossiblePasswordField =
notExcluded && (isAndroidPasswordField || isHtmlPasswordField)
notExcluded && (isAndroidPasswordField || isHtmlPasswordField || hasHintPassword)
private val isCertainPasswordField = isPossiblePasswordField && hasHintPassword
private val isLikelyPasswordField = isPossiblePasswordField &&
(isCertainPasswordField || PASSWORD_HEURISTIC_TERMS.anyMatchesFieldInfo)