Fix some crashers that show up with no media
Because I never seem to test this code path :)
This commit is contained in:
parent
8b9e7a63b7
commit
9e1aff4645
@ -445,12 +445,12 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
|
||||
return false;
|
||||
|
||||
Song song = getSong(0);
|
||||
if (song == null && state == STATE_PLAYING)
|
||||
return false;
|
||||
|
||||
int oldState = mState;
|
||||
mState = state;
|
||||
|
||||
if (song == null)
|
||||
return false;
|
||||
|
||||
broadcastChange(oldState, state, song);
|
||||
|
||||
boolean cancelNotification;
|
||||
@ -499,7 +499,8 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
|
||||
private boolean updateNotification(Song song)
|
||||
{
|
||||
if (song == null || !mNotifyWhilePaused && mState == STATE_NORMAL) {
|
||||
mNotificationManager.cancel(NOTIFICATION_ID);
|
||||
if (mNotificationManager != null)
|
||||
mNotificationManager.cancel(NOTIFICATION_ID);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user