mirror of
https://github.com/androidx/media.git
synced 2025-05-16 12:09:50 +08:00

These constructors are currently very intertwined, passing `this` references from the constructor of one to the constructor of another before the first constructor is complete (and so the `this` reference isn't really valid yet). This change uses checker framework `@UnderInitialization` and `@NotOnlyInitialized` annotations to make it more clear that the references are not available yet. For the one 'direct' access needed in the second constructor (calling `getApplicationLooper()`) we now pass the `applicationLooper` directly alongside (to avoid needing to dereference the reference 'too early'). This change also ensures that where a class hierarchy has a 'dependent' class hierarchy, the 'subclass' instance is always used (by both subclass and superclass) without casting or manually hiding the superclass field, by defining an overridable `getFoo()` method instead and always using it. #minor-release PiperOrigin-RevId: 462335043 (cherry picked from commit 287c757944720c6804e8f1cc074e28134f7da528)
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.