diff --git a/src/Android/Autofill/FieldCollection.cs b/src/Android/Autofill/FieldCollection.cs index 8b29ab8e3..a01aaad70 100644 --- a/src/Android/Autofill/FieldCollection.cs +++ b/src/Android/Autofill/FieldCollection.cs @@ -102,7 +102,7 @@ namespace Bit.Droid.Autofill if (!_usernameFields.Any()) { - _usernameFields = Fields.Where(f => FieldHasUsernameTerms(f)).ToList(); + _usernameFields = Fields.Where(f => FieldIsUsername(f)).ToList(); } } return _usernameFields; @@ -327,13 +327,18 @@ namespace Bit.Droid.Autofill } return inputTypePassword && !ValueContainsAnyTerms(f.IdEntry, _ignoreSearchTerms) && - !ValueContainsAnyTerms(f.Hint, _ignoreSearchTerms) && !FieldHasUsernameTerms(f); + !ValueContainsAnyTerms(f.Hint, _ignoreSearchTerms) && !FieldIsUsername(f); } private bool FieldHasPasswordTerms(Field f) { return ValueContainsAnyTerms(f.IdEntry, _passwordTerms) || ValueContainsAnyTerms(f.Hint, _passwordTerms); } + + private bool FieldIsUsername(Field f) + { + return f.InputType.HasFlag(InputTypes.TextVariationWebEmailAddress) || FieldHasUsernameTerms(f); + } private bool FieldHasUsernameTerms(Field f) { @@ -350,4 +355,4 @@ namespace Bit.Droid.Autofill return terms.Any(t => lowerValue.Contains(t)); } } -} \ No newline at end of file +}