-
Use Futures for MediaSession command queue instead of Runnables · 481205a8
Some commands may be asynchronous and subsequent commands need to wait for them to complete before running. This change updates the queue to use (and listen to) Futures instead of calling Runnables directly. The commands are currently still added as Runanbles though, so this change is a no-op. Also moves the permission check in MediaSessionImpl to before queueing the command because the permission should be check at the time of calling the method. When executing the comamnds in the queue, we need to be careful to avoid recursion in the same thread (which happens when both the Future is immediate and running on the correct thread already). To avoid recursion, we detect this case and loop the commands instead. Issue: androidx/media#85 PiperOrigin-RevId: 461827264 (cherry picked from commit dee80788)
tonihei committed
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| aidl/androidx/media3/session | Loading commit data... | |
| java/androidx/media3/session | Loading commit data... | |
| res | Loading commit data... | |
| AndroidManifest.xml | Loading commit data... |