From f11ddf8038361776c9652701ad778feab5b0a025 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Fri, 20 Dec 2019 13:08:18 -0800 Subject: [PATCH] For #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 b7b5db3d3..0f7d035d0 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