1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-16 08:13:20 +00:00

autofill intent fixes

This commit is contained in:
Kyle Spearrin
2017-02-16 22:22:19 -05:00
parent 5bce95a686
commit be9db2930f
4 changed files with 18 additions and 44 deletions

View File

@@ -60,7 +60,7 @@ namespace Bit.Android
{
return;
}
switch(e.EventType)
{
case EventTypes.WindowContentChanged:
@@ -77,13 +77,8 @@ namespace Bit.Android
if(passwordNodes.Any())
{
var uri = GetUri(root);
if(uri != null)
if(uri != null && !uri.Contains(BitwardenWebsite))
{
if(uri.Contains(BitwardenWebsite))
{
break;
}
if(NeedToAutofill(AutofillActivity.LastCredentials, uri))
{
var allEditTexts = GetWindowNodes(root, e, n => EditText(n));
@@ -252,18 +247,18 @@ namespace Bit.Android
}
private IEnumerable<AccessibilityNodeInfo> GetWindowNodes(AccessibilityNodeInfo n,
AccessibilityEvent e, Func<AccessibilityNodeInfo, bool> p)
AccessibilityEvent e, Func<AccessibilityNodeInfo, bool> condition)
{
if(n != null)
{
if(n.WindowId == e.WindowId && !(n.ViewIdResourceName?.StartsWith(SystemUiPackage) ?? false) && p(n))
if(n.WindowId == e.WindowId && !(n.ViewIdResourceName?.StartsWith(SystemUiPackage) ?? false) && condition(n))
{
yield return n;
}
for(int i = 0; i < n.ChildCount; i++)
{
foreach(var node in GetWindowNodes(n.GetChild(i), e, p))
foreach(var node in GetWindowNodes(n.GetChild(i), e, condition))
{
yield return node;
}