mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-24 00:33:14 -04:00
report exceptions via crashytics
This commit is contained in:
@@ -3,6 +3,7 @@ package com.geeksville.mesh
|
||||
import android.os.Debug
|
||||
import com.geeksville.android.GeeksvilleApplication
|
||||
import com.geeksville.android.Logging
|
||||
import com.geeksville.util.Exceptions
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics
|
||||
|
||||
|
||||
@@ -15,7 +16,14 @@ class MeshUtilApplication : GeeksvilleApplication(null, "58e72ccc361883ea502510b
|
||||
|
||||
// We default to off in the manifest, FIXME turn on only if user approves
|
||||
// leave off when running in the debugger
|
||||
if (!BuildConfig.DEBUG || !Debug.isDebuggerConnected())
|
||||
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true)
|
||||
if (!BuildConfig.DEBUG || !Debug.isDebuggerConnected()) {
|
||||
val crashlytics = FirebaseCrashlytics.getInstance()
|
||||
crashlytics.setCrashlyticsCollectionEnabled(true)
|
||||
|
||||
// Attach to our exception wrapper
|
||||
Exceptions.reporter = { exception, _, _ ->
|
||||
crashlytics.recordException(exception)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,8 +17,8 @@ import com.geeksville.android.Logging
|
||||
import com.geeksville.mesh.*
|
||||
import com.geeksville.mesh.MeshProtos.MeshPacket
|
||||
import com.geeksville.mesh.MeshProtos.ToRadio
|
||||
import com.geeksville.util.Exceptions
|
||||
import com.geeksville.util.exceptionReporter
|
||||
import com.geeksville.util.reportException
|
||||
import com.geeksville.util.toOneLineString
|
||||
import com.geeksville.util.toRemoteExceptions
|
||||
import com.google.android.gms.common.api.ResolvableApiException
|
||||
@@ -181,7 +181,7 @@ class MeshService : Service(), Logging {
|
||||
) */
|
||||
}
|
||||
} else
|
||||
reportException(exception)
|
||||
Exceptions.report(exception)
|
||||
}
|
||||
|
||||
val client = LocationServices.getFusedLocationProviderClient(this)
|
||||
|
||||
Reference in New Issue
Block a user