aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/github
diff options
context:
space:
mode:
authorGlenn Guy <glennguy83@gmail.com>2018-10-11 23:50:22 +1100
committerGlenn Guy <glennguy83@gmail.com>2018-10-11 23:50:22 +1100
commit0ac0bc63b0035c8d781be884c84273fd6c363e82 (patch)
tree0f28dc328ad979e0dc9984c550066fd6077b4ab2 /app/src/main/java/github
parent73f5e04e0ddd23a8477ee0c9c4b3364817addede (diff)
downloaddsub-0ac0bc63b0035c8d781be884c84273fd6c363e82.tar.gz
dsub-0ac0bc63b0035c8d781be884c84273fd6c363e82.tar.bz2
dsub-0ac0bc63b0035c8d781be884c84273fd6c363e82.zip
Fix metadata lag and missing artist/album/duration on Pie
Android Pie takes the metadata from the queue. Missing the Description (album) metadata seems to cause it to wait a few seconds (this error in the log - `2018-10-11 23:39:14.757 31985-31985/? D/NewAvrcpMediaPlayerWrapper: Metadata currently out of sync for github.daneren2005.dsub`) before sending the info over AVRCP.
Diffstat (limited to 'app/src/main/java/github')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/compat/RemoteControlClientLP.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/util/compat/RemoteControlClientLP.java b/app/src/main/java/github/daneren2005/dsub/util/compat/RemoteControlClientLP.java
index c5ce0868..b27a9850 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/compat/RemoteControlClientLP.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/compat/RemoteControlClientLP.java
@@ -221,11 +221,16 @@ public class RemoteControlClientLP extends RemoteControlClientBase {
for(DownloadFile file: playlist) {
Entry entry = file.getSong();
+ Bundle extras = new Bundle();
+ extras.putLong(MediaMetadataCompat.METADATA_KEY_DURATION,
+ ((entry.getDuration() == null) ? 0 : (entry.getDuration() * 1000)));
MediaDescriptionCompat description = new MediaDescriptionCompat.Builder()
.setMediaId(entry.getId())
.setTitle(entry.getTitle())
- .setSubtitle(entry.getAlbumDisplay())
+ .setSubtitle(entry.getArtist())
+ .setDescription(entry.getAlbum())
+ .setExtras(extras)
.build();
MediaSessionCompat.QueueItem item = new MediaSessionCompat.QueueItem(description, entry.getId().hashCode());
queue.add(item);