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.
17 * Enables custom extension collection feature,
18 * This feature does not only depend on this flag. It requires the AMO collection override to
19 * be enabled which is behind the Secret Settings.
21 val customExtensionCollectionFeature = Config.channel.isNightlyOrDebug || Config.channel.isBeta
24 * Pull-to-refresh allows you to pull the web content down far enough to have the page to
27 const val pullToRefreshEnabled = true
30 * Enables the Sync Addresses feature.
32 const val syncAddressesFeature = false
35 * Show Pocket recommended stories on home.
37 fun isPocketRecommendationsFeatureEnabled(context: Context): Boolean {
38 val langTag = LocaleManager.getCurrentLocale(context)
39 ?.toLanguageTag() ?: getSystemDefault().toLanguageTag()
40 return listOf("en-US", "en-CA").contains(langTag)
44 * Show Pocket sponsored stories in between Pocket recommended stories on home.
46 fun isPocketSponsoredStoriesFeatureEnabled(context: Context): Boolean {
47 return isPocketRecommendationsFeatureEnabled(context)
51 * Enables compose on the tabs tray items.
53 const val composeTabsTray = true
56 * Enables compose on the top sites.
58 const val composeTopSites = false
61 * Enables new search settings UI with two extra fragments, for managing the default engine
62 * and managing search shortcuts in the quick search menu.
64 const val unifiedSearchSettings = true
67 * Allows users to enable Firefox Suggest.
69 const val fxSuggest = true
72 * Allows users to enable SuggestStrongPassword feature.
74 const val suggestStrongPassword = true
77 * Enable Meta attribution.
79 const val metaAttributionEnabled = true
82 * Enables Navigation Toolbar.
84 val navigationToolbarEnabled = Config.channel.isNightlyOrDebug
87 * Enables the menu redesign.
89 const val menuRedesignEnabled = false
92 * Enables the Compose Homepage.
94 const val composeHomepage = false
97 * Enables Homepage as a New Tab.
99 const val homepageAsNewTab = false