In that case: - The service does not go through onStartCommand, so it does not go to foreground state. - The media session is already destroyed. Now, create a new media session and definitely start foreground service when something is playing.
In that case: - The service does not go through onStartCommand, so it does not go to foreground state. - The media session is already destroyed. Now, create a new media session and definitely start foreground service when something is playing.