Fixed calling bindService if service is not running

This commit is contained in:
ByteHamster 2021-03-07 19:57:35 +01:00
parent 573cd2efd2
commit 7a3bb825ed

View File

@ -208,9 +208,11 @@ public abstract class PlaybackController {
handleStatus(); handleStatus();
} else { } else {
Log.w(TAG, "Couldn't receive status update: playbackService was null"); Log.w(TAG, "Couldn't receive status update: playbackService was null");
if (PlaybackService.isRunning) {
bindToService(); bindToService();
} }
} }
}
}; };
private final BroadcastReceiver notificationReceiver = new BroadcastReceiver() { private final BroadcastReceiver notificationReceiver = new BroadcastReceiver() {
@ -232,7 +234,7 @@ public abstract class PlaybackController {
onBufferUpdate(progress); onBufferUpdate(progress);
break; break;
case PlaybackService.NOTIFICATION_TYPE_RELOAD: case PlaybackService.NOTIFICATION_TYPE_RELOAD:
if (playbackService == null) { if (playbackService == null && PlaybackService.isRunning) {
bindToService(); bindToService();
return; return;
} }