Update Android autofill to properly detect email type fiels (#1332)

This commit is contained in:
Leendert de Borst
2025-11-05 19:16:47 +01:00
parent 02eae4c04f
commit a4a1c0b097

View File

@@ -243,8 +243,11 @@ class FieldFinder(var structure: AssistStructure) {
* @return Whether the node is an email field
*/
private fun isEmailField(node: AssistStructure.ViewNode): Boolean {
// Check input type for email
if ((node.inputType and android.text.InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS) != 0) {
// Check input type for email - mask to get only the variation bits
val inputType = node.inputType
if ((inputType and android.text.InputType.TYPE_MASK_CLASS) == android.text.InputType.TYPE_CLASS_TEXT &&
(inputType and android.text.InputType.TYPE_MASK_VARIATION) == android.text.InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS
) {
return true
}