From f2e4a1c4888c17eed5d3b39a37e746adcd717bb2 Mon Sep 17 00:00:00 2001 From: Manuel Martin Date: Thu, 20 Aug 2020 15:10:36 +0200 Subject: [PATCH] Do not show login save/select if autofill is disabled (#3848) --- .../shared/org/mozilla/vrbrowser/browser/PromptDelegate.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/PromptDelegate.java b/app/src/common/shared/org/mozilla/vrbrowser/browser/PromptDelegate.java index a7c372a59..a050ad923 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/PromptDelegate.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/PromptDelegate.java @@ -296,7 +296,7 @@ public GeckoResult onLoginSave(@NonNull GeckoSession geckoSessio final GeckoResult result = new GeckoResult<>(); // We always get at least one item, at the moment only one item is support. - if (autocompleteRequest.options.length > 0) { + if (autocompleteRequest.options.length > 0 && SettingsStore.getInstance(mContext).isAutoFillEnabled()) { Autocomplete.LoginSaveOption saveOption = autocompleteRequest.options[0]; boolean originHasException = mSavedLoginBlockedSites.stream().anyMatch(site -> site.url.equals(saveOption.value.origin)); if (originHasException || !SettingsStore.getInstance(mContext).isLoginAutocompleteEnabled()) { @@ -335,7 +335,7 @@ public void confirm(@NonNull Login login) { public GeckoResult onLoginSelect(@NonNull GeckoSession geckoSession, final @NonNull AutocompleteRequest autocompleteRequest) { final GeckoResult result = new GeckoResult<>(); - if (autocompleteRequest.options.length > 1) { + if (autocompleteRequest.options.length > 1 && SettingsStore.getInstance(mContext).isAutoFillEnabled()) { List logins = Arrays.stream(autocompleteRequest.options).map(item -> GeckoLoginDelegateWrapper.toLogin(item.value)).collect(Collectors.toList()); mSelectLoginPrompt = new SelectLoginPromptWidget(mContext, new SelectLoginPromptWidget.Delegate() { @Override