From e89d263cdc550663d1a8faec7d6c9f63d0d4c26d Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 1 Aug 2022 14:40:03 +0200 Subject: [PATCH] postpone ProcessLifecycleListener init --- app/src/main/java/info/nightscout/androidaps/MainApp.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.kt b/app/src/main/java/info/nightscout/androidaps/MainApp.kt index bc201bf3c8..62468ebbd9 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.kt @@ -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 @Inject lateinit var profileSwitchPlugin: ThemeSwitcherPlugin @Inject lateinit var localAlertUtils: LocalAlertUtils @Inject lateinit var rh: Provider @@ -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 {