catch exception on accessibility service running

This commit is contained in:
Kyle Spearrin 2019-06-04 17:06:27 -04:00
parent 8e1753ea37
commit f6f6253eab

View file

@ -493,6 +493,8 @@ namespace Bit.Droid.Services
}
public bool AutofillAccessibilityServiceRunning()
{
try
{
var activity = (MainActivity)CrossCurrentActivity.Current.Activity;
var manager = activity.GetSystemService(Context.ActivityService) as ActivityManager;
@ -500,6 +502,11 @@ namespace Bit.Droid.Services
return services.Any(s => s.Process.ToLowerInvariant().Contains("bitwarden") &&
s.Service.ClassName.ToLowerInvariant().Contains("accessibilityservice"));
}
catch
{
return false;
}
}
public bool AutofillServiceEnabled()
{