fix: propagate ICY metadata to MediaItem and remove unsafe stopSelf

- updateMetadata() now also updates _currentMediaItem so track info
  and artwork flow through to the notification/lockscreen via getState()
- Remove else -> stopSelf() from onStartCommand to avoid killing the
  service on internal MediaLibraryService intents

Made-with: Cursor
This commit is contained in:
cottongin
2026-03-18 06:14:49 -04:00
parent 00f4da20b6
commit f65b0db0f4
2 changed files with 4 additions and 1 deletions

View File

@@ -134,7 +134,6 @@ class RadioPlaybackService : MediaLibraryService() {
ACTION_PAUSE -> handlePause()
ACTION_SEEK_LIVE -> handleSeekLive()
ACTION_STOP -> handleStop()
else -> stopSelf()
}
return START_NOT_STICKY
}

View File

@@ -107,6 +107,10 @@ class RadioPlayerAdapter(
.setArtworkUri(artworkUri)
.setIsPlayable(true)
.build()
_currentMediaItem = MediaItem.Builder()
.setMediaId(_currentMediaItem?.mediaId ?: "station:${station.id}")
.setMediaMetadata(_mediaMetadata)
.build()
invalidateState()
}