diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2012-09-26 15:33:01 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2012-09-26 15:33:01 +0200 |
commit | 916a382b372feea84636eaf17f840340b2c949cf (patch) | |
tree | 44d43911a29a9aca543769733cd816c1dc552adc /src | |
parent | 33a1d78c38c3ecc600c988ad8f895b88f2edccce (diff) | |
download | AntennaPod-916a382b372feea84636eaf17f840340b2c949cf.zip |
Workaround for #17
Diffstat (limited to 'src')
-rw-r--r-- | src/de/danoeh/antennapod/service/PlaybackService.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/de/danoeh/antennapod/service/PlaybackService.java b/src/de/danoeh/antennapod/service/PlaybackService.java index 315cf2509..609be0720 100644 --- a/src/de/danoeh/antennapod/service/PlaybackService.java +++ b/src/de/danoeh/antennapod/service/PlaybackService.java @@ -927,8 +927,14 @@ public class PlaybackService extends Service { PendingIntent mediaPendingIntent = PendingIntent.getBroadcast( getApplicationContext(), 0, mediaButtonIntent, 0); remoteControlClient = new RemoteControlClient(mediaPendingIntent); + int controlFlags; + if (android.os.Build.VERSION.SDK_INT < 16) { + controlFlags = RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE | RemoteControlClient.FLAG_KEY_MEDIA_NEXT; + } else { + controlFlags = RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE; + } remoteControlClient - .setTransportControlFlags(RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE); + .setTransportControlFlags(controlFlags); return remoteControlClient; } @@ -963,9 +969,9 @@ public class PlaybackService extends Service { .editMetadata(false); editor.putString(MediaMetadataRetriever.METADATA_KEY_TITLE, media.getItem().getTitle()); - editor.putLong( + /* editor.putLong( MediaMetadataRetriever.METADATA_KEY_DURATION, - media.getDuration()); + media.getDuration());*/ editor.putString(MediaMetadataRetriever.METADATA_KEY_ALBUM, media.getItem().getFeed().getTitle()); |