Fix shuffle state cycling
Prevent the addition from overflowing
This commit is contained in:
parent
557649d7e5
commit
c09eadb951
@ -681,8 +681,10 @@ public final class PlaybackService extends Service implements Handler.Callback,
|
|||||||
public int cycleShuffle()
|
public int cycleShuffle()
|
||||||
{
|
{
|
||||||
synchronized (mStateLock) {
|
synchronized (mStateLock) {
|
||||||
int step = (mState & MASK_SHUFFLE) == 0x200 ? 0x200 : 0x100;
|
int state = mState;
|
||||||
return updateState(mState + step);
|
int step = (state & MASK_SHUFFLE) == 0x200 ? 0x200 : 0x100;
|
||||||
|
state = (state & ~MASK_SHUFFLE) | ((state + step) & MASK_SHUFFLE);
|
||||||
|
return updateState(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user