use saveActiveSongs and broadcastChangedSongs

in clearQueue and emptyQueue
also, call pause and setFlag before calling emptyQueue
This commit is contained in:
Amin Bandali committed 2015-04-14 15:32:24 -04:00
1 parent 7b6fc6218a
commit ddb129b660
2 files changed
+6 -10

No files matched your search

@@ -1642,6 +1642,8 @@ public final class PlaybackService extends Service
*/
public void emptyQueue()
{
pause();
setFlag(FLAG_EMPTY_QUEUE);
mTimeline.emptyQueue();
}
@@ -774,15 +774,12 @@ public final class SongTimeline {
public void clearQueue()
{
synchronized (this) {
saveActiveSongs();
if (mCurrentPos + 1 < mSongs.size())
mSongs.subList(mCurrentPos + 1, mSongs.size()).clear();
}
if (mCallback != null) {
mCallback.activeSongReplaced(+1, getSong(+1));
mCallback.positionInfoChanged();
}
broadcastChangedSongs();
changed();
}
@@ -792,14 +789,11 @@ public final class SongTimeline {
public void emptyQueue()
{
synchronized (this) {
saveActiveSongs();
mSongs.clear();
}
if (mCallback != null) {
mCallback.activeSongReplaced(+1, getSong(+1));
mCallback.positionInfoChanged();
}
broadcastChangedSongs();
changed();
}