1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 package org.mozilla.fenix
7 import android.content.Context
8 import mozilla.components.support.locale.LocaleManager
9 import mozilla.components.support.locale.LocaleManager.getSystemDefault
12 * A single source for setting feature flags that are mostly based on build type.
16 * Pull-to-refresh allows you to pull the web content down far enough to have the page to
19 val pullToRefreshEnabled = Config.channel.isNightlyOrDebug
22 * Enables the Addresses autofill feature.
24 val addressesFeature = Config.channel.isNightlyOrDebug
27 * Enables the "recent" tabs feature in the home screen.
29 const val showRecentTabsFeature = true
32 * Enables UI features based on history metadata.
34 const val historyMetadataUIFeature = true
37 * Enables the recently saved bookmarks feature in the home screen.
39 const val recentBookmarksFeature = true
42 * Identifies and separates the tabs list with a secondary section containing least used tabs.
44 const val inactiveTabs = true
47 * Identifies and separates the tabs list with a group containing search term tabs.
49 val tabGroupFeature = Config.channel.isNightlyOrDebug
52 * Allows tabs to be dragged around as long as tab groups are disabled
54 val tabReorderingFeature = Config.channel.isNightlyOrDebug
57 * Show Pocket recommended stories on home.
59 fun isPocketRecommendationsFeatureEnabled(context: Context): Boolean {
60 val langTag = LocaleManager.getCurrentLocale(context)
61 ?.toLanguageTag() ?: getSystemDefault().toLanguageTag()
62 return listOf("en-US", "en-CA").contains(langTag)
66 * Enables showing the homescreen onboarding card.
68 const val showHomeOnboarding = false
71 * Enables showing the option to clear site data.
73 const val showClearSiteData = true
76 * Enables history improvement features.
78 const val historyImprovementFeatures = true
81 * Separates history into local and synced from other sources.
83 val showSyncedHistory = Config.channel.isDebug
86 * Enables the Task Continuity enhancements.
88 val taskContinuityFeature = Config.channel.isDebug
91 * Enables the Unified Search feature.
93 val unifiedSearchFeature = Config.channel.isNightlyOrDebug
96 * Enables receiving from the messaging framework.
98 val messagingFeature = Config.channel.isNightlyOrDebug