Return updateState to old behavior
This commit is contained in:
parent
210e2c5513
commit
001215190e
@ -473,27 +473,25 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
|
||||
else
|
||||
cancelNotification = false;
|
||||
|
||||
if (mState != oldState) {
|
||||
if ((state & FLAG_PLAYING) != 0) {
|
||||
if ((state & FLAG_PLAYING) != 0 && (oldState & FLAG_PLAYING) == 0) {
|
||||
startForegroundCompat(NOTIFICATION_ID, mNotification);
|
||||
if (mMediaPlayerInitialized) {
|
||||
synchronized (mMediaPlayer) {
|
||||
mMediaPlayer.start();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else if ((state & FLAG_PLAYING) == 0 && (oldState & FLAG_PLAYING) != 0) {
|
||||
stopForegroundCompat(cancelNotification);
|
||||
if (mMediaPlayerInitialized) {
|
||||
synchronized (mMediaPlayer) {
|
||||
mMediaPlayer.pause();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void retrieveSongs()
|
||||
|
Loading…
x
Reference in New Issue
Block a user