1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-05 09:01:11 +01:00

* AccessibilityHelpers.cs: If (#689)

AccessibilityNodeInfo.FindAccessibilityNodeInfosByViewId(..) returns
  null when the source package is a supported browser, return a null
  uri to prevent overwriting the existing notification's pendingIntent
  uri extra with the brower's packageName.

* AccessibilityService.cs: Added null uri checks as it is now possible
  for AccessibilityHelpers.getUri(..) to return a null uri when the
  Accessibility Service is misbehaving.
This commit is contained in:
Matt Portune 2020-01-03 15:19:20 -05:00 committed by Kyle Spearrin
parent a9dacd561c
commit c33728d418
2 changed files with 8 additions and 2 deletions

View File

@ -114,6 +114,12 @@ namespace Bit.Droid.Accessibility
uri = ExtractUri(uri, addressNode, browser);
addressNode.Dispose();
}
else
{
// Return null to prevent overwriting notification pendingIntent uri with browser packageName
// (we login to pages, not browsers)
return null;
}
}
return uri;
}

View File

@ -100,11 +100,11 @@ namespace Bit.Droid.Accessibility
break;
}
var uri = AccessibilityHelpers.GetUri(root);
if(uri != _lastNotificationUri)
if(uri != null && uri != _lastNotificationUri)
{
CancelNotification(notificationManager);
}
else if(uri.StartsWith(Constants.AndroidAppProtocol))
else if(uri != null && uri.StartsWith(Constants.AndroidAppProtocol))
{
CancelNotification(notificationManager, 30000);
}