From 4ed749111678546ce1da246a1553e49ad9891bee Mon Sep 17 00:00:00 2001 From: Matt Portune <59324545+mportune-bw@users.noreply.github.com> Date: Mon, 18 Oct 2021 09:56:12 -0400 Subject: [PATCH] fix for crash when checking for running accessibility service without activity (#1591) --- src/Android/Services/DeviceActionService.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Android/Services/DeviceActionService.cs b/src/Android/Services/DeviceActionService.cs index 35202e7e4..9bb004161 100644 --- a/src/Android/Services/DeviceActionService.cs +++ b/src/Android/Services/DeviceActionService.cs @@ -640,8 +640,7 @@ namespace Bit.Droid.Services public bool AutofillAccessibilityServiceRunning() { - var activity = (MainActivity)CrossCurrentActivity.Current.Activity; - var enabledServices = Settings.Secure.GetString(activity.ContentResolver, + var enabledServices = Settings.Secure.GetString(Application.Context.ContentResolver, Settings.Secure.EnabledAccessibilityServices); return Application.Context.PackageName != null && (enabledServices?.Contains(Application.Context.PackageName) ?? false);