public abstract class MediaLibraryService
extends MediaSessionService

   ↳ android.content.Context
     ↳ android.content.ContextWrapper
         ↳ androidx.media2.session.MediaSessionService
           ↳ androidx.media2.session.MediaLibraryService

Base class for media library services, which is the service containing MediaLibraryService.MediaLibrarySession.

Media library services enable applications to browse media content provided by an application and ask the application to start playing it. They may also be used to control content that is already playing by way of a MediaSession.

When extending this class, also add the following to your AndroidManifest.xml.

 <service android:name="component_name_of_your_implementation" >
     <action android:name="androidx.media2.session.MediaLibraryService" />

You may also declare
for compatibility with MediaBrowserCompat. This service can handle it automatically.


Nested classes

class MediaLibraryService.LibraryParams

Contains information that the library service needs to send to the client. 

class MediaLibraryService.MediaLibrarySession

Session for the MediaLibraryService



The Intent that must be declared as handled by the service.

Inherited constants