|
|
|
@ -4,22 +4,6 @@ package org.mozilla.fenix
|
|
|
|
|
* A single source for setting feature flags that are mostly based on build type.
|
|
|
|
|
*/
|
|
|
|
|
object FeatureFlags {
|
|
|
|
|
// lazy is used to suppress "Condition is always 'true'" warnings when using the flags.
|
|
|
|
|
// https://github.com/mozilla-mobile/fenix/pull/4077#issuecomment-511964072
|
|
|
|
|
|
|
|
|
|
// A convenience flag for production builds.
|
|
|
|
|
private val production by lazy { BuildConfig.BUILD_TYPE == "fenixProduction" }
|
|
|
|
|
// A convenience flag for beta builds.
|
|
|
|
|
private val beta by lazy { BuildConfig.BUILD_TYPE == "fenixBeta" }
|
|
|
|
|
// A convenience flag for the nightly build in Google Play.
|
|
|
|
|
private val nightly by lazy {
|
|
|
|
|
BuildConfig.BUILD_TYPE == "fenixNightly"
|
|
|
|
|
}
|
|
|
|
|
// A convenience flag for debug builds.
|
|
|
|
|
private val debug by lazy { BuildConfig.BUILD_TYPE == "debug" }
|
|
|
|
|
// 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
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Pull-to-refresh allows you to pull the web content down far enough to have the page to
|
|
|
|
|
* reload.
|
|
|
|
@ -43,19 +27,19 @@ object FeatureFlags {
|
|
|
|
|
/**
|
|
|
|
|
* Displays the categories blocked by ETP in a panel in the toolbar
|
|
|
|
|
*/
|
|
|
|
|
val etpCategories = nightly or debug
|
|
|
|
|
val etpCategories = Config.channel.isNightlyOrDebug
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gives option in Settings to disable auto play media
|
|
|
|
|
*/
|
|
|
|
|
val autoPlayMedia = nightly or debug
|
|
|
|
|
val autoPlayMedia = Config.channel.isNightlyOrDebug
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Allows Progressive Web Apps to be installed to the device home screen.
|
|
|
|
|
*/
|
|
|
|
|
val progressiveWebApps = nightly or debug
|
|
|
|
|
val progressiveWebApps = Config.channel.isNightlyOrDebug
|
|
|
|
|
|
|
|
|
|
val forceZoomPreference = nightly or debug
|
|
|
|
|
val forceZoomPreference = Config.channel.isNightlyOrDebug
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gives option in Settings to see logins and sync logins
|
|
|
|
|