Automatically play when using the headset control advance

This commit is contained in:
Christopher Eby 2010-04-06 00:18:25 -05:00
parent d95f9cf81d
commit fe3cfe8bc6
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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)) {