Fix some crashers that show up with no media

Because I never seem to test this code path :)
This commit is contained in:
Christopher Eby 2010-03-21 17:08:44 -05:00
parent 8b9e7a63b7
commit 9e1aff4645

View File

@ -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;
}