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:
@@ -134,7 +134,6 @@ class RadioPlaybackService : MediaLibraryService() {
|
|||||||
ACTION_PAUSE -> handlePause()
|
ACTION_PAUSE -> handlePause()
|
||||||
ACTION_SEEK_LIVE -> handleSeekLive()
|
ACTION_SEEK_LIVE -> handleSeekLive()
|
||||||
ACTION_STOP -> handleStop()
|
ACTION_STOP -> handleStop()
|
||||||
else -> stopSelf()
|
|
||||||
}
|
}
|
||||||
return START_NOT_STICKY
|
return START_NOT_STICKY
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,6 +107,10 @@ class RadioPlayerAdapter(
|
|||||||
.setArtworkUri(artworkUri)
|
.setArtworkUri(artworkUri)
|
||||||
.setIsPlayable(true)
|
.setIsPlayable(true)
|
||||||
.build()
|
.build()
|
||||||
|
_currentMediaItem = MediaItem.Builder()
|
||||||
|
.setMediaId(_currentMediaItem?.mediaId ?: "station:${station.id}")
|
||||||
|
.setMediaMetadata(_mediaMetadata)
|
||||||
|
.build()
|
||||||
invalidateState()
|
invalidateState()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user