diff --git a/src/Android/Autofill/AutofillService.cs b/src/Android/Autofill/AutofillService.cs index 90e8009b6..4eae82719 100644 --- a/src/Android/Autofill/AutofillService.cs +++ b/src/Android/Autofill/AutofillService.cs @@ -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) { @@ -38,10 +39,10 @@ namespace Bit.Droid.Autofill { return; } - + if(_lockService == null) { - _lockService = ServiceContainer.Resolve("lockService"); + _lockService = ServiceContainer.Resolve("lockService"); } List items = null; @@ -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("storageService"); + } + + var disableSavePrompt = await _storageService.GetAsync(Constants.AutofillDisableSavePromptKey); + if(disableSavePrompt.GetValueOrDefault()) + { + return; + } + var parser = new Parser(structure, ApplicationContext); parser.Parse();