use saveActiveSongs and broadcastChangedSongs
in clearQueue and emptyQueue also, call pause and setFlag before calling emptyQueue
This commit is contained in:
parent
7b6fc6218a
commit
ddb129b660
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user