Skip to content

Commit

Permalink
added debug build check
Browse files Browse the repository at this point in the history
  • Loading branch information
rajatkumardhamija committed Oct 31, 2020
1 parent e59e1ae commit fb5060c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import me.rajatdhamija.rsod.RedScreenOfDeath
class MyApp : Application() {
override fun onCreate() {
super.onCreate()
RedScreenOfDeath.initRSOD(this)
RedScreenOfDeath.initRSOD(this, BuildConfig.BUILD_TYPE)
}
}
4 changes: 2 additions & 2 deletions rsod/src/main/java/me/rajatdhamija/rsod/RedScreenOfDeath.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import android.content.Context

object RedScreenOfDeath {
@JvmStatic
fun initRSOD(application: Application) {
if (BuildConfig.DEBUG) {
fun initRSOD(application: Application, buildType: String) {
if (buildType == "debug") {
val crashListener =
UncaughtExceptionListener { t, e -> handleUncaughtException(application, t, e) }
val crashHandler = UncaughtExceptionHandler(crashListener)
Expand Down

0 comments on commit fb5060c

Please sign in to comment.