The new asset loader is a wrapper around a provided `MediaProjection` and
`SurfaceAssetLoader`.
The test relies on automating the UI to get a `MediaProjection` instance, which
doesn't work reliably on all devices, so it's restricted to Pixel devices from
API 29 onwards.
For now only video is supported. The plan is to add support for audio playback
capture (also using `MediaProjection`) in a later change(s).
PiperOrigin-RevId: 725241962
Take care of releasing the player and re-initialising when returning to the app to prevent memory leaks.
Instead of overriding onStart, onPause, onResume, onStop - use Lifecycle*Effects for a more native compose cleanup. Requires a higher version of the lifecycle library.
PiperOrigin-RevId: 712542884
This only affects the default SDK level that Robolectric tests run at.
Also upgrade the Robolectric version to 4.14.1 to pick up
4f32042afe
which is needed for async `ShadowMediaCodec` support (the default in
ExoPlayer from API 31+).
Some tests fail on Robolectric at API 31. This change configures them to
continue running on API 30, so the failures can be investigated and
fixed in follow-up changes.
PiperOrigin-RevId: 702357124
This should have no influence on app behavior and other policies
and just allows code to depend on new API 35 platform symbols.
PiperOrigin-RevId: 652414026
All other AndroidX libraries have already increased their min SDK to
21.
This change renames private symbols to remove `V21` suffixes and
similar, but doesn't change public or protected symbols with similar
names, to avoid needless breakages/churn on users of the library.
Some of the dead code removal is more complex, so I've split it out
into follow-up changes to make it easier to review.
PiperOrigin-RevId: 651776556
We now depend on Kotlin from both `annotation` and
`annotation-experimental`, so it's not really possible to avoid
depending on it from any module now.
PiperOrigin-RevId: 650251094
I originally tried switching to `Futures.addCallback` (as a follow-up
to Issue: androidx/media#890), but it seemed like a good chance to go further into
Kotlin-ification.
Before this change, if the connection to the session failed, the app
would hang at the 'waiting' screen with nothing logged (and the music
keeps playing). This behaviour is maintained with the `try/catch` around
the `.await()` call (with additional logging). Without this, the failed
connection causes the `PlayerActivity` to crash and the music in the
background stops. The `try/catch` is used to flag to developers who
might be using this app as an example that connecting to the session
may fail, and they may want to handle that.
This change also switches `this.controller` to be `lateinit` instead of
nullable.
Issue: androidx/media#890
PiperOrigin-RevId: 638948568
https://truth.dev/faq#java8
Also use this change to remove most test usages of
`Lists.transform(...)` and replace them with `.stream().map(...)`.
PiperOrigin-RevId: 633523904
Earlier upgrade in 276e0655f4 was too high, since Android Studio Iguana is still bundled with Kotlin plugin with version `232-1.9.0-release-358-AS10227`. The result of the mismatched plugin is a build failure like:
`Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is XXX`
Although according to https://plugins.jetbrains.com/plugin/6954-kotlin, the 1.9.23 is already available. So we will be able to upgrade again soon.
Version 1.9.0 is still good enough for the compose compiler to be 1.5.0+ according to https://developer.android.com/jetpack/androidx/releases/compose-kotlin#pre-release_kotlin_compatibility
PiperOrigin-RevId: 619278402