Skip to content

Commit

Permalink
Fix notification again
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod committed Jul 26, 2021
1 parent ed09f74 commit 5f6e33c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ object ServiceNotification {
}
}
fun stopForeground(service: Service) = synchronized(this) {
val shutdown = deviceCountsMap.remove(service) != null && deviceCountsMap.isEmpty()
deviceCountsMap.remove(service) ?: return@synchronized
val shutdown = deviceCountsMap.isEmpty()
service.stopForeground(shutdown)
if (!shutdown) manager.notify(NOTIFICATION_ID, buildNotification(service))
}
Expand Down

0 comments on commit 5f6e33c

Please sign in to comment.