OSDN Git Service

MediaBrowser2: Rearrange API arguments in relevant order
authorHyundo Moon <hdmoon@google.com>
Wed, 21 Feb 2018 10:10:09 +0000 (19:10 +0900)
committerHyundo Moon <hdmoon@google.com>
Wed, 21 Feb 2018 10:46:26 +0000 (19:46 +0900)
Test: Passed MediaBrowser2Test
Change-Id: Ic7a9955235e77d9d9bd9f59ac70987c1d6e61140

media/java/android/media/MediaBrowser2.java
media/java/android/media/MediaLibraryService2.java
media/java/android/media/update/MediaLibraryService2Provider.java

index 231a4a5..f03dbae 100644 (file)
@@ -56,7 +56,7 @@ public class MediaBrowser2 extends MediaController2 {
          * Called when there's change in the parent's children.
          *
          * @param parentId parent id that you've specified with {@link #subscribe(String, Bundle)}
-         * @param extras extra bundle that you've specified with {@link #subscribe(String, Bundle)}
+         * @param extras extra bundle from the library service
          */
         public void onChildrenChanged(@NonNull String parentId, @Nullable Bundle extras) { }
 
@@ -69,12 +69,11 @@ public class MediaBrowser2 extends MediaController2 {
          *             {@link #getChildren(String, int, int, Bundle)}
          * @param pageSize page size that you've specified with
          *                 {@link #getChildren(String, int, int, Bundle)}
-         * @param extras extra bundle that you've specified with
-         *                {@link #getChildren(String, int, int, Bundle)}
          * @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,
-                @Nullable Bundle extras, @Nullable List<MediaItem2> result) { }
+                @Nullable List<MediaItem2> result, @Nullable Bundle extras) { }
 
         /**
          * Called when the item has been returned by the library service for the previous
@@ -92,11 +91,11 @@ public class MediaBrowser2 extends MediaController2 {
          * {@link MediaBrowser2#search(String, Bundle)}.
          *
          * @param query search query that you've specified with {@link #search(String, Bundle)}
-         * @param extras extra bundle
          * @param itemCount The item count for the search result
+         * @param extras extra bundle from the library service
          */
-        public void onSearchResultChanged(@NonNull String query, @Nullable Bundle extras,
-                int itemCount) { }
+        public void onSearchResultChanged(@NonNull String query, int itemCount,
+                @Nullable Bundle extras) { }
 
         /**
          * Called when the search result has been returned by the library service for the previous
@@ -110,12 +109,11 @@ public class MediaBrowser2 extends MediaController2 {
          *             {@link #getSearchResult(String, int, int, Bundle)}
          * @param pageSize page size that you've specified with
          *                 {@link #getSearchResult(String, int, int, Bundle)}
-         * @param extras extra bundle that you've specified with
-         *                {@link #getSearchResult(String, int, int, Bundle)}
          * @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,
-                @Nullable Bundle extras, @Nullable List<MediaItem2> result) { }
+                @Nullable List<MediaItem2> result, @Nullable Bundle extras) { }
     }
 
     public MediaBrowser2(@NonNull Context context, @NonNull SessionToken2 token,
@@ -168,7 +166,7 @@ public class MediaBrowser2 extends MediaController2 {
 
     /**
      * Get list of children under the parent. Result would be sent back asynchronously with the
-     * {@link BrowserCallback#onChildrenLoaded(String, int, int, Bundle, List)}.
+     * {@link BrowserCallback#onChildrenLoaded(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}
@@ -191,7 +189,7 @@ public class MediaBrowser2 extends MediaController2 {
 
     /**
      * 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
+     * {@link BrowserCallback#onSearchResultChanged(String, int, Bundle)} 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.
@@ -203,7 +201,7 @@ public class MediaBrowser2 extends MediaController2 {
 
     /**
      * Get the search result from lhe library service. Result would be sent back asynchronously with
-     * the {@link BrowserCallback#onSearchResultLoaded(String, int, int, Bundle, List)}.
+     * the {@link BrowserCallback#onSearchResultLoaded(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}
index 95d83ee..c984697 100644 (file)
@@ -105,12 +105,12 @@ public abstract class MediaLibraryService2 extends MediaSessionService2 {
          *
          * @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.
+         * @param extras extra bundle
          */
         public void notifySearchResultChanged(@NonNull ControllerInfo controller,
-                @NonNull String query, @NonNull Bundle extras, int itemCount) {
-            mProvider.notifySearchResultChanged_impl(controller, query, extras, itemCount);
+                @NonNull String query, int itemCount, @NonNull Bundle extras) {
+            mProvider.notifySearchResultChanged_impl(controller, query, itemCount, extras);
         }
     }
 
index d837833..17eea84 100644 (file)
@@ -32,8 +32,8 @@ public interface MediaLibraryService2Provider extends MediaSessionService2Provid
     interface MediaLibrarySessionProvider extends MediaSession2Provider {
         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);
+        void notifySearchResultChanged_impl(ControllerInfo controller, String query, int itemCount,
+                Bundle extras);
     }
 
     interface LibraryRootProvider {