mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 23:25:45 +03:00
track with node id + hash code
This commit is contained in:
parent
93cae0e9cc
commit
ff9f49416a
2 changed files with 5 additions and 1 deletions
|
@ -16,6 +16,7 @@ namespace Bit.Android.Autofill
|
|||
public Field(ViewNode node)
|
||||
{
|
||||
Id = node.Id;
|
||||
TrackingId = $"{node.Id}_{node.GetHashCode()}";
|
||||
IdEntry = node.IdEntry;
|
||||
AutofillId = node.AutofillId;
|
||||
AutofillType = node.AutofillType;
|
||||
|
@ -68,6 +69,7 @@ namespace Bit.Android.Autofill
|
|||
}
|
||||
public string Hint { get; set; }
|
||||
public int Id { get; private set; }
|
||||
public string TrackingId { get; private set; }
|
||||
public string IdEntry { get; set; }
|
||||
public AutofillId AutofillId { get; private set; }
|
||||
public AutofillType AutofillType { get; private set; }
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace Bit.Android.Autofill
|
|||
}
|
||||
public HashSet<string> Hints { get; private set; } = new HashSet<string>();
|
||||
public HashSet<string> FocusedHints { get; private set; } = new HashSet<string>();
|
||||
public HashSet<string> FieldTrackingIds { get; private set; } = new HashSet<string>();
|
||||
public List<Field> Fields { get; private set; } = new List<Field>();
|
||||
public IDictionary<string, List<Field>> HintToFieldsMap { get; private set; } =
|
||||
new Dictionary<string, List<Field>>();
|
||||
|
@ -120,13 +121,14 @@ namespace Bit.Android.Autofill
|
|||
|
||||
public void Add(Field field)
|
||||
{
|
||||
if(Fields.Contains(field))
|
||||
if(field == null || FieldTrackingIds.Contains(field.TrackingId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_passwordFields = _usernameFields = null;
|
||||
|
||||
FieldTrackingIds.Add(field.TrackingId);
|
||||
Fields.Add(field);
|
||||
AutofillIds.Add(field.AutofillId);
|
||||
|
||||
|
|
Loading…
Reference in a new issue