From 2ba54f085d9e179aeb7e133765fbda3e7e14909f Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 15 Jan 2025 10:22:27 +0100 Subject: [PATCH] Make sure foreground services notifications ID are re-set when service is destroyed --- .../java/org/linphone/notifications/NotificationsManager.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/linphone/notifications/NotificationsManager.kt b/app/src/main/java/org/linphone/notifications/NotificationsManager.kt index b8c0ec12e..5811eec00 100644 --- a/app/src/main/java/org/linphone/notifications/NotificationsManager.kt +++ b/app/src/main/java/org/linphone/notifications/NotificationsManager.kt @@ -484,6 +484,7 @@ class NotificationsManager fun onInCallServiceDestroyed() { Log.i("$TAG Service has been destroyed") inCallService = null + currentInCallServiceNotificationId = -1 } @MainThread @@ -768,10 +769,10 @@ class NotificationsManager ) service.stopForeground(STOP_FOREGROUND_REMOVE) service.stopSelf() - currentInCallServiceNotificationId = -1 } else { Log.w("$TAG Can't stop foreground Service & notif, no Service was found") } + currentInCallServiceNotificationId = -1 } @WorkerThread @@ -1500,12 +1501,12 @@ class NotificationsManager ) service.stopForeground(STOP_FOREGROUND_REMOVE) service.stopSelf() - currentKeepAliveThirdPartyAccountsForegroundServiceNotificationId = -1 } else { Log.w( "$TAG Can't stop keep alive for third party accounts foreground Service & notif, no Service was found" ) } + currentKeepAliveThirdPartyAccountsForegroundServiceNotificationId = -1 } @MainThread