mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 18:08:26 +03:00
bootstrap
This commit is contained in:
parent
fff32e8086
commit
e141991166
2 changed files with 17 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Android.App;
|
||||
using Android.Runtime;
|
||||
using Bit.App.Abstractions;
|
||||
|
@ -32,10 +33,11 @@ namespace Bit.Droid
|
|||
public override void OnCreate()
|
||||
{
|
||||
base.OnCreate();
|
||||
Bootstrap();
|
||||
Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this);
|
||||
}
|
||||
|
||||
public void RegisterLocalServices()
|
||||
private void RegisterLocalServices()
|
||||
{
|
||||
var preferencesStorage = new PreferencesStorageService(null);
|
||||
var documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
|
||||
|
@ -58,5 +60,18 @@ namespace Bit.Droid
|
|||
ServiceContainer.Register<IDeviceActionService>("deviceActionService", deviceActionService);
|
||||
ServiceContainer.Register<IPlatformUtilsService>("platformUtilsService", platformUtilsService);
|
||||
}
|
||||
|
||||
private void Bootstrap()
|
||||
{
|
||||
(ServiceContainer.Resolve<II18nService>("i18nService") as MobileI18nService).Init();
|
||||
ServiceContainer.Resolve<IAuthService>("authService").Init();
|
||||
// Note: This is not awaited
|
||||
var bootstrapTask = BootstrapAsync();
|
||||
}
|
||||
|
||||
private async Task BootstrapAsync()
|
||||
{
|
||||
await ServiceContainer.Resolve<IEnvironmentService>("environmentService").SetUrlsFromStorageAsync();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -19,5 +19,6 @@ namespace Bit.Core.Abstractions
|
|||
Task<AuthResult> LogInCompleteAsync(string email, string masterPassword, TwoFactorProviderType twoFactorProvider, string twoFactorToken, bool? remember = null);
|
||||
Task<AuthResult> LogInTwoFactorAsync(TwoFactorProviderType twoFactorProvider, string twoFactorToken, bool? remember = null);
|
||||
void LogOut(Action callback);
|
||||
void Init();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue