Automatically play when using the headset control advance
This commit is contained in:
parent
d95f9cf81d
commit
fe3cfe8bc6
@ -52,7 +52,7 @@ public class MediaButtonReceiver extends BroadcastReceiver {
|
||||
|
||||
private static Intent getCommand(Context context, String action)
|
||||
{
|
||||
return new Intent(context, PlaybackService.class).setAction(action);
|
||||
return new Intent(context, PlaybackService.class).setAction(action).putExtra("autoplay", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -131,6 +131,12 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
|
||||
return;
|
||||
}
|
||||
|
||||
if (delta != 0 && intent.hasExtra("autoplay")) {
|
||||
synchronized (mStateLock) {
|
||||
mState |= FLAG_PLAYING;
|
||||
}
|
||||
}
|
||||
|
||||
// check for double click
|
||||
if (intent.hasExtra("double")) {
|
||||
if (mHandler.hasMessages(GO)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user