Applied suggestions

This commit is contained in:
ByteHamster 2018-06-10 11:04:29 +02:00
parent 1331c92c1d
commit de21ff42d9
1 changed files with 8 additions and 2 deletions

View File

@ -678,8 +678,8 @@ public class PlaybackService extends MediaBrowserServiceCompat {
break; break;
case STOPPED: case STOPPED:
writePlaybackPreferencesNoMediaPlaying(); //writePlaybackPreferencesNoMediaPlaying();
stopSelf(); //stopSelf();
break; break;
case PLAYING: case PLAYING:
@ -1219,6 +1219,9 @@ public class PlaybackService extends MediaBrowserServiceCompat {
} }
if (playable == null) { if (playable == null) {
Log.d(TAG, "setupNotification: playable is null"); Log.d(TAG, "setupNotification: playable is null");
if (!started) {
stopSelf();
}
return; return;
} }
Runnable notificationSetupTask = new Runnable() { Runnable notificationSetupTask = new Runnable() {
@ -1230,6 +1233,9 @@ public class PlaybackService extends MediaBrowserServiceCompat {
if (mediaPlayer == null) { if (mediaPlayer == null) {
Log.d(TAG, "notificationSetupTask: mediaPlayer is null"); Log.d(TAG, "notificationSetupTask: mediaPlayer is null");
if (!started) {
stopSelf();
}
return; return;
} }