event service func

This commit is contained in:
Kyle Spearrin 2019-07-23 00:06:34 -04:00
parent 0d6cc91b67
commit 6d2dcb73ae
2 changed files with 6 additions and 6 deletions

View file

@ -107,7 +107,7 @@ namespace Bit.Droid
var cryptoPrimitiveService = new CryptoPrimitiveService(); var cryptoPrimitiveService = new CryptoPrimitiveService();
var mobileStorageService = new MobileStorageService(preferencesStorage, liteDbStorage); var mobileStorageService = new MobileStorageService(preferencesStorage, liteDbStorage);
var deviceActionService = new DeviceActionService(mobileStorageService, messagingService, var deviceActionService = new DeviceActionService(mobileStorageService, messagingService,
broadcasterService); broadcasterService, () => ServiceContainer.Resolve<IEventService>("eventService"));
var platformUtilsService = new MobilePlatformUtilsService(deviceActionService, messagingService, var platformUtilsService = new MobilePlatformUtilsService(deviceActionService, messagingService,
broadcasterService); broadcasterService);

View file

@ -36,7 +36,7 @@ namespace Bit.Droid.Services
private readonly IStorageService _storageService; private readonly IStorageService _storageService;
private readonly IMessagingService _messagingService; private readonly IMessagingService _messagingService;
private readonly IBroadcasterService _broadcasterService; private readonly IBroadcasterService _broadcasterService;
private readonly IEventService _eventService; private readonly Func<IEventService> _eventServiceFunc;
private ProgressDialog _progressDialog; private ProgressDialog _progressDialog;
private bool _cameraPermissionsDenied; private bool _cameraPermissionsDenied;
private Toast _toast; private Toast _toast;
@ -45,12 +45,12 @@ namespace Bit.Droid.Services
IStorageService storageService, IStorageService storageService,
IMessagingService messagingService, IMessagingService messagingService,
IBroadcasterService broadcasterService, IBroadcasterService broadcasterService,
IEventService eventService) Func<IEventService> eventServiceFunc)
{ {
_storageService = storageService; _storageService = storageService;
_messagingService = messagingService; _messagingService = messagingService;
_broadcasterService = broadcasterService; _broadcasterService = broadcasterService;
_eventService = eventService; _eventServiceFunc = eventServiceFunc;
_broadcasterService.Subscribe(nameof(DeviceActionService), (message) => _broadcasterService.Subscribe(nameof(DeviceActionService), (message) =>
{ {
@ -466,7 +466,7 @@ namespace Bit.Droid.Services
replyIntent.PutExtra(AutofillManager.ExtraAuthenticationResult, dataset); replyIntent.PutExtra(AutofillManager.ExtraAuthenticationResult, dataset);
activity.SetResult(Result.Ok, replyIntent); activity.SetResult(Result.Ok, replyIntent);
activity.Finish(); activity.Finish();
var eventTask = _eventService.CollectAsync(EventType.Cipher_ClientAutofilled, cipher.Id); var eventTask = _eventServiceFunc().CollectAsync(EventType.Cipher_ClientAutofilled, cipher.Id);
} }
else else
{ {
@ -492,7 +492,7 @@ namespace Bit.Droid.Services
} }
activity.Finish(); activity.Finish();
_messagingService.Send("finishMainActivity"); _messagingService.Send("finishMainActivity");
var eventTask = _eventService.CollectAsync(EventType.Cipher_ClientAutofilled, cipher.Id); var eventTask = _eventServiceFunc().CollectAsync(EventType.Cipher_ClientAutofilled, cipher.Id);
} }
} }