Added media details to dummy notification

This commit is contained in:
ByteHamster 2019-08-30 10:27:24 +02:00
parent f0acfa4263
commit e6ad131d37
1 changed files with 6 additions and 0 deletions

View File

@ -444,6 +444,12 @@ public class PlaybackService extends MediaBrowserServiceCompat {
if (!stateManager.isInForeground()) { if (!stateManager.isInForeground()) {
PlaybackServiceNotificationBuilder notificationBuilder = new PlaybackServiceNotificationBuilder(this); PlaybackServiceNotificationBuilder notificationBuilder = new PlaybackServiceNotificationBuilder(this);
if (mediaPlayer != null && getPlayable() != null) {
notificationBuilder.addMetadata(getPlayable(), mediaSession.getSessionToken(), getStatus(), isCasting);
if (notificationBuilder.isIconCached(getPlayable())) {
notificationBuilder.loadIcon(getPlayable());
}
}
startForeground(NOTIFICATION_ID, notificationBuilder.build()); startForeground(NOTIFICATION_ID, notificationBuilder.build());
} }