postpone ProcessLifecycleListener init

This commit is contained in:
Milos Kozak 2022-08-01 14:40:03 +02:00
parent 5512c31f52
commit e89d263cdc

View file

@ -80,7 +80,7 @@ class MainApp : DaggerApplication() {
@Inject lateinit var uel: UserEntryLogger
@Inject lateinit var alarmSoundServiceHelper: AlarmSoundServiceHelper
@Inject lateinit var notificationStore: NotificationStore
@Inject lateinit var processLifecycleListener: ProcessLifecycleListener
@Inject lateinit var processLifecycleListener: Provider<ProcessLifecycleListener>
@Inject lateinit var profileSwitchPlugin: ThemeSwitcherPlugin
@Inject lateinit var localAlertUtils: LocalAlertUtils
@Inject lateinit var rh: Provider<ResourceHelper>
@ -94,7 +94,6 @@ class MainApp : DaggerApplication() {
RxDogTag.install()
setRxErrorHandler()
LocaleHelper.update(this)
ProcessLifecycleOwner.get().lifecycle.addObserver(processLifecycleListener)
var gitRemote: String? = BuildConfig.REMOTE
var commitHash: String? = BuildConfig.HEAD
@ -151,6 +150,7 @@ class MainApp : DaggerApplication() {
localAlertUtils.preSnoozeAlarms()
doMigrations()
uel.log(UserEntry.Action.START_AAPS, UserEntry.Sources.Aaps)
ProcessLifecycleOwner.get().lifecycle.addObserver(processLifecycleListener.get())
// schedule widget update
refreshWidget = Runnable {