FairEmail/app/src/main/java/com/bugsnag/android/EventStorageModule.kt

41 lines
1.4 KiB
Kotlin
Raw Normal View History

2021-08-15 12:40:22 +00:00
package com.bugsnag.android
import com.bugsnag.android.internal.dag.ConfigModule
import com.bugsnag.android.internal.dag.ContextModule
import com.bugsnag.android.internal.dag.DependencyModule
import com.bugsnag.android.internal.dag.SystemServiceModule
/**
* A dependency module which constructs the objects that persist events to disk in Bugsnag.
*/
internal class EventStorageModule(
contextModule: ContextModule,
configModule: ConfigModule,
dataCollectionModule: DataCollectionModule,
bgTaskService: BackgroundTaskService,
trackerModule: TrackerModule,
systemServiceModule: SystemServiceModule,
2022-02-03 17:36:29 +00:00
notifier: Notifier,
callbackState: CallbackState
2021-08-15 12:40:22 +00:00
) : DependencyModule() {
private val cfg = configModule.config
private val delegate by future {
2022-06-23 18:23:15 +00:00
if (cfg.telemetry.contains(Telemetry.INTERNAL_ERRORS) == true)
InternalReportDelegate(
contextModule.ctx,
cfg.logger,
cfg,
systemServiceModule.storageManager,
dataCollectionModule.appDataCollector,
dataCollectionModule.deviceDataCollector,
trackerModule.sessionTracker,
notifier,
bgTaskService
) else null
2021-08-15 12:40:22 +00:00
}
2022-02-03 17:36:29 +00:00
val eventStore by future { EventStore(cfg, cfg.logger, notifier, bgTaskService, delegate, callbackState) }
2021-08-15 12:40:22 +00:00
}