thasmin/Podax — pull request #65 by dbs (2012-06-19 02:26:32+00:00)
Title: Add support for headset control of pause/resume

Using com.android.music.MediaButtonIntentReceiver as a starting point,
hook up the headset button for pausing and resuming playback.

By registering the receiver in the manifest with a stupidly high
priority (5000; SYSTEM_HIGH_PRIORITY is supposed to be 1000), we can
prevent Google Music from simply kicking into gear. We should play nice
with other apps, but one step at a time.

In theory, long-pressing the headset button should skip forward, but
isLongPress() appears to never be true at the moment. That, also, can
wait for later; for now, just having the ability to pause & resume is a
win.

Thanks to http://android.amberfog.com/?p=415 for some useful pointers.

Signed-off-by: Dan Scott