mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 18:08:26 +03:00
dont process OnSaveRequest if prompt disabled
This commit is contained in:
parent
59620e6435
commit
999c9667c8
1 changed files with 15 additions and 3 deletions
|
@ -22,6 +22,7 @@ namespace Bit.Droid.Autofill
|
|||
{
|
||||
private ICipherService _cipherService;
|
||||
private ILockService _lockService;
|
||||
private IStorageService _storageService;
|
||||
|
||||
public async override void OnFillRequest(FillRequest request, CancellationSignal cancellationSignal, FillCallback callback)
|
||||
{
|
||||
|
@ -60,7 +61,7 @@ namespace Bit.Droid.Autofill
|
|||
callback.OnSuccess(response);
|
||||
}
|
||||
|
||||
public override void OnSaveRequest(SaveRequest request, SaveCallback callback)
|
||||
public async override void OnSaveRequest(SaveRequest request, SaveCallback callback)
|
||||
{
|
||||
var structure = request.FillContexts?.LastOrDefault()?.Structure;
|
||||
if(structure == null)
|
||||
|
@ -68,6 +69,17 @@ namespace Bit.Droid.Autofill
|
|||
return;
|
||||
}
|
||||
|
||||
if(_storageService == null)
|
||||
{
|
||||
_storageService = ServiceContainer.Resolve<IStorageService>("storageService");
|
||||
}
|
||||
|
||||
var disableSavePrompt = await _storageService.GetAsync<bool?>(Constants.AutofillDisableSavePromptKey);
|
||||
if(disableSavePrompt.GetValueOrDefault())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var parser = new Parser(structure, ApplicationContext);
|
||||
parser.Parse();
|
||||
|
||||
|
|
Loading…
Reference in a new issue