1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-10 12:33:28 +00:00

Fix for password unlock for autofill and share-to-send on Android (#1453)

This commit is contained in:
Matt Portune
2021-07-09 11:48:03 -04:00
committed by GitHub
parent 9298d57f22
commit ff19578807
5 changed files with 41 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ namespace Bit.App.Pages
private readonly AppOptions _appOptions;
private readonly IStorageService _storageService;
private readonly IDeviceActionService _deviceActionService;
private readonly IVaultTimeoutService _vaultTimeoutService;
private AddEditPageViewModel _vm;
private bool _fromAutofill;
@@ -38,6 +39,7 @@ namespace Bit.App.Pages
{
_storageService = ServiceContainer.Resolve<IStorageService>("storageService");
_deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService");
_vaultTimeoutService = ServiceContainer.Resolve<IVaultTimeoutService>("vaultTimeoutService");
_appOptions = appOptions;
_fromAutofill = fromAutofill;
FromAutofillFramework = _appOptions?.FromAutofillFramework ?? false;
@@ -145,6 +147,11 @@ namespace Bit.App.Pages
protected override async void OnAppearing()
{
base.OnAppearing();
await _vaultTimeoutService.CheckVaultTimeoutAsync();
if (await _vaultTimeoutService.IsLockedAsync())
{
return;
}
await LoadOnAppearedAsync(_scrollView, true, async () =>
{
var success = await _vm.LoadAsync(_appOptions);

View File

@@ -15,6 +15,7 @@ namespace Bit.App.Pages
{
private readonly AppOptions _appOptions;
private readonly IPlatformUtilsService _platformUtilsService;
private readonly IVaultTimeoutService _vaultTimeoutService;
private AutofillCiphersPageViewModel _vm;
@@ -27,11 +28,17 @@ namespace Bit.App.Pages
_vm.Init(appOptions);
_platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService");
_vaultTimeoutService = ServiceContainer.Resolve<IVaultTimeoutService>("vaultTimeoutService");
}
protected async override void OnAppearing()
{
base.OnAppearing();
await _vaultTimeoutService.CheckVaultTimeoutAsync();
if (await _vaultTimeoutService.IsLockedAsync())
{
return;
}
await LoadOnAppearedAsync(_mainLayout, false, async () =>
{
try