tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 0bc96d4778b3b5382d0b41adf73a0602de5ec5a3
parent 0a8d00fb10816077063e6e3c53538337910baf33
Author: Beatriz Rizental <bea@torproject.org>
Date:   Mon, 16 Jun 2025 09:28:43 +0200

[android] Override settings

Diffstat:
Mmobile/android/fenix/app/nimbus.fml.yaml | 6+++---
Mmobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt | 33++++++++++++---------------------
Mmobile/android/fenix/app/src/main/res/xml/preferences.xml | 1+
3 files changed, 16 insertions(+), 24 deletions(-)

diff --git a/mobile/android/fenix/app/nimbus.fml.yaml b/mobile/android/fenix/app/nimbus.fml.yaml @@ -646,13 +646,13 @@ features: defaults: - channel: developer value: - enabled: true + enabled: false - channel: nightly value: - enabled: true + enabled: false - channel: beta value: - enabled: true + enabled: false search-suggestions-on-homepage: description: Enables search suggestions on homepage. diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt @@ -186,7 +186,7 @@ class Settings( */ var showBookmarksHomeFeature by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_customization_bookmarks), - default = { homescreenSections[HomeScreenSection.BOOKMARKS] == true }, + default = { true }, ) /** @@ -194,7 +194,7 @@ class Settings( */ var showRecentTabsFeature by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_recent_tabs), - default = { homescreenSections[HomeScreenSection.JUMP_BACK_IN] == true }, + default = { true }, ) /** @@ -203,7 +203,7 @@ class Settings( var showPocketRecommendationsFeature by lazyFeatureFlagBooleanPreference( appContext.getPreferenceKey(R.string.pref_key_pocket_homescreen_recommendations), featureFlag = ContentRecommendationsFeatureHelper.isContentRecommendationsFeatureEnabled(appContext), - defaultValue = { homescreenSections[HomeScreenSection.POCKET] == true }, + defaultValue = { false }, ) /** @@ -241,7 +241,7 @@ class Settings( */ val showPocketSponsoredStories by lazyFeatureFlagBooleanPreference( key = appContext.getPreferenceKey(R.string.pref_key_pocket_sponsored_stories), - defaultValue = { homescreenSections[HomeScreenSection.POCKET_SPONSORED_STORIES] == true }, + defaultValue = { false }, featureFlag = ContentRecommendationsFeatureHelper.isPocketSponsoredStoriesFeatureEnabled(appContext), ) @@ -250,7 +250,7 @@ class Settings( */ var historyMetadataUIFeature by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_history_metadata_feature), - default = { homescreenSections[HomeScreenSection.RECENT_EXPLORATIONS] == true }, + default = { true }, ) /** @@ -284,7 +284,7 @@ class Settings( */ var showTopSitesFeature by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_show_top_sites), - default = { homescreenSections[HomeScreenSection.TOP_SITES] == true }, + default = { false }, ) private val homescreenSections: Map<HomeScreenSection, Boolean> @@ -1003,7 +1003,7 @@ class Settings( var whatsappLinkSharingEnabled by booleanPreference( key = appContext.getPreferenceKey(R.string.pref_key_link_sharing), - default = { FxNimbus.features.sentFromFirefox.value().enabled }, + default = { false }, ) var linkSharingSettingsSnackbarShown by booleanPreference( @@ -1081,13 +1081,13 @@ class Settings( get() = false // cookieBannersSection[CookieBannersSection.FEATURE_UI] == 1 val shouldEnableCookieBannerDetectOnly: Boolean - get() = cookieBannersSection[CookieBannersSection.FEATURE_SETTING_DETECT_ONLY] == 1 + get() = false val shouldEnableCookieBannerGlobalRules: Boolean - get() = cookieBannersSection[CookieBannersSection.FEATURE_SETTING_GLOBAL_RULES] == 1 + get() = false val shouldEnableCookieBannerGlobalRulesSubFrame: Boolean - get() = cookieBannersSection[CookieBannersSection.FEATURE_SETTING_GLOBAL_RULES_SUB_FRAMES] == 1 + get() = false /** * Declared as a function for performance purposes. This could be declared as a variable using @@ -1144,8 +1144,7 @@ class Settings( * Indicates if the re-engagement notification feature is enabled */ val reEngagementNotificationType: Int - get() = - FxNimbus.features.reEngagementNotification.value().type + get() = 0 val shouldUseAutoBatteryTheme by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_auto_battery_theme), @@ -2155,15 +2154,7 @@ class Settings( hasUserBeenOnboarded: Boolean, isLauncherIntent: Boolean, ): Boolean { - val shouldShowByDefaultConditions = featureEnabled && !hasUserBeenOnboarded && isLauncherIntent - - val shouldShow = shouldShowByDefaultConditions || enablePersistentOnboarding - - if (shouldShow) { - FxNimbus.features.junoOnboarding.recordExposure() - } - - return shouldShow + return false } /** diff --git a/mobile/android/fenix/app/src/main/res/xml/preferences.xml b/mobile/android/fenix/app/src/main/res/xml/preferences.xml @@ -171,6 +171,7 @@ <androidx.preference.Preference android:key="@string/pref_key_link_sharing" app:iconSpaceReserved="false" + app:isPreferenceVisible="false" android:title="@string/preferences_link_sharing" /> <androidx.preference.Preference