2020-01-22 21:46:41 -08:00
|
|
|
package com.geeksville.mesh
|
2020-01-22 09:28:59 -08:00
|
|
|
|
2020-02-12 15:47:06 -08:00
|
|
|
import android.os.Debug
|
2020-01-22 09:28:59 -08:00
|
|
|
import com.geeksville.android.GeeksvilleApplication
|
2020-02-14 07:47:20 -08:00
|
|
|
import com.geeksville.android.Logging
|
2020-02-24 15:33:35 -08:00
|
|
|
import com.geeksville.util.Exceptions
|
2020-02-12 15:47:06 -08:00
|
|
|
import com.google.firebase.crashlytics.FirebaseCrashlytics
|
2020-01-22 09:28:59 -08:00
|
|
|
|
2020-01-24 17:05:55 -08:00
|
|
|
|
|
|
|
|
class MeshUtilApplication : GeeksvilleApplication(null, "58e72ccc361883ea502510baa46580e3") {
|
2020-02-12 15:47:06 -08:00
|
|
|
|
|
|
|
|
override fun onCreate() {
|
|
|
|
|
super.onCreate()
|
|
|
|
|
|
2020-02-14 07:47:20 -08:00
|
|
|
Logging.showLogs = BuildConfig.DEBUG
|
|
|
|
|
|
2020-02-12 15:47:06 -08:00
|
|
|
// We default to off in the manifest, FIXME turn on only if user approves
|
|
|
|
|
// leave off when running in the debugger
|
2020-02-24 15:33:35 -08:00
|
|
|
if (!BuildConfig.DEBUG || !Debug.isDebuggerConnected()) {
|
|
|
|
|
val crashlytics = FirebaseCrashlytics.getInstance()
|
|
|
|
|
crashlytics.setCrashlyticsCollectionEnabled(true)
|
|
|
|
|
|
|
|
|
|
// Attach to our exception wrapper
|
|
|
|
|
Exceptions.reporter = { exception, _, _ ->
|
|
|
|
|
crashlytics.recordException(exception)
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-02-12 15:47:06 -08:00
|
|
|
}
|
2020-01-24 17:05:55 -08:00
|
|
|
}
|