Skip to content

Harden ThreadSafeMediaPlayer#7308

Open
seadowg wants to merge 1 commit into
getodk:v2026.3.xfrom
seadowg:media-player
Open

Harden ThreadSafeMediaPlayer#7308
seadowg wants to merge 1 commit into
getodk:v2026.3.xfrom
seadowg:media-player

Conversation

@seadowg

@seadowg seadowg commented Jul 16, 2026

Copy link
Copy Markdown
Member

Address this crash report

Why is this the best possible solution? Were any other approaches considered?

It looks like it's still possible for MediaPlayer#prepare to throw an IllegalStateException. The approach taken here to minimize the impact of that is to treat that as a failed load (rather than a crash) and to "clean up" the MediaPlayer instance when errors occur - this prevents an instance in a bad state from being reused.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

Good to check audio playback for questions, selects and in the audio question itself. We don't have a way to reproduce the crash: this change shouldn't affect behaviour.

Before submitting this PR, please make sure you have:

  • added or modified tests for any new or changed behavior
  • run ./gradlew connectedAndroidTest (or ./gradlew testLab) and confirmed all checks still pass
  • added a comment above any new strings describing it for translators
  • added any new strings with date formatting to DateFormatsTest
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@seadowg seadowg changed the title Harden ThreadSafeMediaPlayer Harden ThreadSafeMediaPlayer Jul 16, 2026
@seadowg
seadowg marked this pull request as ready for review July 20, 2026 10:42
@seadowg
seadowg requested a review from grzesiek2010 July 20, 2026 10:42
@seadowg
seadowg changed the base branch from master to v2026.3.x July 20, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants