I\'m currently creating a foreground service with a notification that appears in the notification bar when the service starts. If the service stops, the notification dismiss
The notification of a foregraound service cannot be cleared. The only way is stopping the service.
So I beleive the issue you want to solve, will never happen.