From f4edee2481cf94be70bdc8e4670a5b4a99b4a88c Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sun, 6 Jan 2019 15:32:38 +0000 Subject: [PATCH] Acra: disable for debug builds. --- app/src/main/java/com/etesync/syncadapter/App.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/etesync/syncadapter/App.kt b/app/src/main/java/com/etesync/syncadapter/App.kt index 0c21c6a7..2054bdba 100644 --- a/app/src/main/java/com/etesync/syncadapter/App.kt +++ b/app/src/main/java/com/etesync/syncadapter/App.kt @@ -121,11 +121,13 @@ class App : Application() { override fun attachBaseContext(base: Context) { super.attachBaseContext(base) - // The following line triggers the initialization of ACRA - ACRA.init(this) - val pm = base.packageManager - var installedFrom = pm.getInstallerPackageName(BuildConfig.APPLICATION_ID) - ACRA.getErrorReporter().putCustomData("installedFrom", installedFrom); + if (!BuildConfig.DEBUG) { + // The following line triggers the initialization of ACRA + ACRA.init(this) + val pm = base.packageManager + var installedFrom = pm.getInstallerPackageName(BuildConfig.APPLICATION_ID) + ACRA.getErrorReporter().putCustomData("installedFrom", installedFrom); + } } private fun loadLanguage() {