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-02-25 10:48:54 -08:00
|
|
|
import com.geeksville.android.BuildUtils.isEmulator
|
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-03-11 14:45:49 -07:00
|
|
|
import com.mapbox.mapboxsdk.Mapbox
|
2020-01-22 09:28:59 -08:00
|
|
|
|
2020-01-24 17:05:55 -08:00
|
|
|
|
2020-03-15 21:43:12 -07:00
|
|
|
class MeshUtilApplication : GeeksvilleApplication() {
|
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-25 10:48:54 -08:00
|
|
|
if (!isEmulator && (!BuildConfig.DEBUG || !Debug.isDebuggerConnected())) {
|
2020-02-24 15:33:35 -08:00
|
|
|
val crashlytics = FirebaseCrashlytics.getInstance()
|
|
|
|
|
crashlytics.setCrashlyticsCollectionEnabled(true)
|
|
|
|
|
|
|
|
|
|
// Attach to our exception wrapper
|
|
|
|
|
Exceptions.reporter = { exception, _, _ ->
|
|
|
|
|
crashlytics.recordException(exception)
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-03-11 14:45:49 -07:00
|
|
|
|
|
|
|
|
// Mapbox Access token
|
|
|
|
|
Mapbox.getInstance(this, getString(R.string.mapbox_access_token))
|
2020-02-12 15:47:06 -08:00
|
|
|
}
|
2020-01-24 17:05:55 -08:00
|
|
|
}
|