playback: check for init before applying state

Check if the playback state still has not been initialized once we
restore.

This prevents one from playing a song while the restore task is
on-going and then having it overwritten by the restored state.
This commit is contained in:
OxygenCobalt 2022-08-03 14:02:45 -06:00
parent 304fccf0f9
commit 79637f7603
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -363,7 +363,7 @@ class PlaybackStateManager private constructor() {
synchronized(this) {
val exists =
if (state != null) {
if (state != null && !isInitialized) {
// Continuing playback while also possibly doing drastic state updates is
// a bad idea, so pause.
isPlaying = false