From a4a1c0b09778eb51dd76c11e74827fc3e16cd771 Mon Sep 17 00:00:00 2001 From: Leendert de Borst Date: Wed, 5 Nov 2025 19:16:47 +0100 Subject: [PATCH] Update Android autofill to properly detect email type fiels (#1332) --- .../java/net/aliasvault/app/autofill/utils/FieldFinder.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/autofill/utils/FieldFinder.kt b/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/autofill/utils/FieldFinder.kt index 4e8e5bb72..b42ab6112 100644 --- a/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/autofill/utils/FieldFinder.kt +++ b/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/autofill/utils/FieldFinder.kt @@ -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 }