androidx / androidx/media

Automotive sample crashes on emulators that do not display group titles

Open
#2,033 5 comments 0 reactions 1 assignee View on GitHub

@marcbaechinger is already working on this.

Since Jan 13, 2025.

bug
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Version

Media3 1.5.1

More version details

Modify the demo-session-automotive app to display group titles

  1. Checkout release 1.5.1.
  2. Open MediaItemTree.kt at line 100.
  3. Modify the buildMediaItem method to add a group title as follows:
    .setExtras(Bundle().apply { putString(MediaConstants.EXTRAS_KEY_CONTENT_STYLE_GROUP_TITLE, "Group title") })
    

Alternatively, apply the attached set_group_title.patch file using Git.
set_group_title.patch

Devices that reproduce the issue

Any emulator that is not able to display group titles, including the following:

  • Automotive (1408p landscape) emulator with Google Play API 34-ext9
  • Automotive Distant Display emulator with Google Play API 33
  • Automotive Large Portrait emulator API 33
  • Automotive Ultrawide API emulator 34-ext9
Devices that do not reproduce the issue

Devices capable of displaying group titles:

  • Automotive (1024p landscape) emulator API 32
  • A couple real vehicles I could test so far
Reproducible in the demo app?

Yes

Reproduction steps
  1. Launch the patched demo-session-automotive app on an Automotive emulator that does not support displaying group titles.
  2. Navigate to a screen that displays grouped content and their titles (Home, Album Folder, Artist Folder, Genre Folder)
  3. Scroll to the bottom of the content (list/grid).
  4. Perform a navigation action, such as:
    • Clicking on a browsable item.
    • Switching tabs.
    • Pressing the back button.

The app crashes with the following exception:

java.lang.IndexOutOfBoundsException: toIndex = n

Where n corresponds to the total number of items in the list/grid + 1, regardless of the index of the item you've clicked on.

Expected result

The app should navigate to the requested content without crashing.

Actual result

Only when the content (list/grid) is scrolled to the end, any navigation interaction triggers an IndexOutOfBoundsException.
See stacktrace.txt.

Media

Not applicable

Bug Report
  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.