Hook for delaying MediaLibraryService.onDestroy() after session release
@marcbaechinger is already working on this.
Since Apr 30, 2025.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
I am seeing that MediaLibraryService.onDestroy() is called rapidly (almost instantly) after media session release. This may generally be considered desirable, but I also need a hook to properly release resources that release asynchronously (coroutine cancellation) prior to onDestroy() being called. I have not been able to find such a hook, despite trying various suspects.
The only thing that worked was blocking onDestroy() for a little while until coroutines have completed, but this is unacceptable, for obvious reasons.
My MediaLibrarySession runs off the main thread, so I could block in my custom thread if I could find a proper code location to insert some blocking code there.
Media3 1.6.1
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.