Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automotive sample crashes on emulators that do not display group titles #2033

Open
1 task done
alx-jst opened this issue Jan 10, 2025 · 0 comments
Open
1 task done

Comments

@alx-jst
Copy link

alx-jst commented Jan 10, 2025

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 [email protected] after filing this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant