From 1336ec98b614c396f9d0b3915d65e04abf428686 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Fri, 20 Dec 2019 13:08:18 -0800 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/6464: Add ReleaseChannel.isDebug. --- app/src/main/java/org/mozilla/fenix/Config.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/java/org/mozilla/fenix/Config.kt b/app/src/main/java/org/mozilla/fenix/Config.kt index b7b5db3d30..0f7d035d02 100644 --- a/app/src/main/java/org/mozilla/fenix/Config.kt +++ b/app/src/main/java/org/mozilla/fenix/Config.kt @@ -15,6 +15,16 @@ enum class ReleaseChannel { else -> true } + /** + * True if this is a debug release channel, false otherwise. + * + * This constant should often be used instead of [BuildConfig.DEBUG], which indicates + * if the `debuggable` flag is set which can be true even on released channel builds + * (e.g. performance). + */ + val isDebug: Boolean + get() = !this.isReleased + val isReleaseOrBeta: Boolean get() = when (this) { FenixProduction -> true