This commit is contained in:
Joshua Bahnsen 2013-02-22 14:57:28 -07:00
commit edd5fdb5a5
2 changed files with 6 additions and 1 deletions

View File

@ -800,6 +800,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
remoteControlClientCompat
.editMetadata(true)
.putString(MediaMetadataRetriever.METADATA_KEY_TITLE, title)
.putString(MediaMetadataRetriever.METADATA_KEY_ARTIST, currentSong.getArtist())
.putString(MediaMetadataRetriever.METADATA_KEY_ALBUM, album)
.putLong(MediaMetadataRetriever.METADATA_KEY_DURATION, duration)
.putBitmap(RemoteControlClientCompat.MetadataEditorCompat.METADATA_KEY_ARTWORK, bitmap)
@ -875,7 +876,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
mp.start();
setPlayerState(STARTED);
} else {
setPlayerState(PAUSED);
setPlayerState(STOPPED);
}
lifecycleSupport.serializeDownloadQueue();

View File

@ -200,6 +200,8 @@ public class DownloadServiceLifecycleSupport {
// Work-around: Serialize again, as the restore() method creates a serialization without current playing info.
serializeDownloadQueue();
downloadService.setPlayerState(PlayerState.STOPPED);
}
private void handleKeyEvent(KeyEvent event) {
@ -209,6 +211,8 @@ public class DownloadServiceLifecycleSupport {
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
case KeyEvent.KEYCODE_MEDIA_PLAY:
case KeyEvent.KEYCODE_MEDIA_PAUSE:
case KeyEvent.KEYCODE_HEADSETHOOK:
downloadService.togglePlayPause();
break;