Skip to content

Commit

Permalink
Keep service alive when app is closed #305
Browse files Browse the repository at this point in the history
This trivial change stops the service from shutting down when the app is
closed. That behaviour came in when we added MediaSessionService and by
ignoring the onTaskRemoved call we can revert to the previous behaviour.
  • Loading branch information
davecraig committed Dec 31, 2024
1 parent 1d75b9c commit 2ca4d96
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ class SoundscapeService : MediaSessionService() {
}
}

override fun onTaskRemoved(rootIntent: Intent?) {
Log.d(TAG, "onTaskRemoved for service - ignoring, as we want to keep running")
}
override fun onDestroy() {
// If _mediaSession is not null, run the following block
mediaSession?.run {
Expand Down

0 comments on commit 2ca4d96

Please sign in to comment.