Start playback when using play action from library
This commit is contained in:
parent
2023409bd9
commit
e23598aef1
@ -363,17 +363,27 @@ public final class PlaybackService extends Service implements Handler.Callback,
|
||||
}
|
||||
}
|
||||
|
||||
private void setFlag(int flag)
|
||||
/**
|
||||
* Set a state flag.
|
||||
*
|
||||
* @return The new state.
|
||||
*/
|
||||
public int setFlag(int flag)
|
||||
{
|
||||
synchronized (mStateLock) {
|
||||
updateState(mState | flag);
|
||||
return updateState(mState | flag);
|
||||
}
|
||||
}
|
||||
|
||||
private void unsetFlag(int flag)
|
||||
/**
|
||||
* Unset a state flag.
|
||||
*
|
||||
* @return The new state.
|
||||
*/
|
||||
public int unsetFlag(int flag)
|
||||
{
|
||||
synchronized (mStateLock) {
|
||||
updateState(mState & ~flag);
|
||||
return updateState(mState & ~flag);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -270,6 +270,9 @@ public class SongSelector extends PlaybackActivity implements AdapterView.OnItem
|
||||
int count = service.addSongs(mode, type, id);
|
||||
setSong(service.getSong(0));
|
||||
|
||||
if (action == ACTION_PLAY && (mState & PlaybackService.FLAG_PLAYING) == 0)
|
||||
setState(service.setFlag(PlaybackService.FLAG_PLAYING));
|
||||
|
||||
Toast.makeText(this, getResources().getQuantityString(text, count, count), Toast.LENGTH_SHORT).show();
|
||||
mLastActedId = id;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user