File tree Expand file tree Collapse file tree
AnkiDroid/src/main/java/com/ichi2/anki Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ open class AnkiDroidApp :
134134 // Ensures any change is propagated to widgets
135135 ChangeManager .subscribe(this )
136136
137- CrashReportService .initialize( this )
137+ initializeAcraCrashReporter( )
138138 val logType = LogType .value
139139 when (logType) {
140140 LogType .DEBUG -> Timber .plant(DebugTree ())
@@ -165,7 +165,7 @@ open class AnkiDroidApp :
165165 }
166166
167167 // Stop after analytics and logging are initialised.
168- if (CrashReportService .isProperServiceProcess ()) {
168+ if (isAcraSenderProcess ()) {
169169 Timber .d(" Skipping AnkiDroidApp.onCreate from ACRA sender process" )
170170 return
171171 }
Original file line number Diff line number Diff line change @@ -417,3 +417,13 @@ fun <T> runCatchingWithReport(
417417 if (e is Error ) throw e
418418 Result .failure(e)
419419 }
420+
421+ /* *
422+ * Initializes ACRA crash reporting.
423+ */
424+ context(application: Application )
425+ fun initializeAcraCrashReporter () {
426+ CrashReportService .initialize(application)
427+ }
428+
429+ fun isAcraSenderProcess (): Boolean = CrashReportService .isProperServiceProcess()
You can’t perform that action at this time.
0 commit comments