Commit 667ebe31 authored by ekager's avatar ekager Committed by Emily Kager
Browse files

For #8967 - Remove ability to pref login autofilling by itself

parent 320fc4e4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -64,9 +64,10 @@ object GeckoProvider {
        }

        val geckoRuntime = GeckoRuntime.create(context, runtimeSettings)
        // As a quick fix for #8967 we are conflating "should autofill" with "should save logins"
        val loginStorageDelegate = GeckoLoginStorageDelegate(
            storage,
            { context.settings().shouldAutofillLogins && context.settings().shouldPromptToSaveLogins }
            { context.settings().shouldPromptToSaveLogins }
        )
        geckoRuntime.loginStorageDelegate = GeckoLoginDelegateWrapper(loginStorageDelegate)

+2 −1
Original line number Diff line number Diff line
@@ -56,9 +56,10 @@ object GeckoProvider {
        }

        val geckoRuntime = GeckoRuntime.create(context, runtimeSettings)
        // As a quick fix for #8967 we are conflating "should autofill" with "should save logins"
        val loginStorageDelegate = GeckoLoginStorageDelegate(
            storage,
            { context.settings().shouldAutofillLogins && context.settings().shouldPromptToSaveLogins }
            { context.settings().shouldPromptToSaveLogins }
        )
        geckoRuntime.loginStorageDelegate = GeckoLoginDelegateWrapper(loginStorageDelegate)

+5 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import org.mozilla.fenix.R
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.metrics
import org.mozilla.fenix.ext.showToolbar
import org.mozilla.fenix.settings.RadioButtonPreference
@@ -39,6 +40,8 @@ class SaveLoginSettingFragment : PreferenceFragmentCompat() {
                        )
                    )
                }
                // We want to reload the current session here so we can try to fill the current page
                context?.components?.useCases?.sessionUseCases?.reload?.invoke()
                return super.onPreferenceChange(preference, newValue)
            }
        }
@@ -57,6 +60,8 @@ class SaveLoginSettingFragment : PreferenceFragmentCompat() {
                        )
                    )
                }
                // We want to reload the current session here so we don't save any currently inserted login
                context?.components?.useCases?.sessionUseCases?.reload?.invoke()
                return super.onPreferenceChange(preference, newValue)
            }
        }
+3 −1
Original line number Diff line number Diff line
@@ -2,12 +2,14 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <androidx.preference.Preference
        android:key="@string/pref_key_save_logins_settings"
        android:summary="@string/preferences_passwords_save_logins_ask_to_save"
        android:title="@string/preferences_passwords_save_logins" />
    <SwitchPreference
        app:isPreferenceVisible="false"
        android:defaultValue="true"
        android:key="@string/pref_key_autofill_logins"
        android:title="@string/preferences_passwords_autofill" />