Loading android/app/src/com/android/bluetooth/avrcp/AddressedMediaPlayer.java +17 −1 Original line number Diff line number Diff line Loading @@ -48,6 +48,9 @@ public class AddressedMediaPlayer { private static final long SINGLE_QID = 1; private static final String UNKNOWN_TITLE = "(unknown)"; static private final String GPM_BUNDLE_METADATA_KEY = "com.google.android.music.mediasession.music_metadata"; private AvrcpMediaRspInterface mMediaInterface; @NonNull private List<MediaSession.QueueItem> mNowPlayingList; Loading Loading @@ -163,6 +166,7 @@ public class AddressedMediaPlayer { private Bundle fillBundle(MediaMetadata metadata, Bundle currentExtras) { if (metadata == null) { Log.i(TAG, "fillBundle: metadata is null"); return currentExtras; } Loading Loading @@ -363,10 +367,22 @@ public class AddressedMediaPlayer { MediaDescription desc = item.getDescription(); Bundle extras = desc.getExtras(); boolean isCurrentTrack = item.getQueueId() == getActiveQueueItemId(mediaController); MediaMetadata data = null; if (isCurrentTrack) { if (DEBUG) Log.d(TAG, "getAttrValue: item is active, using current data"); extras = fillBundle(mediaController.getMetadata(), extras); data = mediaController.getMetadata(); if (data == null) Log.e(TAG, "getMetadata didn't give us any metadata for the current track"); } if (data == null) { // TODO: This code can be removed when b/63117921 is resolved data = (MediaMetadata) extras.get(GPM_BUNDLE_METADATA_KEY); extras = null; // We no longer need the data in here } extras = fillBundle(data, extras); if (DEBUG) Log.d(TAG, "getAttrValue: item " + item + " : " + desc); switch (attr) { case AvrcpConstants.ATTRID_TITLE: Loading Loading
android/app/src/com/android/bluetooth/avrcp/AddressedMediaPlayer.java +17 −1 Original line number Diff line number Diff line Loading @@ -48,6 +48,9 @@ public class AddressedMediaPlayer { private static final long SINGLE_QID = 1; private static final String UNKNOWN_TITLE = "(unknown)"; static private final String GPM_BUNDLE_METADATA_KEY = "com.google.android.music.mediasession.music_metadata"; private AvrcpMediaRspInterface mMediaInterface; @NonNull private List<MediaSession.QueueItem> mNowPlayingList; Loading Loading @@ -163,6 +166,7 @@ public class AddressedMediaPlayer { private Bundle fillBundle(MediaMetadata metadata, Bundle currentExtras) { if (metadata == null) { Log.i(TAG, "fillBundle: metadata is null"); return currentExtras; } Loading Loading @@ -363,10 +367,22 @@ public class AddressedMediaPlayer { MediaDescription desc = item.getDescription(); Bundle extras = desc.getExtras(); boolean isCurrentTrack = item.getQueueId() == getActiveQueueItemId(mediaController); MediaMetadata data = null; if (isCurrentTrack) { if (DEBUG) Log.d(TAG, "getAttrValue: item is active, using current data"); extras = fillBundle(mediaController.getMetadata(), extras); data = mediaController.getMetadata(); if (data == null) Log.e(TAG, "getMetadata didn't give us any metadata for the current track"); } if (data == null) { // TODO: This code can be removed when b/63117921 is resolved data = (MediaMetadata) extras.get(GPM_BUNDLE_METADATA_KEY); extras = null; // We no longer need the data in here } extras = fillBundle(data, extras); if (DEBUG) Log.d(TAG, "getAttrValue: item " + item + " : " + desc); switch (attr) { case AvrcpConstants.ATTRID_TITLE: Loading