fix issues with notification when queue is cleared
This commit is contained in:
parent
8a73fcf6a4
commit
bc92f9a22c
2 changed files with 5 additions and 5 deletions
|
|
@ -80,7 +80,6 @@ public class EventListener extends ApiEventListener {
|
||||||
MusicPlayerRemote.seekTo((int) position);
|
MusicPlayerRemote.seekTo((int) position);
|
||||||
break;
|
break;
|
||||||
case Stop:
|
case Stop:
|
||||||
MusicPlayerRemote.pauseSong();
|
|
||||||
MusicPlayerRemote.clearQueue();
|
MusicPlayerRemote.clearQueue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -513,8 +513,8 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
|
||||||
|
|
||||||
private void openCurrent() {
|
private void openCurrent() {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
// current song will be null when queue is cleared
|
// current song title will be null when queue is cleared
|
||||||
if (getCurrentSong() == null) return;
|
if (getCurrentSong().title == null) return;
|
||||||
|
|
||||||
playback.setDataSource(getCurrentSong());
|
playback.setDataSource(getCurrentSong());
|
||||||
}
|
}
|
||||||
|
|
@ -547,7 +547,7 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateNotification() {
|
public void updateNotification() {
|
||||||
if (playingNotification != null && getCurrentSong().id != null) {
|
if (playingNotification != null && getCurrentSong().title != null) {
|
||||||
playingNotification.update();
|
playingNotification.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -564,7 +564,7 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
|
||||||
private void updateMediaSessionMetadata() {
|
private void updateMediaSessionMetadata() {
|
||||||
final Song song = getCurrentSong();
|
final Song song = getCurrentSong();
|
||||||
|
|
||||||
if (song.id == null) {
|
if (song.title == null) {
|
||||||
mediaSession.setMetadata(null);
|
mediaSession.setMetadata(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1002,6 +1002,7 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
|
||||||
if (playingQueue.size() > 0) {
|
if (playingQueue.size() > 0) {
|
||||||
prepareNext();
|
prepareNext();
|
||||||
} else {
|
} else {
|
||||||
|
playback.pause();
|
||||||
playingNotification.stop();
|
playingNotification.stop();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue