Automotive sample crashes on emulators that do not display group titles
@marcbaechinger is already working on this.
Since Jan 13, 2025.
- 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
- Checkout release 1.5.1.
- Open
MediaItemTree.ktat line 100. - Modify the
buildMediaItemmethod 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
- Launch the patched
demo-session-automotiveapp on an Automotive emulator that does not support displaying group titles. - Navigate to a screen that displays grouped content and their titles (Home, Album Folder, Artist Folder, Genre Folder)
- Scroll to the bottom of the content (list/grid).
- 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 bugreportto android-media-github@google.com after filing this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.