Commit 1edbc1ca authored by Geoffrey Métais's avatar Geoffrey Métais

Fix crash after phone call

(cherry picked from commit 94b38b61)
parent 011e872e
......@@ -287,7 +287,6 @@ public class PlaybackService extends MediaBrowserServiceCompat{
mRemoteControlClientReceiver = null;
}
playlistManager.onServiceDestroyed();
updateWidget();
}
@Override
......
......@@ -146,7 +146,9 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
}
}
fun play() = player.play()
fun play() {
if (hasMedia()) player.play()
}
fun pause() {
if (player.pause()) savePosition()
......@@ -179,10 +181,8 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
currentIndex = -1
mediaList.clear()
if (systemExit) player.release()
else {
player.restart()
service.onPlaybackStopped()
}
else player.restart()
service.onPlaybackStopped()
}
@MainThread
......@@ -670,4 +670,6 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
}
service.onMediaPlayerEvent(event)
}
fun isAudioList() = !player.canSwitchToVideo() && mediaList.isAudioList
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment