Skip to content

Commit

Permalink
Keep service alive when app is closed Scottish-Tech-Army#305
Browse files Browse the repository at this point in the history
Thie 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 ba2e672
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 ba2e672

Please sign in to comment.