mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00

Future.isDone and getDone doesn't imply the Future was successful and it may have been cancelled or failed. In case where we handle failure, we should also handle cancellation to avoid CancellationException to bubble up unchecked. In demo app code where we use isDone for field initialization, we want to crash in the failure case (usually security exception where the connection is disallowed), but we want to gracefully handle cancellation. Cancellation of these variables usually happens in Activity.onDestroy/onStop, but methods may be called after this point. #minor-release PiperOrigin-RevId: 572178018 (cherry picked from commit fe7c62afe0b39f8d6617cf610dbdccc9e6adcfb4)
Media session demo
This app demonstrates use of media sessions. It's a reference app written in Kotlin, which demonstrates best practices for media apps that want to advertise media sessions.
See the demos README for instructions on how to build and run this demo.