Skip to content
Snippets Groups Projects
Commit 110d8f18 authored by clairehurst's avatar clairehurst Committed by Dan Ballard
Browse files

fixup! Add Tor integration and UI

parent 6eaa81ce
Branches
Tags firefox-android-115.2.1-13.5-1-build10
1 merge request!106Bug_42317: Update "Security Settings" menu item
......@@ -65,6 +65,7 @@ import org.mozilla.fenix.nimbus.FxNimbus
import org.mozilla.fenix.perf.ProfilerViewModel
import org.mozilla.fenix.settings.account.AccountUiView
import org.mozilla.fenix.tor.QuickStartPreference
import org.mozilla.fenix.tor.SecurityLevel
import org.mozilla.fenix.tor.TorBridgeTransportConfig
import org.mozilla.fenix.tor.TorEvents
import org.mozilla.fenix.utils.Settings
......@@ -537,6 +538,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
setupAmoCollectionOverridePreference(requireContext().settings())
setupGeckoLogsPreference(requireContext().settings())
setupAllowDomesticChinaFxaServerPreference()
setupSecurityLevelPreference()
setupHttpsOnlyPreferences()
setupNotificationPreference()
setupSearchPreference()
......@@ -772,6 +774,19 @@ class SettingsFragment : PreferenceFragmentCompat() {
}
}
@VisibleForTesting
internal fun setupSecurityLevelPreference() {
val securityLevelPreference =
requirePreference<Preference>(R.string.pref_key_tor_security_level_settings)
securityLevelPreference.summary = context?.settings()?.torSecurityLevel()?.let {
when (it) {
SecurityLevel.STANDARD -> getString(R.string.tor_security_level_standard_option)
SecurityLevel.SAFER -> getString(R.string.tor_security_level_safer_option)
SecurityLevel.SAFEST -> getString(R.string.tor_security_level_safest_option)
}
}
}
@VisibleForTesting
internal fun setupHttpsOnlyPreferences() {
val httpsOnlyPreference =
......
......@@ -24,11 +24,6 @@ class TorSecurityLevelFragment : PreferenceFragmentCompat() {
private val securityLevelRadioGroups = mutableListOf<GroupableRadioButton>()
private var previousSecurityLevel: SecurityLevel? = null
override fun onResume() {
super.onResume()
showToolbar(getString(R.string.preferences_tor_security_level_options))
}
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.tor_security_level_preferences, rootKey)
......
......@@ -956,7 +956,7 @@
<fragment
android:id="@+id/torSecurityLevelFragment"
android:name="org.mozilla.fenix.settings.TorSecurityLevelFragment"
android:label="@string/preferences_tor_security_level_settings" />
android:label="@string/preferences_tor_security_level_options" />
<fragment
android:id="@+id/privateBrowsingFragment"
android:name="org.mozilla.fenix.settings.PrivateBrowsingFragment"
......
......@@ -99,7 +99,7 @@
<androidx.preference.Preference
android:key="@string/pref_key_tor_security_level_settings"
app:iconSpaceReserved="false"
android:title="@string/preferences_tor_security_level_settings" />
android:title="@string/preferences_tor_security_level_options" />
<androidx.preference.Preference
android:key="@string/pref_key_private_browsing"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment