[tbb-commits] [Git][tpo/applications/firefox-android][firefox-android-115.2.1-13.5-1] fixup! Add Tor integration and UI
Dan Ballard (@dan)
git at gitlab.torproject.org
Wed May 15 19:05:18 UTC 2024
Dan Ballard pushed to branch firefox-android-115.2.1-13.5-1 at The Tor Project / Applications / firefox-android
Commits:
110d8f18 by clairehurst at 2024-05-15T19:04:04+00:00
fixup! Add Tor integration and UI
- - - - -
4 changed files:
- fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
- fenix/app/src/main/java/org/mozilla/fenix/settings/TorSecurityLevelFragment.kt
- fenix/app/src/main/res/navigation/nav_graph.xml
- fenix/app/src/main/res/xml/preferences.xml
Changes:
=====================================
fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
=====================================
@@ -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 =
=====================================
fenix/app/src/main/java/org/mozilla/fenix/settings/TorSecurityLevelFragment.kt
=====================================
@@ -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)
=====================================
fenix/app/src/main/res/navigation/nav_graph.xml
=====================================
@@ -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"
=====================================
fenix/app/src/main/res/xml/preferences.xml
=====================================
@@ -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"
View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/110d8f1868b14b009d69b1a4e76fd6a69b21e866
--
This project does not include diff previews in email notifications.
View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/110d8f1868b14b009d69b1a4e76fd6a69b21e866
You're receiving this email because of your account on gitlab.torproject.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20240515/78f57d52/attachment-0001.htm>
More information about the tbb-commits
mailing list