1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-12-01 13:04:02 +01:00

fix for crash when checking for running accessibility service without activity (#1591)

This commit is contained in:
Matt Portune 2021-10-18 09:56:12 -04:00 committed by GitHub
parent 1ebad6bca5
commit 4ed7491116
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -640,8 +640,7 @@ namespace Bit.Droid.Services
public bool AutofillAccessibilityServiceRunning() public bool AutofillAccessibilityServiceRunning()
{ {
var activity = (MainActivity)CrossCurrentActivity.Current.Activity; var enabledServices = Settings.Secure.GetString(Application.Context.ContentResolver,
var enabledServices = Settings.Secure.GetString(activity.ContentResolver,
Settings.Secure.EnabledAccessibilityServices); Settings.Secure.EnabledAccessibilityServices);
return Application.Context.PackageName != null && return Application.Context.PackageName != null &&
(enabledServices?.Contains(Application.Context.PackageName) ?? false); (enabledServices?.Contains(Application.Context.PackageName) ?? false);