Skip to content

Some metadata fields amongst [author, writer, composer, description] are not forwarded in some LegacyConversions actions #3018

Closed

Description

@psam44

Version

Media3 1.9.0

More version details

No response

Devices that reproduce the issue

NA

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

NA

Expected result

  1. In LegacyConversions.convertToMediaDescriptionCompat(), when displayTitle is not set, the fallback tries to find three non-null properties named in MediaMetadataCompat.PREFERRED_DESCRIPTION_ORDER, which has 9 entries.
    Unfortunately, the associated mapper getText() considers only 7 cases.
    These are missing:
      case MediaMetadataCompat.METADATA_KEY_AUTHOR:
        return metadata.author;
      case MediaMetadataCompat.METADATA_KEY_DISPLAY_DESCRIPTION:
        return metadata.description;

This is a potential lack for a com.android.car.media.BrowseViewController consumer.

  1. In LegacyConversions.convertToMediaMetadataCompat(), these are missing:
    if (metadata.author != null) {
      builder.putText(MediaMetadataCompat.METADATA_KEY_AUTHOR, metadata.author);
    }
    if (metadata.writer != null) {
      builder.putText(MediaMetadataCompat.METADATA_KEY_WRITER, metadata.writer);
    }
    if (metadata.composer != null) {
      builder.putText(MediaMetadataCompat.METADATA_KEY_COMPOSER, metadata.composer);
    }

These lacks have an impact for a com.android.car.media.common.ui.PlaybackCardController consumer.
In android.support.v4.media.MediaMetadataCompat.getDescription(), when the key METADATA_KEY_DISPLAY_TITLE is absent, three fallback keys are looked for in PREFERRED_DESCRIPTION_ORDER, which has 7 entries and notably these:

            METADATA_KEY_WRITER,
            METADATA_KEY_AUTHOR,
            METADATA_KEY_COMPOSER

Note: METADATA_KEY_DISPLAY_SUBTITLE and METADATA_KEY_DISPLAY_DESCRIPTION are not mentioned here (anyway, v4.media or androidx.media are deprecated), contrary to the similar androidx.media3.session.legacy.MediaMetadataCompat.PREFERRED_DESCRIPTION_ORDER, but this is conformant to android.media.MediaMetadata.PREFERRED_DESCRIPTION_ORDER, so it should be correct.

Actual result

NA

Media

NA

Bug Report

Activity

  1. marcbaechinger commented on Jan 20, 2026

    @marcbaechinger
    Contributor

    Thanks for your report and the detailed analysis.

    I sent a change for review to cover these cases:

    • added MediaMetadata.author
    • added conversion from MediaMetadata to MediaMetdataCompat for author, writer and composer.
    • added author and display_description to getText()

    I also added a unit test to test this regression!

    Thanks again!

  2. marcbaechinger commented on Jan 21, 2026

    @marcbaechinger
    Contributor

    This is fixed as per the commit from above.

    Thanks for reporting!

  3. locked and limited conversation to collaborators on Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions