public final class

MediaLibraryService.MediaLibrarySession

extends MediaSession

 java.lang.Object

androidx.media2.MediaSession

↳androidx.media2.MediaLibraryService.MediaLibrarySession

Overview

Session for the MediaLibraryService. Build this object with MediaLibraryService.MediaLibrarySession.Builder and return in MediaLibraryService.onGetSession().

Summary

Methods
public voidnotifyChildrenChanged(MediaSession.ControllerInfo controller, java.lang.String parentId, int itemCount, MediaLibraryService.LibraryParams params)

Notify the controller of the change in a parent's children.

public voidnotifyChildrenChanged(java.lang.String parentId, int itemCount, MediaLibraryService.LibraryParams params)

Notify all controllers that subscribed to the parent about change in the parent's children, regardless of the library params supplied by MediaBrowser.

public voidnotifySearchResultChanged(MediaSession.ControllerInfo controller, java.lang.String query, int itemCount, MediaLibraryService.LibraryParams params)

Notify controller about change in the search result.

from MediaSessionbroadcastCustomCommand, close, getConnectedControllers, getId, getPlayer, getSessionCompat, getToken, isClosed, sendCustomCommand, setAllowedCommands, setCustomLayout, updatePlayer
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods

public void notifyChildrenChanged(MediaSession.ControllerInfo controller, java.lang.String parentId, int itemCount, MediaLibraryService.LibraryParams params)

Notify the controller of the change in a parent's children.

If the controller hasn't subscribed to the parent, the API will do nothing.

Controllers will use MediaBrowser to get the list of children.

Parameters:

controller: controller to notify
parentId: non-empty parent id with changes in its children
itemCount: number of children.
params: library params

public void notifyChildrenChanged(java.lang.String parentId, int itemCount, MediaLibraryService.LibraryParams params)

Notify all controllers that subscribed to the parent about change in the parent's children, regardless of the library params supplied by MediaBrowser.

Parameters:

parentId: non-empty parent id
itemCount: number of children
params: library params

public void notifySearchResultChanged(MediaSession.ControllerInfo controller, java.lang.String query, int itemCount, MediaLibraryService.LibraryParams params)

Notify controller about change in the search result.

Parameters:

controller: controller to notify
query: previously sent non-empty search query from the controller.
itemCount: the number of items that have been found in the search.
params: library params