Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b78af14 authored by Robert Snoeberger's avatar Robert Snoeberger Committed by Android (Google) Code Review
Browse files

Merge "Avoid loading app icon bitmap when possible"

parents 485fce2a ecc8fa85
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -251,10 +251,9 @@ public class MediaControlPanel {
        // App icon
        ImageView appIcon = mViewHolder.getAppIcon();
        if (data.getAppIcon() != null) {
            appIcon.setImageDrawable(data.getAppIcon());
            appIcon.setImageIcon(data.getAppIcon());
        } else {
            Drawable iconDrawable = mContext.getDrawable(R.drawable.ic_music_note);
            appIcon.setImageDrawable(iconDrawable);
            appIcon.setImageResource(R.drawable.ic_music_note);
        }

        // Song name
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ data class MediaData(
    /**
     * Icon shown on player, close to app name.
     */
    val appIcon: Drawable?,
    val appIcon: Icon?,
    /**
     * Artist name.
     */
+2 −2
Original line number Diff line number Diff line
@@ -455,7 +455,7 @@ class MediaDataManager(
        val app = builder.loadHeaderAppName()

        // App Icon
        val smallIconDrawable: Drawable = sbn.notification.smallIcon.loadDrawable(context)
        val smallIcon = sbn.notification.smallIcon

        // Song name
        var song: CharSequence? = metadata?.getString(MediaMetadata.METADATA_KEY_DISPLAY_TITLE)
@@ -518,7 +518,7 @@ class MediaDataManager(
            val hasCheckedForResume = mediaEntries[key]?.hasCheckedForResume == true
            val active = mediaEntries[key]?.active ?: true
            onMediaDataLoaded(key, oldKey, MediaData(sbn.normalizedUserId, true, bgColor, app,
                    smallIconDrawable, artist, song, artWorkIcon, actionIcons,
                    smallIcon, artist, song, artWorkIcon, actionIcons,
                    actionsToShowCollapsed, sbn.packageName, token, notif.contentIntent, null,
                    active, resumeAction = resumeAction, isLocalSession = isLocalSession,
                    notificationKey = key, hasCheckedForResume = hasCheckedForResume,