Return updateState to old behavior

This commit is contained in:
Christopher Eby 2010-03-26 22:05:00 -05:00
parent 210e2c5513
commit 001215190e

View File

@ -473,27 +473,25 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
else else
cancelNotification = false; cancelNotification = false;
if (mState != oldState) { if ((state & FLAG_PLAYING) != 0 && (oldState & FLAG_PLAYING) == 0) {
if ((state & FLAG_PLAYING) != 0) {
startForegroundCompat(NOTIFICATION_ID, mNotification); startForegroundCompat(NOTIFICATION_ID, mNotification);
if (mMediaPlayerInitialized) { if (mMediaPlayerInitialized) {
synchronized (mMediaPlayer) { synchronized (mMediaPlayer) {
mMediaPlayer.start(); mMediaPlayer.start();
} }
} }
} else { } else if ((state & FLAG_PLAYING) == 0 && (oldState & FLAG_PLAYING) != 0) {
stopForegroundCompat(cancelNotification); stopForegroundCompat(cancelNotification);
if (mMediaPlayerInitialized) { if (mMediaPlayerInitialized) {
synchronized (mMediaPlayer) { synchronized (mMediaPlayer) {
mMediaPlayer.pause(); mMediaPlayer.pause();
} }
} }
}
return true;
} else { } else {
return false; return false;
} }
return true;
} }
private void retrieveSongs() private void retrieveSongs()