mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-03 23:15:31 +00:00
For #5312 - Send ETP Strict/Standard event
This commit is contained in:
parent
24b3ed4384
commit
44bb592b43
@ -97,6 +97,7 @@ open class RadioButtonPreference @JvmOverloads constructor(
|
||||
radioButton?.isChecked = isChecked
|
||||
context.settings().preferences.edit().putBoolean(key, isChecked)
|
||||
.apply()
|
||||
onPreferenceChangeListener.onPreferenceChange(this, isChecked)
|
||||
}
|
||||
|
||||
private fun bindRadioButton(holder: PreferenceViewHolder) {
|
||||
|
@ -90,15 +90,17 @@ class TrackingProtectionFragment : PreferenceFragmentCompat() {
|
||||
private fun bindStrict() {
|
||||
val keyStrict = getString(R.string.pref_key_tracking_protection_strict)
|
||||
radioStrict = requireNotNull(findPreference(keyStrict))
|
||||
radioStrict.onPreferenceChangeListener = SharedPreferenceUpdater()
|
||||
radioStrict.isVisible = FeatureFlags.etpCategories
|
||||
radioStrict.onPreferenceChangeListener = object : SharedPreferenceUpdater() {
|
||||
override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
|
||||
context?.metrics?.track(
|
||||
Event.TrackingProtectionSettingChanged(
|
||||
Event.TrackingProtectionSettingChanged.Setting.STRICT
|
||||
if (newValue == true) {
|
||||
updateTrackingProtectionPolicy()
|
||||
context?.metrics?.track(
|
||||
Event.TrackingProtectionSettingChanged(
|
||||
Event.TrackingProtectionSettingChanged.Setting.STRICT
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
return super.onPreferenceChange(preference, newValue)
|
||||
}
|
||||
}
|
||||
@ -109,9 +111,6 @@ class TrackingProtectionFragment : PreferenceFragmentCompat() {
|
||||
.actionTrackingProtectionFragmentToTrackingProtectionBlockingFragment(true)
|
||||
)
|
||||
}
|
||||
radioStrict.onClickListener {
|
||||
updateTrackingProtectionPolicy()
|
||||
}
|
||||
}
|
||||
|
||||
private fun bindStandard() {
|
||||
@ -120,11 +119,14 @@ class TrackingProtectionFragment : PreferenceFragmentCompat() {
|
||||
radioStandard.isVisible = FeatureFlags.etpCategories
|
||||
radioStandard.onPreferenceChangeListener = object : SharedPreferenceUpdater() {
|
||||
override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
|
||||
context?.metrics?.track(
|
||||
Event.TrackingProtectionSettingChanged(
|
||||
Event.TrackingProtectionSettingChanged.Setting.STANDARD
|
||||
if (newValue == true) {
|
||||
updateTrackingProtectionPolicy()
|
||||
context?.metrics?.track(
|
||||
Event.TrackingProtectionSettingChanged(
|
||||
Event.TrackingProtectionSettingChanged.Setting.STANDARD
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
return super.onPreferenceChange(preference, newValue)
|
||||
}
|
||||
}
|
||||
@ -135,9 +137,6 @@ class TrackingProtectionFragment : PreferenceFragmentCompat() {
|
||||
.actionTrackingProtectionFragmentToTrackingProtectionBlockingFragment(false)
|
||||
)
|
||||
}
|
||||
radioStandard.onClickListener {
|
||||
updateTrackingProtectionPolicy()
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateTrackingProtectionPolicy() {
|
||||
|
Loading…
Reference in New Issue
Block a user