Loading media/java/android/media/MediaBrowser2.java +8 −8 Original line number Diff line number Diff line Loading @@ -88,14 +88,15 @@ public class MediaBrowser2 extends MediaController2 { public void onItemLoaded(@NonNull String mediaId, @Nullable MediaItem2 result) { } /** * Called when there's change in the search result. * Called when there's change in the search result requested by the previous * {@link MediaBrowser2#search(String, Bundle)}. * * @param query search query that you've specified with {@link #search(String, Bundle)} * @param extras extra bundle that you've specified with {@link #search(String, Bundle)} * @param totalItemCount The total item count for the search result * @param extras extra bundle * @param itemCount The item count for the search result */ public void onSearchResultChanged(@NonNull String query, @Nullable Bundle extras, int totalItemCount) { } int itemCount) { } /** * Called when the search result has been returned by the library service for the previous Loading Loading @@ -189,10 +190,9 @@ public class MediaBrowser2 extends MediaController2 { } /** * Send a search request to the library service. When there's a change, * {@link BrowserCallback#onSearchResultChanged(String, Bundle, int)} will be called with the * bundle that you've specified. You should call * {@link #getSearchResult(String, int, int, Bundle)} to get the actual search result. * Send a search request to the library service. When the search result is changed, * {@link BrowserCallback#onSearchResultChanged(String, Bundle, int)} will be called. You should * call {@link #getSearchResult(String, int, int, Bundle)} to get the actual search result. * * @param query search query. Should not be an empty string. * @param extras extra bundle Loading media/java/android/media/MediaLibraryService2.java +13 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,19 @@ public abstract class MediaLibraryService2 extends MediaSessionService2 { public void notifyChildrenChanged(@NonNull String parentId, @Nullable Bundle extras) { mProvider.notifyChildrenChanged_impl(parentId, extras); } /** * Notify controller about change in the search result. * * @param controller controller to notify * @param query previously sent search query from the controller. * @param extras extra bundle * @param itemCount the number of items that have been found in the search. */ public void notifySearchResultChanged(@NonNull ControllerInfo controller, @NonNull String query, @NonNull Bundle extras, int itemCount) { mProvider.notifySearchResultChanged_impl(controller, query, extras, itemCount); } } /** Loading media/java/android/media/update/MediaBrowser2Provider.java +3 −3 Original line number Diff line number Diff line Loading @@ -24,11 +24,11 @@ import android.os.Bundle; public interface MediaBrowser2Provider extends MediaController2Provider { void getLibraryRoot_impl(Bundle rootHints); void subscribe_impl(String parentId, Bundle options); void unsubscribe_impl(String parentId, Bundle options); void subscribe_impl(String parentId, Bundle extras); void unsubscribe_impl(String parentId, Bundle extras); void getItem_impl(String mediaId); void getChildren_impl(String parentId, int page, int pageSize, Bundle extras); void search_impl(String query, Bundle options); void search_impl(String query, Bundle extras); void getSearchResult_impl(String query, int page, int pageSize, Bundle extras); } media/java/android/media/update/MediaLibraryService2Provider.java +4 −2 Original line number Diff line number Diff line Loading @@ -30,8 +30,10 @@ public interface MediaLibraryService2Provider extends MediaSessionService2Provid // Nothing new for now interface MediaLibrarySessionProvider extends MediaSession2Provider { void notifyChildrenChanged_impl(ControllerInfo controller, String parentId, Bundle options); void notifyChildrenChanged_impl(String parentId, Bundle options); void notifyChildrenChanged_impl(ControllerInfo controller, String parentId, Bundle extras); void notifyChildrenChanged_impl(String parentId, Bundle extras); void notifySearchResultChanged_impl(ControllerInfo controller, String query, Bundle extras, int itemCount); } interface LibraryRootProvider { Loading Loading
media/java/android/media/MediaBrowser2.java +8 −8 Original line number Diff line number Diff line Loading @@ -88,14 +88,15 @@ public class MediaBrowser2 extends MediaController2 { public void onItemLoaded(@NonNull String mediaId, @Nullable MediaItem2 result) { } /** * Called when there's change in the search result. * Called when there's change in the search result requested by the previous * {@link MediaBrowser2#search(String, Bundle)}. * * @param query search query that you've specified with {@link #search(String, Bundle)} * @param extras extra bundle that you've specified with {@link #search(String, Bundle)} * @param totalItemCount The total item count for the search result * @param extras extra bundle * @param itemCount The item count for the search result */ public void onSearchResultChanged(@NonNull String query, @Nullable Bundle extras, int totalItemCount) { } int itemCount) { } /** * Called when the search result has been returned by the library service for the previous Loading Loading @@ -189,10 +190,9 @@ public class MediaBrowser2 extends MediaController2 { } /** * Send a search request to the library service. When there's a change, * {@link BrowserCallback#onSearchResultChanged(String, Bundle, int)} will be called with the * bundle that you've specified. You should call * {@link #getSearchResult(String, int, int, Bundle)} to get the actual search result. * Send a search request to the library service. When the search result is changed, * {@link BrowserCallback#onSearchResultChanged(String, Bundle, int)} will be called. You should * call {@link #getSearchResult(String, int, int, Bundle)} to get the actual search result. * * @param query search query. Should not be an empty string. * @param extras extra bundle Loading
media/java/android/media/MediaLibraryService2.java +13 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,19 @@ public abstract class MediaLibraryService2 extends MediaSessionService2 { public void notifyChildrenChanged(@NonNull String parentId, @Nullable Bundle extras) { mProvider.notifyChildrenChanged_impl(parentId, extras); } /** * Notify controller about change in the search result. * * @param controller controller to notify * @param query previously sent search query from the controller. * @param extras extra bundle * @param itemCount the number of items that have been found in the search. */ public void notifySearchResultChanged(@NonNull ControllerInfo controller, @NonNull String query, @NonNull Bundle extras, int itemCount) { mProvider.notifySearchResultChanged_impl(controller, query, extras, itemCount); } } /** Loading
media/java/android/media/update/MediaBrowser2Provider.java +3 −3 Original line number Diff line number Diff line Loading @@ -24,11 +24,11 @@ import android.os.Bundle; public interface MediaBrowser2Provider extends MediaController2Provider { void getLibraryRoot_impl(Bundle rootHints); void subscribe_impl(String parentId, Bundle options); void unsubscribe_impl(String parentId, Bundle options); void subscribe_impl(String parentId, Bundle extras); void unsubscribe_impl(String parentId, Bundle extras); void getItem_impl(String mediaId); void getChildren_impl(String parentId, int page, int pageSize, Bundle extras); void search_impl(String query, Bundle options); void search_impl(String query, Bundle extras); void getSearchResult_impl(String query, int page, int pageSize, Bundle extras); }
media/java/android/media/update/MediaLibraryService2Provider.java +4 −2 Original line number Diff line number Diff line Loading @@ -30,8 +30,10 @@ public interface MediaLibraryService2Provider extends MediaSessionService2Provid // Nothing new for now interface MediaLibrarySessionProvider extends MediaSession2Provider { void notifyChildrenChanged_impl(ControllerInfo controller, String parentId, Bundle options); void notifyChildrenChanged_impl(String parentId, Bundle options); void notifyChildrenChanged_impl(ControllerInfo controller, String parentId, Bundle extras); void notifyChildrenChanged_impl(String parentId, Bundle extras); void notifySearchResultChanged_impl(ControllerInfo controller, String query, Bundle extras, int itemCount); } interface LibraryRootProvider { Loading