
The service handles three different types of `Intents`. Custom command and media command Intents created by the library and media button event Intents from other sources. Media commands from the library as well as from external sources have the action set to `android.intent.action.MEDIA_BUTTON`. If the data URI is set and can be used to identify a session then it is a library Intent. If the Intent is coming from an external KeyEvent, the service implementation is asked which session to use by calling `onGetSession(controllerInfo)` with the controller info being an anonymous legacy controller info. Intents representing a custom command are always coming from the library and hence always have a data URI. Issue: androidx/media#82 PiperOrigin-RevId: 453932972
Session module
This module provides media session functionality through which media information and controls can be exposed to the Android platform, as well as to other processes and applications.
Getting the module
The easiest way to get the module is to add it as a gradle dependency:
implementation 'androidx.media3:media3-session:1.X.X'
where 1.X.X
is the version, which must match the version of the other media
modules being used.
Alternatively, you can clone this GitHub project and depend on the module locally. Instructions for doing this can be found in the top level README.