diff --git a/app/src/main/java/org/mozilla/fenix/settings/TrackingProtectionFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/TrackingProtectionFragment.kt index 4851b67cb5..45a57ad1a7 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/TrackingProtectionFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/TrackingProtectionFragment.kt @@ -11,6 +11,7 @@ import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import androidx.preference.SwitchPreference import org.mozilla.fenix.BrowserDirection +import org.mozilla.fenix.FeatureFlags import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.R import org.mozilla.fenix.ext.components @@ -87,6 +88,7 @@ class TrackingProtectionFragment : PreferenceFragmentCompat() { private fun bindStrict() { val keyStrict = getString(R.string.pref_key_tracking_protection_strict) radioStrict = requireNotNull(findPreference(keyStrict)) + radioStrict.isVisible = FeatureFlags.etpCategories radioStrict.onInfoClickListener { nav( R.id.trackingProtectionFragment, @@ -102,6 +104,7 @@ class TrackingProtectionFragment : PreferenceFragmentCompat() { private fun bindRecommended() { val keyStandard = getString(R.string.pref_key_tracking_protection_standard) radioStandard = requireNotNull(findPreference(keyStandard)) + radioStandard.isVisible = FeatureFlags.etpCategories radioStandard.onInfoClickListener { nav( R.id.trackingProtectionFragment, diff --git a/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/app/src/main/java/org/mozilla/fenix/utils/Settings.kt index fb0fc3f20e..2ab0d117ed 100644 --- a/app/src/main/java/org/mozilla/fenix/utils/Settings.kt +++ b/app/src/main/java/org/mozilla/fenix/utils/Settings.kt @@ -165,7 +165,7 @@ class Settings private constructor( val useStrictTrackingProtection by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_tracking_protection_strict), - false + true ) val themeSettingString: String diff --git a/app/src/main/res/xml/tracking_protection_preferences.xml b/app/src/main/res/xml/tracking_protection_preferences.xml index b3ca838995..cdbb0add0c 100644 --- a/app/src/main/res/xml/tracking_protection_preferences.xml +++ b/app/src/main/res/xml/tracking_protection_preferences.xml @@ -5,31 +5,33 @@ + android:title="@string/preference_enhanced_tracking_protection_explanation_title" + app:allowDividerBelow="false" /> + android:title="@string/preference_enhanced_tracking_protection_standard" + app:isPreferenceVisible="false" /> + android:title="@string/preference_enhanced_tracking_protection_strict" + app:isPreferenceVisible="false" /> + android:title="@string/preferences_tracking_protection_exceptions" + app:allowDividerAbove="true" /> diff --git a/app/src/test/java/org/mozilla/fenix/utils/SettingsTest.kt b/app/src/test/java/org/mozilla/fenix/utils/SettingsTest.kt index df17012c7a..cdaeeead7b 100644 --- a/app/src/test/java/org/mozilla/fenix/utils/SettingsTest.kt +++ b/app/src/test/java/org/mozilla/fenix/utils/SettingsTest.kt @@ -229,6 +229,13 @@ class SettingsTest { assertFalse(settings.shouldUseTrackingProtection) } + @Test + fun shouldUseTrackingProtectionStrict() { + // When + // Then + assertTrue(settings.useStrictTrackingProtection) + } + @Test fun shouldUseAutoBatteryTheme() { // When just created