rollback change related to alarm playback, fix stutter when changing tab

remotes/origin/devel
yattoz 2022-02-22 12:27:03 +09:00
parent 300a806d81
commit c5c4bdd838
1 changed files with 5 additions and 1 deletions

View File

@ -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")
} }