2019-07-19 00:20:12 +00:00
|
|
|
package org.mozilla.fenix
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A single source for setting feature flags that are mostly based on build type.
|
|
|
|
*/
|
|
|
|
object FeatureFlags {
|
2019-09-17 20:41:41 +00:00
|
|
|
// lazy is used to suppress "Condition is always 'true'" warnings when using the flags.
|
|
|
|
// https://github.com/mozilla-mobile/fenix/pull/4077#issuecomment-511964072
|
|
|
|
|
2019-07-19 00:20:12 +00:00
|
|
|
// A convenience flag for production builds.
|
2019-08-22 08:42:29 +00:00
|
|
|
private val production by lazy { BuildConfig.BUILD_TYPE == "fenixProduction" }
|
2019-07-19 00:20:12 +00:00
|
|
|
// A convenience flag for beta builds.
|
2019-08-22 08:42:29 +00:00
|
|
|
private val beta by lazy { BuildConfig.BUILD_TYPE == "fenixBeta" }
|
2019-07-19 00:20:12 +00:00
|
|
|
// A convenience flag for the nightly build and (legacy) nightly channel in Google Play.
|
2019-08-22 08:42:29 +00:00
|
|
|
private val nightly by lazy {
|
|
|
|
BuildConfig.BUILD_TYPE == "fenixNightly" || BuildConfig.BUILD_TYPE == "fenixNightlyLegacy"
|
|
|
|
}
|
2019-07-19 00:20:12 +00:00
|
|
|
// A convenience flag for debug builds.
|
|
|
|
private val debug by lazy { BuildConfig.BUILD_TYPE == "debug" }
|
2019-07-31 01:22:44 +00:00
|
|
|
// A convenience flag for enabling in all builds (a feature that can still be toggled off).
|
|
|
|
private val all = production or beta or nightly or debug
|
2019-07-19 00:20:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Pull-to-refresh allows you to pull the web content down far enough to have the page to
|
|
|
|
* reload.
|
|
|
|
*/
|
|
|
|
const val pullToRefreshEnabled = false
|
2019-08-13 20:02:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Integration of media features provided by `feature-media` component:
|
|
|
|
* - Background playback without the app getting killed
|
|
|
|
* - Media notification with play/pause controls
|
|
|
|
* - Audio Focus handling (pausing/resuming in agreement with other media apps)
|
|
|
|
* - Support for hardware controls to toggle play/pause (e.g. buttons on a headset)
|
|
|
|
*
|
|
|
|
* Behind nightly flag until all related Android Components issues are fixed and QA has signed
|
|
|
|
* off.
|
|
|
|
*
|
|
|
|
* https://github.com/mozilla-mobile/fenix/issues/4431
|
|
|
|
*/
|
2019-08-27 19:51:27 +00:00
|
|
|
const val mediaIntegration = true
|
2019-09-04 20:27:30 +00:00
|
|
|
|
2019-09-10 20:29:21 +00:00
|
|
|
/**
|
|
|
|
* Displays the categories blocked by ETP in a panel in the toolbar
|
|
|
|
*/
|
|
|
|
val etpCategories = nightly or debug
|
|
|
|
|
2019-09-04 20:27:30 +00:00
|
|
|
/**
|
|
|
|
* Granular data deletion provides additional choices on the Delete Browsing Data
|
|
|
|
* setting screen for cookies, cached images and files, and site permissions.
|
|
|
|
*/
|
|
|
|
val granularDataDeletion = nightly or debug
|
2019-09-10 20:29:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gives option in Settings to Delete Browsing Data on new menu option Quit
|
|
|
|
*/
|
|
|
|
val deleteDataOnQuit = nightly or debug
|
2019-07-19 00:20:12 +00:00
|
|
|
}
|