1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-27 12:26:31 +01:00

EC-833 fix WatchDeviceService registration to be called from the extensions appropiately (#2233)

This commit is contained in:
Federico Maccaroni 2022-12-13 11:27:15 -03:00 committed by GitHub
parent 1a3ff5ec41
commit 28d204f2b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 9 deletions

View File

@ -404,6 +404,7 @@ namespace Bit.iOS.Autofill
ServiceContainer.Init(deviceActionService.DeviceUserAgent,
Bit.Core.Constants.iOSAutoFillClearCiphersCacheKey, Bit.Core.Constants.iOSAllClearCipherCacheKeys);
iOSCoreHelpers.InitLogger();
iOSCoreHelpers.RegisterFinallyBeforeBootstrap();
iOSCoreHelpers.Bootstrap();
var appOptions = new AppOptions { IosExtension = true };
var app = new App.App(appOptions);

View File

@ -49,10 +49,7 @@ namespace Bit.iOS.Core.Utilities
Bit.Core.Constants.iOSAllClearCipherCacheKeys);
InitLogger();
ServiceContainer.Register<IWatchDeviceService>(new WatchDeviceService(ServiceContainer.Resolve<ICipherService>(),
ServiceContainer.Resolve<IEnvironmentService>(),
ServiceContainer.Resolve<IStateService>(),
ServiceContainer.Resolve<IVaultTimeoutService>()));
RegisterFinallyBeforeBootstrap();
Bootstrap();
@ -139,6 +136,14 @@ namespace Bit.iOS.Core.Utilities
ServiceContainer.Register<IAvatarImageSourcePool>("avatarImageSourcePool", new AvatarImageSourcePool());
}
public static void RegisterFinallyBeforeBootstrap()
{
ServiceContainer.Register<IWatchDeviceService>(new WatchDeviceService(ServiceContainer.Resolve<ICipherService>(),
ServiceContainer.Resolve<IEnvironmentService>(),
ServiceContainer.Resolve<IStateService>(),
ServiceContainer.Resolve<IVaultTimeoutService>()));
}
public static void Bootstrap(Func<Task> postBootstrapFunc = null)
{
(ServiceContainer.Resolve<II18nService>("i18nService") as MobileI18nService).Init();

View File

@ -408,6 +408,7 @@ namespace Bit.iOS.Extension
ServiceContainer.Init(deviceActionService.DeviceUserAgent,
Bit.Core.Constants.iOSExtensionClearCiphersCacheKey, Bit.Core.Constants.iOSAllClearCipherCacheKeys);
iOSCoreHelpers.InitLogger();
iOSCoreHelpers.RegisterFinallyBeforeBootstrap();
iOSCoreHelpers.Bootstrap();
var app = new App.App(new AppOptions { IosExtension = true });
ThemeManager.SetTheme(app.Resources);

View File

@ -306,11 +306,7 @@ namespace Bit.iOS
ServiceContainer.Init(deviceActionService.DeviceUserAgent, Constants.ClearCiphersCacheKey,
Constants.iOSAllClearCipherCacheKeys);
iOSCoreHelpers.InitLogger();
ServiceContainer.Register<IWatchDeviceService>(new WatchDeviceService(ServiceContainer.Resolve<ICipherService>(),
ServiceContainer.Resolve<IEnvironmentService>(),
ServiceContainer.Resolve<IStateService>(),
ServiceContainer.Resolve<IVaultTimeoutService>()));
iOSCoreHelpers.RegisterFinallyBeforeBootstrap();
_pushHandler = new iOSPushNotificationHandler(
ServiceContainer.Resolve<IPushNotificationListenerService>("pushNotificationListenerService"));