log service start

This commit is contained in:
Milos Kozak 2021-11-16 21:45:58 +01:00
parent fb9871507b
commit 5569974714
2 changed files with 4 additions and 0 deletions

View file

@ -42,6 +42,7 @@ class DummyService : DaggerService() {
// TODO: I guess this was moved here in order to adhere to the 5 seconds rule to call "startForeground" after a Service was called as Foreground service?
// As onCreate() is not called every time a service is started, copied to onStartCommand().
try {
aapsLogger.debug("Starting DummyService with ID ${notificationHolder.notificationID} notification ${notificationHolder.notification}")
startForeground(notificationHolder.notificationID, notificationHolder.notification)
} catch (e: Exception) {
startForeground(4711, Notification())
@ -66,6 +67,7 @@ class DummyService : DaggerService() {
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
super.onStartCommand(intent, flags, startId)
try {
aapsLogger.debug("Starting DummyService with ID ${notificationHolder.notificationID} notification ${notificationHolder.notification}")
startForeground(notificationHolder.notificationID, notificationHolder.notification)
} catch (e: Exception) {
startForeground(4711, Notification())

View file

@ -88,6 +88,7 @@ class LocationService : DaggerService() {
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
super.onStartCommand(intent, flags, startId)
try {
aapsLogger.debug("Starting LocationService with ID ${notificationHolder.notificationID} notification ${notificationHolder.notification}")
startForeground(notificationHolder.notificationID, notificationHolder.notification)
} catch (e: Exception) {
startForeground(4711, Notification())
@ -98,6 +99,7 @@ class LocationService : DaggerService() {
override fun onCreate() {
super.onCreate()
try {
aapsLogger.debug("Starting LocationService with ID ${notificationHolder.notificationID} notification ${notificationHolder.notification}")
startForeground(notificationHolder.notificationID, notificationHolder.notification)
} catch (e: Exception) {
startForeground(4711, Notification())