android-components / mozilla.components.lib.crash.service / GleanCrashReporterService

GleanCrashReporterService

class GleanCrashReporterService : CrashReporterService (source)

A CrashReporterService implementation for recording metrics with Glean. The purpose of this crash reporter is to collect crash count metrics by capturing Crash.UncaughtExceptionCrash, Throwable and Crash.NativeCodeCrash events and record to the respective mozilla.components.service.glean.private.CounterMetricType.

Constructors

Name Summary
<init> GleanCrashReporterService(context: <ERROR CLASS>, file: File = File(context.applicationInfo.dataDir, CRASH_FILE_NAME))
A CrashReporterService implementation for recording metrics with Glean. The purpose of this crash reporter is to collect crash count metrics by capturing Crash.UncaughtExceptionCrash, Throwable and Crash.NativeCodeCrash events and record to the respective mozilla.components.service.glean.private.CounterMetricType.

Properties

Name Summary
context val context: <ERROR CLASS>

Functions

Name Summary
report fun report(crash: UncaughtExceptionCrash): Unit
Submits a crash report for this Crash.UncaughtExceptionCrash.fun report(crash: NativeCodeCrash): Unit
Submits a crash report for this Crash.NativeCodeCrash.fun report(throwable: Throwable): Unit
Submits a caught exception report for this Throwable.

Companion Object Properties

Name Summary
CAUGHT_EXCEPTION_KEY const val CAUGHT_EXCEPTION_KEY: String
CRASH_FILE_NAME const val CRASH_FILE_NAME: String
FATAL_NATIVE_CODE_CRASH_KEY const val FATAL_NATIVE_CODE_CRASH_KEY: String
NONFATAL_NATIVE_CODE_CRASH_KEY const val NONFATAL_NATIVE_CODE_CRASH_KEY: String
UNCAUGHT_EXCEPTION_KEY const val UNCAUGHT_EXCEPTION_KEY: String

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.