Infinite time blocking may occurs in MediaSessionService.onUpdateNotification()
- Dominant language
- Java
- Stars
- 21.9k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Hi. I am using ExoPlayer's Media2 integration and I found an issue with MediaSessionService.
Using a dedicated thread instead of the main thread for handling media session callbacks, `SessionPlayerConnecter` may be stuck in a certain situation. (However, I am not sure that this is an ExoPlayer's bug, the Media2 library's bug, or just my fault.)
## Steps to reproduce the issue
1. Clone the following repository (branch: `feature/exoplayer-on-update-notification-issue`)
- https://github.com/h6ah4i/Media2Experiment/tree/feature/exoplayer-on-update-notification-issue
2. Open the project on Android Studio
3. Build and debug run on an emulator or a physical device
4. Click the `[4] ERROR_NO_EXIST_FILE` item listed on the playlist
- :point_right: this triggers an error due to trying to play no existed media file
5. Click the **Pause Program** button of the debugger
6. You can see the following call stack

## Expected behavior
No stucking in `MediaSessionService.onUpdateNotification()`.
---
- ExoPlayer version number: r2.14.0
- AndroidX Media2 version: 1.1.3
- Android version: 9 (API level 28)
- Android device: Emulator
[bugreport-sdk_gphone_x86_arm-PSR1.180720.117-2021-06-12-22-08-58.zip](https://github.com/google/ExoPlayer/files/6642239/bugreport-sdk_gphone_x86_arm-PSR1.180720.117-2021-06-12-22-08-58.zip)
Thanks.
Contributor guide
Assessment
This issue has not been assessed yet.