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()
|
public void emptyQueue()
|
||||||
{
|
{
|
||||||
|
pause();
|
||||||
|
setFlag(FLAG_EMPTY_QUEUE);
|
||||||
mTimeline.emptyQueue();
|
mTimeline.emptyQueue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -774,15 +774,12 @@ public final class SongTimeline {
|
|||||||
public void clearQueue()
|
public void clearQueue()
|
||||||
{
|
{
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
|
saveActiveSongs();
|
||||||
if (mCurrentPos + 1 < mSongs.size())
|
if (mCurrentPos + 1 < mSongs.size())
|
||||||
mSongs.subList(mCurrentPos + 1, mSongs.size()).clear();
|
mSongs.subList(mCurrentPos + 1, mSongs.size()).clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mCallback != null) {
|
broadcastChangedSongs();
|
||||||
mCallback.activeSongReplaced(+1, getSong(+1));
|
|
||||||
mCallback.positionInfoChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
changed();
|
changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -792,14 +789,11 @@ public final class SongTimeline {
|
|||||||
public void emptyQueue()
|
public void emptyQueue()
|
||||||
{
|
{
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
|
saveActiveSongs();
|
||||||
mSongs.clear();
|
mSongs.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mCallback != null) {
|
broadcastChangedSongs();
|
||||||
mCallback.activeSongReplaced(+1, getSong(+1));
|
|
||||||
mCallback.positionInfoChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
changed();
|
changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user