diff options
-rw-r--r-- | AndroidManifest.xml | 2 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/service/PlaybackService.java | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index bba973318..814272d53 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -96,7 +96,7 @@ android:label="@string/download_log_label" > </activity> - <receiver android:name=".receiver.MediaButtonReceiver" > + <receiver android:name=".receiver.MediaButtonReceiver" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MEDIA_BUTTON" /> </intent-filter> diff --git a/src/de/danoeh/antennapod/service/PlaybackService.java b/src/de/danoeh/antennapod/service/PlaybackService.java index 789b1c952..f4e5fb93f 100644 --- a/src/de/danoeh/antennapod/service/PlaybackService.java +++ b/src/de/danoeh/antennapod/service/PlaybackService.java @@ -411,12 +411,17 @@ public class PlaybackService extends Service { /** Handles media button events */ private void handleKeycode(int keycode) { + if (AppConfig.DEBUG) + Log.d(TAG, "Handling keycode: " + keycode); switch (keycode) { + case KeyEvent.KEYCODE_HEADSETHOOK: case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE: if (status == PlayerStatus.PLAYING) { pause(false); } else if (status == PlayerStatus.PAUSED) { play(); + } else if (status == PlayerStatus.PREPARING) { + setStartWhenPrepared(!startWhenPrepared); } break; case KeyEvent.KEYCODE_MEDIA_PLAY: @@ -732,6 +737,7 @@ public class PlaybackService extends Service { /** * Saves the current position and pauses playback. Note that, if audiofocus * is abandoned, the lockscreen controls will also disapear. + * * @param abandonFocus * is true if the service should release audio focus */ @@ -976,7 +982,7 @@ public class PlaybackService extends Service { .editMetadata(false); editor.putString(MediaMetadataRetriever.METADATA_KEY_TITLE, media.getItem().getTitle()); - + editor.putString(MediaMetadataRetriever.METADATA_KEY_ALBUM, media.getItem().getFeed().getTitle()); |