mirror of
https://github.com/bitwarden/android.git
synced 2024-11-01 07:35:52 +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)
|
public Field(ViewNode node)
|
||||||
{
|
{
|
||||||
Id = node.Id;
|
Id = node.Id;
|
||||||
|
TrackingId = $"{node.Id}_{node.GetHashCode()}";
|
||||||
IdEntry = node.IdEntry;
|
IdEntry = node.IdEntry;
|
||||||
AutofillId = node.AutofillId;
|
AutofillId = node.AutofillId;
|
||||||
AutofillType = node.AutofillType;
|
AutofillType = node.AutofillType;
|
||||||
|
@ -68,6 +69,7 @@ namespace Bit.Android.Autofill
|
||||||
}
|
}
|
||||||
public string Hint { get; set; }
|
public string Hint { get; set; }
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
|
public string TrackingId { get; private set; }
|
||||||
public string IdEntry { get; set; }
|
public string IdEntry { get; set; }
|
||||||
public AutofillId AutofillId { get; private set; }
|
public AutofillId AutofillId { get; private set; }
|
||||||
public AutofillType AutofillType { 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> Hints { get; private set; } = new HashSet<string>();
|
||||||
public HashSet<string> FocusedHints { 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 List<Field> Fields { get; private set; } = new List<Field>();
|
||||||
public IDictionary<string, List<Field>> HintToFieldsMap { get; private set; } =
|
public IDictionary<string, List<Field>> HintToFieldsMap { get; private set; } =
|
||||||
new Dictionary<string, List<Field>>();
|
new Dictionary<string, List<Field>>();
|
||||||
|
@ -120,13 +121,14 @@ namespace Bit.Android.Autofill
|
||||||
|
|
||||||
public void Add(Field field)
|
public void Add(Field field)
|
||||||
{
|
{
|
||||||
if(Fields.Contains(field))
|
if(field == null || FieldTrackingIds.Contains(field.TrackingId))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_passwordFields = _usernameFields = null;
|
_passwordFields = _usernameFields = null;
|
||||||
|
|
||||||
|
FieldTrackingIds.Add(field.TrackingId);
|
||||||
Fields.Add(field);
|
Fields.Add(field);
|
||||||
AutofillIds.Add(field.AutofillId);
|
AutofillIds.Add(field.AutofillId);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue