
When a Media3 controller calls play on a Media3 session, the call is currently not routed through the platform session at all. This means the usual exemption to start a FGS for media controller interactions is not triggered. We can manually ensure this exemption is given by sending a custom platform command to the session. The Media3 session will never receive this command as it's not a known Media3 custom command. Sessions will see a single onConnect call with a platform controller from the sender app though. We can prevent this on newer versions of the code by dropping the onCommand call early. PiperOrigin-RevId: 679115247
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.