From c1290ce76649a8bed34574ac738b5b1b9a961980 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 26 Oct 2021 13:41:48 +0200 Subject: [PATCH] stop alarm service on terminate app --- app/src/main/java/info/nightscout/androidaps/MainApp.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.kt b/app/src/main/java/info/nightscout/androidaps/MainApp.kt index 3ea9524625..eae9da8d40 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.kt @@ -30,6 +30,7 @@ import info.nightscout.androidaps.receivers.ChargingStateReceiver import info.nightscout.androidaps.receivers.KeepAliveReceiver.KeepAliveManager import info.nightscout.androidaps.receivers.NetworkChangeReceiver import info.nightscout.androidaps.receivers.TimeDateOrTZChangeReceiver +import info.nightscout.androidaps.services.AlarmSoundServiceHelper import info.nightscout.androidaps.utils.ActivityMonitor import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.locale.LocaleHelper @@ -63,6 +64,7 @@ class MainApp : DaggerApplication() { @Inject lateinit var staticInjector: StaticInjector// TODO avoid , here fake only to initialize @Inject lateinit var uel: UserEntryLogger @Inject lateinit var passwordCheck: PasswordCheck + @Inject lateinit var alarmSoundServiceHelper: AlarmSoundServiceHelper override fun onCreate() { super.onCreate() @@ -177,6 +179,7 @@ class MainApp : DaggerApplication() { aapsLogger.debug(LTag.CORE, "onTerminate") unregisterActivityLifecycleCallbacks(activityMonitor) keepAliveManager.cancelAlarm(this) + alarmSoundServiceHelper.stopService(this) super.onTerminate() } }