* @param rootMediaId media id of the library root. Can be {@code null}
* @param rootExtra extra of the library root. Can be {@code null}
*/
- public void onGetRootResult(Bundle rootHints, @Nullable String rootMediaId,
+ public void onGetLibraryRootDone(Bundle rootHints, @Nullable String rootMediaId,
@Nullable Bundle rootExtra) { }
/**
* {@link MediaLibrarySession#notifyChildrenChanged(String, int, Bundle)} for the parent.
*
* @param parentId parent id that you've specified with {@link #subscribe(String, Bundle)}
- * @param childCount number of children
+ * @param itemCount number of children
* @param extras extra bundle from the library service. Can be differ from extras that
* you've specified with {@link #subscribe(String, Bundle)}.
*/
- public void onChildrenChanged(@NonNull String parentId, int childCount,
+ public void onChildrenChanged(@NonNull String parentId, int itemCount,
@Nullable Bundle extras) { }
/**
* @param result result. Can be {@code null}
* @param extras extra bundle from the library service
*/
- public void onChildrenLoaded(@NonNull String parentId, int page, int pageSize,
+ public void onGetChildrenDone(@NonNull String parentId, int page, int pageSize,
@Nullable List<MediaItem2> result, @Nullable Bundle extras) { }
/**
* @param mediaId media id
* @param result result. Can be {@code null}
*/
- public void onItemLoaded(@NonNull String mediaId, @Nullable MediaItem2 result) { }
+ public void onGetItemDone(@NonNull String mediaId, @Nullable MediaItem2 result) { }
/**
* Called when there's change in the search result requested by the previous
* @param result result. Can be {@code null}.
* @param extras extra bundle from the library service
*/
- public void onSearchResultLoaded(@NonNull String query, int page, int pageSize,
+ public void onGetSearchResultDone(@NonNull String query, int page, int pageSize,
@Nullable List<MediaItem2> result, @Nullable Bundle extras) { }
}
/**
* Get the library root. Result would be sent back asynchronously with the
- * {@link BrowserCallback#onGetRootResult(Bundle, String, Bundle)}.
+ * {@link BrowserCallback#onGetLibraryRootDone(Bundle, String, Bundle)}.
*
* @param rootHints hint for the root
- * @see BrowserCallback#onGetRootResult(Bundle, String, Bundle)
+ * @see BrowserCallback#onGetLibraryRootDone(Bundle, String, Bundle)
*/
public void getLibraryRoot(Bundle rootHints) {
mProvider.getLibraryRoot_impl(rootHints);
/**
* Get list of children under the parent. Result would be sent back asynchronously with the
- * {@link BrowserCallback#onChildrenLoaded(String, int, int, List, Bundle)}.
+ * {@link BrowserCallback#onGetChildrenDone(String, int, int, List, Bundle)}.
*
* @param parentId parent id for getting the children.
* @param page page number to get the result. Starts from {@code 1}
/**
* Get the media item with the given media id. Result would be sent back asynchronously with the
- * {@link BrowserCallback#onItemLoaded(String, MediaItem2)}.
+ * {@link BrowserCallback#onGetItemDone(String, MediaItem2)}.
*
* @param mediaId media id for specifying the item
*/
/**
* Get the search result from lhe library service. Result would be sent back asynchronously with
- * the {@link BrowserCallback#onSearchResultLoaded(String, int, int, List, Bundle)}.
+ * the {@link BrowserCallback#onGetSearchResultDone(String, int, int, List, Bundle)}.
*
* @param query search query that you've specified with {@link #search(String, Bundle)}
* @param page page number to get search result. Starts from {@code 1}
*
* @param controller controller to notify
* @param parentId parent id with changes in its children
- * @param childCount number of children.
+ * @param itemCount number of children.
* @param extras extra information from session to controller
*/
public void notifyChildrenChanged(@NonNull ControllerInfo controller,
- @NonNull String parentId, int childCount, @Nullable Bundle extras) {
- mProvider.notifyChildrenChanged_impl(controller, parentId, childCount, extras);
+ @NonNull String parentId, int itemCount, @Nullable Bundle extras) {
+ mProvider.notifyChildrenChanged_impl(controller, parentId, itemCount, extras);
}
/**
* {@link MediaBrowser2#subscribe(String, Bundle)}.
*
* @param parentId parent id
- * @param childCount number of children
+ * @param itemCount number of children
* @param extras extra information from session to controller
*/
// This is for the backward compatibility.
- public void notifyChildrenChanged(@NonNull String parentId, int childCount,
+ public void notifyChildrenChanged(@NonNull String parentId, int itemCount,
@Nullable Bundle extras) {
- mProvider.notifyChildrenChanged_impl(parentId, childCount, extras);
+ mProvider.notifyChildrenChanged_impl(parentId, itemCount, extras);
}
/**
* @see LibraryRoot#EXTRA_OFFLINE
* @see LibraryRoot#EXTRA_SUGGESTED
*/
- public @Nullable LibraryRoot onGetRoot(@NonNull ControllerInfo controllerInfo,
+ public @Nullable LibraryRoot onGetLibraryRoot(@NonNull ControllerInfo controllerInfo,
@Nullable Bundle rootHints) {
return null;
}
* <p>
* Return {@code null} for no result or error.
*
- * @param itemId item id to get media item.
+ * @param mediaId item id to get media item.
* @return a media item. {@code null} for no result or error.
*/
- public @Nullable MediaItem2 onLoadItem(@NonNull ControllerInfo controllerInfo,
- @NonNull String itemId) {
+ public @Nullable MediaItem2 onGetItem(@NonNull ControllerInfo controllerInfo,
+ @NonNull String mediaId) {
return null;
}
* @param extras extra bundle
* @return list of children. Can be {@code null}.
*/
- public @Nullable List<MediaItem2> onLoadChildren(@NonNull ControllerInfo controller,
+ public @Nullable List<MediaItem2> onGetChildren(@NonNull ControllerInfo controller,
@NonNull String parentId, int page, int pageSize, @Nullable Bundle extras) {
return null;
}
/**
- * Called when a controller subscribed to the parent.
+ * Called when a controller subscribes to the parent.
* <p>
* It's your responsibility to keep subscriptions by your own and call
- * {@link MediaLibrarySession#notifyChildrenChanged(ControllerInfo, String, Bundle)} when
- * the parent is changed.
+ * {@link MediaLibrarySession#notifyChildrenChanged(ControllerInfo, String, int, Bundle)}
+ * when the parent is changed.
*
* @param controller controller
* @param parentId parent id
* @param extras extra bundle
*/
- public void onSubscribed(@NonNull ControllerInfo controller, @NonNull String parentId,
+ public void onSubscribe(@NonNull ControllerInfo controller, @NonNull String parentId,
@Nullable Bundle extras) {
}
/**
- * Called when a controller unsubscribed to the parent.
+ * Called when a controller unsubscribes to the parent.
*
* @param controller controller
* @param parentId parent id
*/
- public void onUnsubscribed(@NonNull ControllerInfo controller, @NonNull String parentId) {
+ public void onUnsubscribe(@NonNull ControllerInfo controller, @NonNull String parentId) {
}
/**
* @param extras The bundle of service-specific arguments sent from the media browser.
* @return search result. {@code null} for error.
*/
- public @Nullable List<MediaItem2> onLoadSearchResult(@NonNull ControllerInfo controllerInfo,
+ public @Nullable List<MediaItem2> onGetSearchResult(@NonNull ControllerInfo controllerInfo,
@NonNull String query, int page, int pageSize, @Nullable Bundle extras) {
return null;
}
* supplied as a root hint for retrieving media items that are recently played.
* If the media library service can provide such media items, the implementation must return
* the key in the root hint when
- * {@link MediaLibrarySessionCallback#onGetRoot(ControllerInfo, Bundle)} is called back.
+ * {@link MediaLibrarySessionCallback#onGetLibraryRoot(ControllerInfo, Bundle)} is called
+ * back.
*
* <p>The root hint may contain multiple keys.
*
* internet connection.
* If the media library service can provide such media items, the implementation must return
* the key in the root hint when
- * {@link MediaLibrarySessionCallback#onGetRoot(ControllerInfo, Bundle)} is called back.
+ * {@link MediaLibrarySessionCallback#onGetLibraryRoot(ControllerInfo, Bundle)} is called
+ * back.
*
* <p>The root hint may contain multiple keys.
*
* suggestion.
* If the media library service can provide such media items, the implementation must return
* the key in the root hint when
- * {@link MediaLibrarySessionCallback#onGetRoot(ControllerInfo, Bundle)} is called back.
+ * {@link MediaLibrarySessionCallback#onGetLibraryRoot(ControllerInfo, Bundle)} is called
+ * back.
*
* <p>The root hint may contain multiple keys.
*