Add constructor that takes only a Context

#minor-release

PiperOrigin-RevId: 604659845
This commit is contained in:
bachinger 2024-02-06 08:44:17 -08:00 committed by Copybara-Service
parent f8f6d80477
commit c2273345c5
2 changed files with 15 additions and 0 deletions

View File

@ -22,6 +22,8 @@
* Session: * Session:
* Fix issue where `MediaItem.RequestMetadata` with just non-null extras is * Fix issue where `MediaItem.RequestMetadata` with just non-null extras is
not sent transmitted between media controllers and sessions. not sent transmitted between media controllers and sessions.
* Add constructor to `MediaLibrarySession.Builder` that only takes a
`Context` instead of a `MediaLibraryService`.
* UI: * UI:
* Downloads: * Downloads:
* OkHttp Extension: * OkHttp Extension:

View File

@ -413,6 +413,19 @@ public abstract class MediaLibraryService extends MediaSessionService {
super(service, player, callback); super(service, player, callback);
} }
/**
* Creates a builder for {@link MediaLibrarySession}.
*
* @param context The {@link Context}.
* @param player The underlying player to perform playback and handle transport controls.
* @param callback The callback to handle requests from {@link MediaBrowser}.
* @throws IllegalArgumentException if {@link Player#canAdvertiseSession()} returns false.
*/
@UnstableApi
public Builder(Context context, Player player, Callback callback) {
super(context, player, callback);
}
/** /**
* Sets a {@link PendingIntent} to launch an {@link android.app.Activity} for the {@link * Sets a {@link PendingIntent} to launch an {@link android.app.Activity} for the {@link
* MediaLibrarySession}. This can be used as a quick link to an ongoing media screen. * MediaLibrarySession}. This can be used as a quick link to an ongoing media screen.