Files
IronFox/patches/disable-nimbus.patch

415 lines
21 KiB
Diff

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 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
@@ -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
-import org.mozilla.fenix.nimbus.FxNimbus
import org.mozilla.fenix.settings.quicksettings.protections.cookiebanners.getCookieBannerUIMode
import org.mozilla.fenix.shortcut.PwaOnboardingObserver
import org.mozilla.fenix.theme.ThemeManager
@@ -175,11 +174,6 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
}
private fun initTranslationsAction(context: Context, view: View) {
- if (
- !FxNimbus.features.translations.value().mainFlowToolbarEnabled
- ) {
- return
- }
val translationsAction = Toolbar.ActionButton(
AppCompatResources.getDrawable(
@@ -679,7 +673,6 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
override fun navToQuickSettingsSheet(tab: SessionState, sitePermissions: SitePermissions?) {
val useCase = requireComponents.useCases.trackingProtectionUseCases
- FxNimbus.features.cookieBanners.recordExposure()
useCase.containsException(tab.id) { hasTrackingProtectionException ->
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 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
@@ -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
-import org.mozilla.fenix.nimbus.FxNimbus
import org.mozilla.fenix.settings.SupportUtils
import org.mozilla.fenix.settings.deletebrowsingdata.deleteAndQuit
import org.mozilla.fenix.theme.FirefoxTheme
@@ -305,8 +304,7 @@ class MenuDialogFragment : BottomSheetDialogFragment() {
val isTranslationEngineSupported =
browserStore.state.translationEngine.isEngineSupported ?: false
val isTranslationSupported =
- isTranslationEngineSupported &&
- FxNimbus.features.translations.value().mainFlowBrowserMenuEnabled
+ isTranslationEngineSupported
val isPdf = selectedTab?.content?.isPdf ?: false
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 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
import org.mozilla.fenix.components.accounts.FenixAccountManager
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.settings
-import org.mozilla.fenix.nimbus.FxNimbus
import org.mozilla.fenix.theme.ThemeManager
/**
@@ -82,7 +81,6 @@ open class DefaultToolbarMenu(
get() = store.state.selectedTab
override val menuBuilder by lazy {
- FxNimbus.features.print.recordExposure()
WebExtensionBrowserMenuBuilder(
items = coreMenuItems,
endOfMenuAlwaysVisible = shouldUseBottomToolbar,
@@ -204,8 +202,7 @@ open class DefaultToolbarMenu(
fun shouldShowTranslations(): Boolean {
val isEngineSupported = store.state.translationEngine.isEngineSupported
return selectedSession?.let {
- isEngineSupported == true &&
- FxNimbus.features.translations.value().mainFlowBrowserMenuEnabled
+ isEngineSupported == true
} ?: false
}
@@ -454,7 +451,7 @@ open class DefaultToolbarMenu(
addAppToHomeScreenItem.apply { visible = ::canAddAppToHomescreen },
if (shouldShowTopSites) addRemoveTopSitesItem else null,
saveToCollectionItem,
- if (FxNimbus.features.print.value().browserPrintEnabled) printPageItem else null,
+ printPageItem,
BrowserMenuDivider(),
settingsItem,
if (shouldDeleteDataOnQuit) deleteDataOnQuit else null,
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/onboarding/FenixOnboarding.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/onboarding/FenixOnboarding.kt
index a6f3b77a47..b2ce30c78f 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/onboarding/FenixOnboarding.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/onboarding/FenixOnboarding.kt
@@ -33,7 +33,6 @@ class FenixOnboarding(context: Context) : PreferencesHolder {
// - We would like to evaluate the configuration only once (and thus it's kept in memory
// and not re-evaluated)
val config by lazy {
- FxNimbus.features.onboarding.recordExposure()
FxNimbus.features.onboarding.value()
}
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 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
@@ -57,8 +57,8 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<SwitchPreference>(R.string.pref_key_nimbus_use_preview).apply {
- isVisible = true
- isChecked = context.settings().nimbusUsePreview
+ isVisible = false
+ isChecked = false
onPreferenceChangeListener = SharedPreferenceUpdater()
}
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 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
import org.mozilla.fenix.ext.requireComponents
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.ext.showToolbar
-import org.mozilla.fenix.nimbus.FxNimbus
import org.mozilla.fenix.perf.ProfilerViewModel
import org.mozilla.fenix.settings.account.AccountUiView
import org.mozilla.fenix.snackbar.FenixSnackbarDelegate
@@ -176,8 +175,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
findPreference<Preference>(
getPreferenceKey(R.string.pref_key_translation),
- )?.isVisible = FxNimbus.features.translations.value().globalSettingsEnabled &&
- requireContext().components.core.store.state.translationEngine.isEngineSupported == true
+ )?.isVisible = requireContext().components.core.store.state.translationEngine.isEngineSupported == true
}
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
@@ -206,11 +204,8 @@ class SettingsFragment : PreferenceFragmentCompat() {
override fun onResume() {
super.onResume()
- // Use nimbus to set the title, and a trivial addition
- val nimbusValidation = FxNimbus.features.nimbusValidation.value()
-
- val title = nimbusValidation.settingsTitle
- val suffix = nimbusValidation.settingsPunctuation
+ val title = getString(R.string.settings_title)
+ val suffix = ""
showToolbar("$title$suffix")
@@ -713,7 +708,6 @@ class SettingsFragment : PreferenceFragmentCompat() {
@VisibleForTesting
internal fun setupCookieBannerPreference() {
- FxNimbus.features.cookieBanners.recordExposure()
if (context?.settings()?.shouldShowCookieBannerUI == false) return
with(requirePreference<SwitchPreference>(R.string.pref_key_cookie_banner_private_mode)) {
isVisible = context.settings().shouldShowCookieBannerUI
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/translations/TranslationSettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/translations/TranslationSettingsFragment.kt
index 1a02f82498..b7658c03e3 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/translations/TranslationSettingsFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/translations/TranslationSettingsFragment.kt
@@ -28,7 +28,6 @@ import org.mozilla.fenix.R
import org.mozilla.fenix.ext.requireComponents
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.ext.showToolbar
-import org.mozilla.fenix.nimbus.FxNimbus
import org.mozilla.fenix.theme.FirefoxTheme
/**
@@ -51,9 +50,9 @@ class TranslationSettingsFragment : Fragment(), UserInteractionHandler {
FirefoxTheme {
TranslationSettings(
translationSwitchList = getTranslationSwitchItemList(),
- showAutomaticTranslations = FxNimbus.features.translations.value().globalLangSettingsEnabled,
- showNeverTranslate = FxNimbus.features.translations.value().globalSiteSettingsEnabled,
- showDownloads = FxNimbus.features.translations.value().downloadsEnabled,
+ showAutomaticTranslations = true,
+ showNeverTranslate = true,
+ showDownloads = true,
pageSettingsError = browserStore.observeAsComposableState { state ->
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 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
import org.mozilla.fenix.ext.requireComponents
import org.mozilla.fenix.ext.runIfFragmentIsAttached
import org.mozilla.fenix.ext.settings
-import org.mozilla.fenix.nimbus.FxNimbus
import org.mozilla.fenix.settings.SupportUtils
import org.mozilla.fenix.theme.FirefoxTheme
import org.mozilla.fenix.translations.preferences.downloadlanguages.DownloadLanguageFileDialog
@@ -176,7 +175,7 @@ class TranslationsDialogFragment : BottomSheetDialogFragment() {
translationsDialogState?.let {
TranslationsDialogContent(
learnMoreUrl = learnMoreUrl,
- showPageSettings = FxNimbus.features.translations.value().pageSettingsEnabled,
+ showPageSettings = true,
translationsDialogState = it,
onSettingClicked = {
Translations.action.record(
@@ -202,7 +201,7 @@ class TranslationsDialogFragment : BottomSheetDialogFragment() {
) {
TranslationsOptionsDialogContent(
learnMoreUrl = learnMoreUrl,
- showGlobalSettings = FxNimbus.features.translations.value().globalSettingsEnabled,
+ showGlobalSettings = true,
isTranslated = translationsDialogState?.isTranslated == true,
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 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 {
/**
* Indicates whether or not top sites should be shown on the home screen.
*/
- var showTopSitesFeature by lazyFeatureFlagPreference(
+ var showTopSitesFeature by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_show_top_sites),
- featureFlag = true,
- default = { homescreenSections[HomeScreenSection.TOP_SITES] == true },
+ default = true,
)
var numberOfAppLaunches by intPreference(
@@ -238,10 +237,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
default = "",
)
- var nimbusExperimentsFetched by booleanPreference(
- appContext.getPreferenceKey(R.string.pref_key_nimbus_experiments_fetched),
- default = false,
- )
+ var nimbusExperimentsFetched = true
var utmParamsKnown by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_utm_params_known),
@@ -329,10 +325,9 @@ class Settings(private val appContext: Context) : PreferencesHolder {
/**
* Indicates if the wallpaper onboarding dialog should be shown.
*/
- var showWallpaperOnboarding by lazyFeatureFlagPreference(
+ var showWallpaperOnboarding by booleanPreference(
key = appContext.getPreferenceKey(R.string.pref_key_wallpapers_onboarding),
- featureFlag = true,
- default = { mr2022Sections[Mr2022Section.WALLPAPERS_SELECTION_TOOL] == true },
+ default = true,
)
var openLinksInAPrivateTab by booleanPreference(
@@ -546,10 +541,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
default = false,
)
- var nimbusUsePreview by booleanPreference(
- appContext.getPreferenceKey(R.string.pref_key_nimbus_use_preview),
- default = false,
- )
+ var nimbusUsePreview = false
var isFirstNimbusRun: Boolean by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_is_first_run),
@@ -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),
- default = true,
+ default = false,
)
/**
@@ -1667,10 +1659,9 @@ class Settings(private val appContext: Context) : PreferencesHolder {
get() =
FxNimbus.features.homescreen.value().sectionsEnabled
- var historyMetadataUIFeature by lazyFeatureFlagPreference(
+ var historyMetadataUIFeature by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_history_metadata_feature),
- default = { homescreenSections[HomeScreenSection.RECENT_EXPLORATIONS] == true },
- featureFlag = true,
+ default = true,
)
/**
@@ -1685,28 +1676,25 @@ class Settings(private val appContext: Context) : PreferencesHolder {
/**
* Indicates if home onboarding dialog should be shown.
*/
- var showHomeOnboardingDialog by lazyFeatureFlagPreference(
+ var showHomeOnboardingDialog by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_should_show_home_onboarding_dialog),
- featureFlag = true,
- default = { mr2022Sections[Mr2022Section.HOME_ONBOARDING_DIALOG_EXISTING_USERS] == true },
+ default = true,
)
/**
* Indicates if the recent tabs functionality should be visible.
*/
- var showRecentTabsFeature by lazyFeatureFlagPreference(
+ var showRecentTabsFeature by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_recent_tabs),
- featureFlag = true,
- default = { homescreenSections[HomeScreenSection.JUMP_BACK_IN] == true },
+ default = true,
)
/**
* Indicates if the recent saved bookmarks functionality should be visible.
*/
- var showBookmarksHomeFeature by lazyFeatureFlagPreference(
+ var showBookmarksHomeFeature by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_customization_bookmarks),
- default = { homescreenSections[HomeScreenSection.BOOKMARKS] == true },
- featureFlag = true,
+ default = true,
)
var signedInFxaAccount by booleanPreference(
@@ -1857,7 +1845,6 @@ class Settings(private val appContext: Context) : PreferencesHolder {
isLauncherIntent: Boolean,
): Boolean {
return if (featureEnabled && !hasUserBeenOnboarded && isLauncherIntent) {
- FxNimbus.features.junoOnboarding.recordExposure()
true
} else {
false
@@ -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.
*/
- var isRecentSearchesVisible by lazyFeatureFlagPreference(
+ var isRecentSearchesVisible by booleanPreference(
key = appContext.getPreferenceKey(R.string.pref_key_enable_recent_searches),
- default = { FxNimbus.features.recentSearches.value().enabled },
- featureFlag = true,
+ default = true,
)
/**
@@ -2185,8 +2168,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
/**
* Indicates if the feature to close synced tabs is enabled.
*/
- val enableCloseSyncedTabs: Boolean
- get() = FxNimbus.features.remoteTabManagement.value().closeTabsEnabled
+ val enableCloseSyncedTabs: Boolean = true
/**
* Returns the height of the bottom toolbar.
@@ -2386,10 +2368,9 @@ class Settings(private val appContext: Context) : PreferencesHolder {
/**
* Indicates whether or not we should use the new bookmarks UI.
*/
- var useNewBookmarks by lazyFeatureFlagPreference(
+ var useNewBookmarks by booleanPreference(
key = appContext.getPreferenceKey(R.string.pref_key_use_new_bookmarks_ui),
- default = { true },
- featureFlag = true,
+ default = true,
)
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 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
@@ -227,11 +227,6 @@
app:iconSpaceReserved="false"
android:title="@string/preferences_debug_info"
app:isPreferenceVisible="false" />
- <androidx.preference.Preference
- android:key="@string/pref_key_nimbus_experiments"
- app:iconSpaceReserved="false"
- android:title="@string/preferences_nimbus_experiments"
- app:isPreferenceVisible="false" />
<androidx.preference.Preference
android:key="@string/pref_key_start_profiler"
app:iconSpaceReserved="false"