rollback change related to alarm playback, fix stutter when changing tab
parent
300a806d81
commit
c5c4bdd838
|
|
@ -514,6 +514,10 @@ class RadioService : MediaBrowserServiceCompat() {
|
||||||
if (result != AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {
|
if (result != AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (mediaSession.controller.playbackState.state == PlaybackStateCompat.STATE_PLAYING && !isRinging && isAlarmStopped)
|
||||||
|
{
|
||||||
|
return //nothing to do here
|
||||||
|
}
|
||||||
|
|
||||||
PlayerStore.instance.playbackState.value = PlaybackStateCompat.STATE_PLAYING
|
PlayerStore.instance.playbackState.value = PlaybackStateCompat.STATE_PLAYING
|
||||||
|
|
||||||
|
|
@ -530,6 +534,7 @@ class RadioService : MediaBrowserServiceCompat() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// START PLAYBACK, LET'S ROCK
|
// START PLAYBACK, LET'S ROCK
|
||||||
|
player.playWhenReady = true
|
||||||
nowPlayingNotification.update(this, isUpdatingNotificationButton = true, isRinging = isRinging)
|
nowPlayingNotification.update(this, isUpdatingNotificationButton = true, isRinging = isRinging)
|
||||||
|
|
||||||
playbackStateBuilder.setState(
|
playbackStateBuilder.setState(
|
||||||
|
|
@ -539,7 +544,6 @@ class RadioService : MediaBrowserServiceCompat() {
|
||||||
SystemClock.elapsedRealtime()
|
SystemClock.elapsedRealtime()
|
||||||
)
|
)
|
||||||
mediaSession.setPlaybackState(playbackStateBuilder.build())
|
mediaSession.setPlaybackState(playbackStateBuilder.build())
|
||||||
player.playWhenReady = true
|
|
||||||
|
|
||||||
//[REMOVE LOG CALLS]Log.d(tag, radioTag + "begin playing")
|
//[REMOVE LOG CALLS]Log.d(tag, radioTag + "begin playing")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue