media: MediaSessionService never destroyed
Media3 Version
Media3 1.0.1
Devices that reproduce the issue
Android emulator API 33
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
I first mentioned this issue in #346.
- Connect MediaController in one process to MediaSession (via MediaSessionService) in another process.
- Perform some amount of player interaction, like starting and pausing playback.
- Release MediaController on client.
- Observe MediaController being disconnected on server side.
- For good measure, manually release MediaSession and Player from
MediaSession.Callback.onDisconnected() - Wait for a long time (30+ minutes)
- Observe that MediaSessionService.onDestroy() still has not been called
Notably this issue does not occur when there is no player interaction, i.e. Player and MediaSession created but not really used, e.g. no call to prepare().
Expected result
MediaSessionService.onDestroy() called shortly after MediaController released.
Actual result
MediaSessionService.onDestroy() never called.
Media
N/A
Bug Report
- You will email the zip file produced by
adb bugreportto dev.exoplayer@gmail.com after filing this issue.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 1
- Comments: 16 (5 by maintainers)
I have just run into this issue myself. I am glad to read here confirmation that
stopSelf()needs to be called explicitly. I don’t have a problem with it working this way, but can I request that the documentation be updated?What MediaSessionService documentation says:
The “released” link points at
MediaController.release(). There is some more relevant info in the preceding paragraph.