Make sure the notification is cancelled
This commit is contained in:
@@ -62,11 +62,9 @@ object ServiceNotification {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
fun stopForeground(service: Service) = synchronized(this) {
|
fun stopForeground(service: Service) = synchronized(this) {
|
||||||
deviceCountsMap.remove(service)
|
val shutdown = deviceCountsMap.remove(service) != null && deviceCountsMap.isEmpty()
|
||||||
if (deviceCountsMap.isEmpty()) service.stopForeground(true) else {
|
service.stopForeground(shutdown)
|
||||||
service.stopForeground(false)
|
if (shutdown) manager.cancel(NOTIFICATION_ID) else manager.notify(NOTIFICATION_ID, buildNotification(service))
|
||||||
manager.notify(NOTIFICATION_ID, buildNotification(service))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateNotificationChannels() {
|
fun updateNotificationChannels() {
|
||||||
|
|||||||
Reference in New Issue
Block a user