[fenix] For https://github.com/mozilla-mobile/fenix/issues/25115 - Remove showWallpap...
[gecko.git] / mobile / android / fenix / app / src / main / java / org / mozilla / fenix / FeatureFlags.kt
blob701364229797e0169c1eb83546c0c57dc881acec
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
11 /**
12  * A single source for setting feature flags that are mostly based on build type.
13  */
14 object FeatureFlags {
15     /**
16      * Pull-to-refresh allows you to pull the web content down far enough to have the page to
17      * reload.
18      */
19     val pullToRefreshEnabled = Config.channel.isNightlyOrDebug
21     /**
22      * Enables the Addresses autofill feature.
23      */
24     val addressesFeature = Config.channel.isNightlyOrDebug
26     /**
27      * Enables the "recent" tabs feature in the home screen.
28      */
29     const val showRecentTabsFeature = true
31     /**
32      * Enables UI features based on history metadata.
33      */
34     const val historyMetadataUIFeature = true
36     /**
37      * Enables the recently saved bookmarks feature in the home screen.
38      */
39     const val recentBookmarksFeature = true
41     /**
42      * Identifies and separates the tabs list with a secondary section containing least used tabs.
43      */
44     const val inactiveTabs = true
46     /**
47      * Identifies and separates the tabs list with a group containing search term tabs.
48      */
49     val tabGroupFeature = Config.channel.isNightlyOrDebug
51     /**
52      * Allows tabs to be dragged around as long as tab groups are disabled
53      */
54     val tabReorderingFeature = Config.channel.isNightlyOrDebug
56     /**
57      * Show Pocket recommended stories on home.
58      */
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)
63     }
65     /**
66      * Enables showing the homescreen onboarding card.
67      */
68     const val showHomeOnboarding = false
70     /**
71      * Enables showing the option to clear site data.
72      */
73     const val showClearSiteData = true
75     /**
76      * Enables history improvement features.
77      */
78     const val historyImprovementFeatures = true
80     /**
81      * Separates history into local and synced from other sources.
82      */
83     val showSyncedHistory = Config.channel.isDebug
85     /**
86      * Enables the Task Continuity enhancements.
87      */
88     val taskContinuityFeature = Config.channel.isDebug
90     /**
91      * Enables the Unified Search feature.
92      */
93     val unifiedSearchFeature = Config.channel.isNightlyOrDebug
95     /**
96      * Enables receiving from the messaging framework.
97      */
98     val messagingFeature = Config.channel.isNightlyOrDebug