diff --git a/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt index 3891ead48a..6542f20673 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt @@ -464,8 +464,6 @@ class SettingsFragment : PreferenceFragmentCompat() { findPreference(getPreferenceKey(R.string.pref_key_start_profiler)) with(requireContext().settings()) { - findPreference(getPreferenceKey(R.string.pref_key_cookie_banner_settings)) - ?.isVisible = shouldShowCookieBannerUI findPreference( getPreferenceKey(R.string.pref_key_nimbus_experiments), )?.isVisible = showSecretDebugMenuThisSession @@ -481,6 +479,7 @@ class SettingsFragment : PreferenceFragmentCompat() { preferenceStartProfiler?.isVisible = showSecretDebugMenuThisSession && (requireContext().components.core.engine.profiler?.isProfilerActive() != null) } + setupCookieBannerPreference() setupAmoCollectionOverridePreference(requireContext().settings()) setupAllowDomesticChinaFxaServerPreference() setupHttpsOnlyPreferences() @@ -635,6 +634,21 @@ class SettingsFragment : PreferenceFragmentCompat() { } } + @VisibleForTesting + internal fun setupCookieBannerPreference() { + with(requirePreference(R.string.pref_key_cookie_banner_settings)) { + summary = context?.let { + isVisible = it.settings().shouldShowCookieBannerUI + + if (it.settings().shouldUseCookieBanner) { + getString(R.string.reduce_cookie_banner_option_on) + } else { + getString(R.string.reduce_cookie_banner_option_off) + } + } + } + } + @VisibleForTesting internal fun setupHttpsOnlyPreferences() { val httpsOnlyPreference = diff --git a/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/CookieBannerHandlingDetailsView.kt b/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/CookieBannerHandlingDetailsView.kt index c8e3dee699..8a6b66fd2d 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/CookieBannerHandlingDetailsView.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/CookieBannerHandlingDetailsView.kt @@ -75,7 +75,7 @@ class CookieBannerHandlingDetailsView( if (isCookieBannerHandlingEnabled) { R.string.reduce_cookie_banner_details_panel_description_off_for_site } else { - R.string.reduce_cookie_banner_details_panel_description_on_for_site_1 + R.string.reduce_cookie_banner_details_panel_description_on_for_site_2 } val appName = context.getString(R.string.app_name) binding.details.text = context.getString(stringID, appName) diff --git a/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/dialog/CookieBannerReEngagementDialogUtils.kt b/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/dialog/CookieBannerReEngagementDialogUtils.kt index 154b7eca8c..25cb29667f 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/dialog/CookieBannerReEngagementDialogUtils.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/dialog/CookieBannerReEngagementDialogUtils.kt @@ -32,7 +32,10 @@ object CookieBannerReEngagementDialogUtils { CONTROL_VARIANT -> CookieBannerDialogVariant( title = context.getString(R.string.reduce_cookie_banner_control_experiment_dialog_title), message = context.getString( - R.string.reduce_cookie_banner_control_experiment_dialog_body_1, + R.string.reduce_cookie_banner_control_experiment_dialog_body_2, + context.getString( + R.string.app_name, + ), ), positiveTextButton = context.getString( R.string.reduce_cookie_banner_control_experiment_dialog_change_setting_button, @@ -62,7 +65,10 @@ object CookieBannerReEngagementDialogUtils { CookieBannerDialogVariant( title = context.getString(R.string.reduce_cookie_banner_control_experiment_dialog_title), message = context.getString( - R.string.reduce_cookie_banner_control_experiment_dialog_body_1, + R.string.reduce_cookie_banner_control_experiment_dialog_body_2, + context.getString( + R.string.app_name, + ), ), positiveTextButton = context.getString( R.string.reduce_cookie_banner_control_experiment_dialog_change_setting_button, diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3d809d8438..d3c48d9616 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -341,6 +341,10 @@ Cookie Banner Reduction Reduce cookie banners + + Off + + On Firefox automatically tries to reject cookie requests on cookie banners. If a reject option isn’t available, Firefox may accept all cookies to dismiss the banner. @@ -349,6 +353,8 @@ Off for this site On for this site + + Site currently not supported Turn on Cookie Banner Reduction for %1$s? @@ -358,13 +364,17 @@ %1$s can try to automatically reject cookie requests. If a reject option isn’t available, %2$s may accept all cookies to dismiss the banner. - %1$s can try to automatically reject cookie requests. + %1$s can try to automatically reject cookie requests. + + %1$s tries to automatically reject all cookie requests on supported sites. - Cookie banners begone! + Cookie banners begone! Automatically reject cookie requests, when possible. Otherwise, accept all cookies to dismiss cookie banners. - Automatically reject cookie requests, when possible. + Automatically reject cookie requests, when possible. + + Allow %1$s to automatically reject cookie requests when possible? Not Now diff --git a/app/src/test/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/CookieBannerHandlingDetailsViewTest.kt b/app/src/test/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/CookieBannerHandlingDetailsViewTest.kt index 14b598506d..f657006da8 100644 --- a/app/src/test/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/CookieBannerHandlingDetailsViewTest.kt +++ b/app/src/test/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/CookieBannerHandlingDetailsViewTest.kt @@ -152,7 +152,7 @@ class CookieBannerHandlingDetailsViewTest { val appName = testContext.getString(R.string.app_name) val expectedText = testContext.getString( - R.string.reduce_cookie_banner_details_panel_description_on_for_site_1, + R.string.reduce_cookie_banner_details_panel_description_on_for_site_2, appName, appName, )