15 Commits

Author SHA1 Message Date
Gaëtan Muller
71b8c32a6f Remove Multidex 2024-07-24 16:17:00 +01:00
tonihei
16df05ec29 Upgrade Gradle and AGP
The newer versions include a bugfix that automatically highlights
when our project requires enhanced Java 8 desugaring.

Issue: androidx/media#1312
PiperOrigin-RevId: 631373018
2024-05-07 04:20:55 -07:00
ibaker
fd268eed46 Remove unecessary re-setting of group from session Gradle files
These TODOs precede <unknown commit> when the group was set in the top-level
`build.gradle` file.

Issue: androidx/media#1215
PiperOrigin-RevId: 618835040
2024-03-25 07:33:05 -07:00
ibaker
d997ba367c Rollback of 7cffae9cd0
PiperOrigin-RevId: 618799275
2024-03-25 04:30:55 -07:00
ibaker
7cffae9cd0 Apply common_library_config in test_session_current/build.gradle
This is the only `build.gradle` file that currently doesn't apply this
config, and it seems to lead to desugaring errors when apps depend on
the library locally.

PiperOrigin-RevId: 613559535
2024-03-07 06:14:25 -08:00
tonihei
f0cab4d03e Rollback of 64bd3bcad3
PiperOrigin-RevId: 574766164
2023-10-19 01:06:08 -07:00
Googler
1a43aa3602 Rollback of 64bd3bcad3
PiperOrigin-RevId: 574290408
2023-10-17 16:01:10 -07:00
bachinger
64bd3bcad3 Send media button events from service directly using MediaSessionImpl
Media button event coming from the `MediaSessionService` are delegated
to the `MediaSessionImpl` and then sent to the session by using the
`MediaSessionStub` directly instead of using the `MediaController`
API.

Splitting the `MediaController.Listener` and `Player.Listener` in
`MediaNotificationManager` got reverted, and both listener are set to the
controller as before. This reverts the change that introduced a
different timing behaviour. It still holds, that a listener
registered on a `MediaController` that calls a method like `play()` is
called immediately and before the call has arrived at the player. This
change works around this behaviour from the library side by calling
`MediaSessionStub` directly with a `ControllerInfo`.

#minor-release

PiperOrigin-RevId: 573918850
2023-10-16 13:52:30 -07:00
jbibik
e63be0317f Add multidex Gradle dependency to test-session-current
#minor-release

PiperOrigin-RevId: 571347856
2023-10-06 08:46:11 -07:00
bachinger
742410d517 Use proxy controller to maintain platform session and notification
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
2023-09-22 06:36:22 -07:00
ibaker
b3db85133a Add android.namespace to all build.gradle files
This is a pre-requisite for the Android Studio upgrade assistant to
upgrade from AGP 7.2.2 to 8.0.1, otherwise it fails and complains
this is missing.

Issue: androidx/media#409
PiperOrigin-RevId: 533463246
2023-05-19 17:19:15 +01:00
christosts
2424ee7792 Misc fix in gradle build file
Issue: androidx/media#209

#minor-release

PiperOrigin-RevId: 490492223
2022-11-24 14:46:43 +00:00
tianyifeng
77fedd8d7d Load bitmaps for MediaMetadataCompat and handle the metadata updates.
* Add `Listener` in `MediaSession` with method `onNotificationRefreshRequired(MediaSession)`.
* Add `MediaSessionService` as the listener of the `MediaSession` when `MediaSession` is added to `MediaSessionService`
* Load bitmap when update metadata in `MediaSessionLegacyStub` and call `onNotificationRefreshRequired` when bitmap asynchronously arrives.

PiperOrigin-RevId: 485376145
2022-11-08 11:19:04 +00:00
tonihei
ac42b593cc Delay unbinding the controller until pending commands are handled.
Once a controller bound to a MediaSessionService unbinds, this service
may be destroyed immediately if this was the last bound controller and
the service isn't started in the foreground.

At the time of releasing the controller, there may still be pending
commands that need to be handled by the session service. These commands
may cause the session service to post a foreground notification to
keep it alive. So to avoid the destruction of the service while these
commands are still handled, we need to keep the controller bound.

We also add a timeout in case the session tasks are never completed
by the session implementation. In case the controller is destroyed,
the unbinding happens automatically by the system.

PiperOrigin-RevId: 463802220
2022-08-08 08:19:35 +00:00
Andrew Lewis
933e207b3e Update to androidx.media3
PiperOrigin-RevId: 405656499
2021-10-27 09:12:46 +01:00