From 434087f0b6898bd07bdb83cecbd95c22b8f4ef55 Mon Sep 17 00:00:00 2001 From: celenity Date: Tue, 27 May 2025 17:41:01 -0400 Subject: [PATCH] feat: Update `disable-nimbus.patch` (+ disable fetching Mozilla's remote search configuration) Signed-off-by: celenity --- patches/disable-nimbus.patch | 83 ++++++++++++++++++++++-------------- 1 file changed, 51 insertions(+), 32 deletions(-) diff --git a/patches/disable-nimbus.patch b/patches/disable-nimbus.patch index 8dc3a04e..0761e574 100644 --- a/patches/disable-nimbus.patch +++ b/patches/disable-nimbus.patch @@ -1,8 +1,8 @@ diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt -index 71624f614a..793f0a76e0 100644 +index 299d0c8ca1..2ade1e3835 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt -@@ -54,7 +54,6 @@ import org.mozilla.fenix.ext.requireComponents +@@ -55,7 +55,6 @@ import org.mozilla.fenix.ext.requireComponents import org.mozilla.fenix.ext.runIfFragmentIsAttached import org.mozilla.fenix.ext.settings import org.mozilla.fenix.home.HomeFragment @@ -10,7 +10,7 @@ index 71624f614a..793f0a76e0 100644 import org.mozilla.fenix.settings.quicksettings.protections.cookiebanners.getCookieBannerUIMode import org.mozilla.fenix.shortcut.PwaOnboardingObserver import org.mozilla.fenix.theme.ThemeManager -@@ -169,12 +168,6 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler { +@@ -175,11 +174,6 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler { } private fun initTranslationsAction(context: Context, view: View) { @@ -19,11 +19,10 @@ index 71624f614a..793f0a76e0 100644 - ) { - return - } -- + val translationsAction = Toolbar.ActionButton( AppCompatResources.getDrawable( - context, -@@ -663,7 +656,6 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler { +@@ -679,7 +673,6 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler { override fun navToQuickSettingsSheet(tab: SessionState, sitePermissions: SitePermissions?) { val useCase = requireComponents.useCases.trackingProtectionUseCases @@ -32,10 +31,10 @@ index 71624f614a..793f0a76e0 100644 lifecycleScope.launch { val cookieBannersStorage = requireComponents.core.cookieBannersStorage diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/MenuDialogFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/MenuDialogFragment.kt -index 514f270d17..ce0dbc8d11 100644 +index 965c09e29b..0313634f86 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/MenuDialogFragment.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/MenuDialogFragment.kt -@@ -75,7 +75,6 @@ import org.mozilla.fenix.components.menu.store.MenuStore +@@ -76,7 +76,6 @@ import org.mozilla.fenix.components.menu.store.MenuStore import org.mozilla.fenix.components.menu.store.WebExtensionMenuItem import org.mozilla.fenix.ext.runIfFragmentIsAttached import org.mozilla.fenix.ext.settings @@ -43,7 +42,7 @@ index 514f270d17..ce0dbc8d11 100644 import org.mozilla.fenix.settings.SupportUtils import org.mozilla.fenix.settings.deletebrowsingdata.deleteAndQuit import org.mozilla.fenix.theme.FirefoxTheme -@@ -301,8 +300,7 @@ class MenuDialogFragment : BottomSheetDialogFragment() { +@@ -305,8 +304,7 @@ class MenuDialogFragment : BottomSheetDialogFragment() { val isTranslationEngineSupported = browserStore.state.translationEngine.isEngineSupported ?: false val isTranslationSupported = @@ -54,7 +53,7 @@ index 514f270d17..ce0dbc8d11 100644 val isWebCompatEnabled by store.observeAsState(store.state.isWebCompatEnabled) { it.isWebCompatEnabled diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt -index 92c7c8b36c..ab22458d0e 100644 +index 6fb2b9ef98..ab22458d0e 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt @@ -42,7 +42,6 @@ import org.mozilla.fenix.R @@ -73,13 +72,9 @@ index 92c7c8b36c..ab22458d0e 100644 WebExtensionBrowserMenuBuilder( items = coreMenuItems, endOfMenuAlwaysVisible = shouldUseBottomToolbar, -@@ -203,12 +201,8 @@ open class DefaultToolbarMenu( - @VisibleForTesting(otherwise = PRIVATE) +@@ -204,8 +202,7 @@ open class DefaultToolbarMenu( fun shouldShowTranslations(): Boolean { val isEngineSupported = store.state.translationEngine.isEngineSupported -- if (isEngineSupported == true) { -- FxNimbus.features.translations.recordExposure() -- } return selectedSession?.let { - isEngineSupported == true && - FxNimbus.features.translations.value().mainFlowBrowserMenuEnabled @@ -87,7 +82,7 @@ index 92c7c8b36c..ab22458d0e 100644 } ?: false } -@@ -457,7 +451,7 @@ open class DefaultToolbarMenu( +@@ -454,7 +451,7 @@ open class DefaultToolbarMenu( addAppToHomeScreenItem.apply { visible = ::canAddAppToHomescreen }, if (shouldShowTopSites) addRemoveTopSitesItem else null, saveToCollectionItem, @@ -109,10 +104,10 @@ index a6f3b77a47..b2ce30c78f 100644 } diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt -index aafe4dbe47..42a7c6c8ab 100644 +index b74145eb21..b22bf9f2d0 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt -@@ -56,8 +56,8 @@ class SecretSettingsFragment : PreferenceFragmentCompat() { +@@ -57,8 +57,8 @@ class SecretSettingsFragment : PreferenceFragmentCompat() { } requirePreference(R.string.pref_key_nimbus_use_preview).apply { @@ -124,7 +119,7 @@ index aafe4dbe47..42a7c6c8ab 100644 } diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt -index ad6678f234..cb15e071ac 100644 +index 64492271c3..0d070de84d 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt @@ -65,7 +65,6 @@ import org.mozilla.fenix.ext.openSetDefaultBrowserOption @@ -135,7 +130,7 @@ index ad6678f234..cb15e071ac 100644 import org.mozilla.fenix.perf.ProfilerViewModel import org.mozilla.fenix.settings.account.AccountUiView import org.mozilla.fenix.snackbar.FenixSnackbarDelegate -@@ -177,8 +176,7 @@ class SettingsFragment : PreferenceFragmentCompat() { +@@ -176,8 +175,7 @@ class SettingsFragment : PreferenceFragmentCompat() { findPreference( getPreferenceKey(R.string.pref_key_translation), @@ -159,7 +154,7 @@ index ad6678f234..cb15e071ac 100644 showToolbar("$title$suffix") -@@ -761,7 +756,6 @@ class SettingsFragment : PreferenceFragmentCompat() { +@@ -713,7 +708,6 @@ class SettingsFragment : PreferenceFragmentCompat() { @VisibleForTesting internal fun setupCookieBannerPreference() { @@ -193,7 +188,7 @@ index 1a02f82498..b7658c03e3 100644 state.selectedTab?.translationsState?.settingsError }.value, diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/translations/TranslationsDialogFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/translations/TranslationsDialogFragment.kt -index e8fd12e0cc..fce9fc3bdf 100644 +index 472e3bf5a8..9cf2df1b14 100644 --- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/translations/TranslationsDialogFragment.kt +++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/translations/TranslationsDialogFragment.kt @@ -44,7 +44,6 @@ import org.mozilla.fenix.ext.components @@ -204,7 +199,7 @@ index e8fd12e0cc..fce9fc3bdf 100644 import org.mozilla.fenix.settings.SupportUtils import org.mozilla.fenix.theme.FirefoxTheme import org.mozilla.fenix.translations.preferences.downloadlanguages.DownloadLanguageFileDialog -@@ -174,7 +173,7 @@ class TranslationsDialogFragment : BottomSheetDialogFragment() { +@@ -176,7 +175,7 @@ class TranslationsDialogFragment : BottomSheetDialogFragment() { translationsDialogState?.let { TranslationsDialogContent( learnMoreUrl = learnMoreUrl, @@ -213,7 +208,7 @@ index e8fd12e0cc..fce9fc3bdf 100644 translationsDialogState = it, onSettingClicked = { Translations.action.record( -@@ -200,7 +199,7 @@ class TranslationsDialogFragment : BottomSheetDialogFragment() { +@@ -202,7 +201,7 @@ class TranslationsDialogFragment : BottomSheetDialogFragment() { ) { TranslationsOptionsDialogContent( learnMoreUrl = learnMoreUrl, @@ -223,7 +218,7 @@ index e8fd12e0cc..fce9fc3bdf 100644 initialFrom = translationsDialogState?.initialFrom, onBackClicked = { translationsVisibility = true }, 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 -index 86d2ecf1dc..c6572f40e0 100644 +index 72493a2c21..123778443b 100644 --- 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 @@ -189,10 +189,9 @@ class Settings(private val appContext: Context) : PreferencesHolder { @@ -264,7 +259,7 @@ index 86d2ecf1dc..c6572f40e0 100644 ) var openLinksInAPrivateTab by booleanPreference( -@@ -541,10 +536,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { +@@ -546,10 +541,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { default = false, ) @@ -276,7 +271,7 @@ index 86d2ecf1dc..c6572f40e0 100644 var isFirstNimbusRun: Boolean by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_is_first_run), -@@ -1181,7 +1173,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { +@@ -1186,7 +1178,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { @VisibleForTesting internal var recentSearchSuggestionsEnabled by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_show_recent_search_suggestions), @@ -341,7 +336,19 @@ index 86d2ecf1dc..c6572f40e0 100644 true } else { false -@@ -2057,10 +2044,9 @@ class Settings(private val appContext: Context) : PreferencesHolder { +@@ -1918,10 +1905,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { + /** + * Indicates whether or not to use remote server search configuration. + */ +- var useRemoteSearchConfiguration by booleanPreference( +- key = appContext.getPreferenceKey(R.string.pref_key_use_remote_search_configuration), +- default = FxNimbus.features.remoteSearchConfiguration.value().enabled, +- ) ++ var useRemoteSearchConfiguration = false + + /** + * Indicates if the menu CFR should be displayed to the user. +@@ -2071,10 +2055,9 @@ class Settings(private val appContext: Context) : PreferencesHolder { /** * Indicates if Recent Search Suggestions are enabled. */ @@ -354,7 +361,7 @@ index 86d2ecf1dc..c6572f40e0 100644 ) /** -@@ -2171,8 +2157,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { +@@ -2185,8 +2168,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { /** * Indicates if the feature to close synced tabs is enabled. */ @@ -364,7 +371,7 @@ index 86d2ecf1dc..c6572f40e0 100644 /** * Returns the height of the bottom toolbar. -@@ -2372,10 +2357,9 @@ class Settings(private val appContext: Context) : PreferencesHolder { +@@ -2386,10 +2368,9 @@ class Settings(private val appContext: Context) : PreferencesHolder { /** * Indicates whether or not we should use the new bookmarks UI. */ @@ -377,11 +384,23 @@ index 86d2ecf1dc..c6572f40e0 100644 ) var bookmarkListSortOrder by stringPreference( +@@ -2516,9 +2497,8 @@ class Settings(private val appContext: Context) : PreferencesHolder { + /** + * Indicates whether or not to show the checklist feature. + */ +- var showSetupChecklist by lazyFeatureFlagPreference( ++ var showSetupChecklist by booleanPreference( + key = appContext.getPreferenceKey(R.string.pref_key_setup_checklist_complete), +- default = { FxNimbus.features.setupChecklist.value().enabled }, +- featureFlag = true, ++ default = true, + ) + } diff --git a/mobile/android/fenix/app/src/main/res/xml/preferences.xml b/mobile/android/fenix/app/src/main/res/xml/preferences.xml -index 3b85a2a548..43b833bca8 100644 +index 4c6b14bf87..08eda05d0c 100644 --- a/mobile/android/fenix/app/src/main/res/xml/preferences.xml +++ b/mobile/android/fenix/app/src/main/res/xml/preferences.xml -@@ -232,11 +232,6 @@ +@@ -227,11 +227,6 @@ app:iconSpaceReserved="false" android:title="@string/preferences_debug_info" app:isPreferenceVisible="false" />