
With this change, the notification controller that is connected by `MediaNotificationManager`, is used as a proxy controller of the System UI controller. An app can use the proxy at connection time and during the lifetime of the session for configuration of the platform session and the media notification on all API levels. This includes using custom layout and available player and session commands of the proxy to maintain the platform session (actions, custom actions, session extras) and the `MediaNotification.Provider`. The legacy System UI controller is hidden from the public API, instead the app interacts with the Media3 proxy: - System UI is hidden from `MediaSession.getConnectedControllers()`. - Calls from System UI to methods of `MediaSession.Callback`/ `MediaLibrarySession.Callback` are mapped to the `ControllerInfo` of the proxy controller. - When `getControllerForCurrentRequest()` is called during an operation of System UI the proxy `ControllerInfo` is returned. PiperOrigin-RevId: 567606117
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.