diff --git a/media/java/android/media/MediaController2.java b/media/java/android/media/MediaController2.java index b51c662539cf6..40be018dc2c63 100644 --- a/media/java/android/media/MediaController2.java +++ b/media/java/android/media/MediaController2.java @@ -836,20 +836,30 @@ public class MediaController2 implements AutoCloseable { } /** - * Sets the index of current DataSourceDesc in the play list to be played. + * Skips to the item in the playlist. + *
+ * This calls {@link MediaPlaylistAgent#skipToPlaylistItem(MediaItem2)}. * - * @param item the index of DataSourceDesc in the play list you want to play - * @throws IllegalArgumentException if the play list is null - * @throws NullPointerException if index is outside play list range + * @param item The item in the playlist you want to play */ public void skipToPlaylistItem(@NonNull MediaItem2 item) { mProvider.skipToPlaylistItem_impl(item); } + /** + * Skips to the previous item in the playlist. + *
+ * This calls {@link MediaPlaylistAgent#skipToPreviousItem()}. + */ public void skipToPreviousItem() { mProvider.skipToPreviousItem_impl(); } + /** + * Skips to the next item in the playlist. + *
+ * This calls {@link MediaPlaylistAgent#skipToNextItem()}. + */ public void skipToNextItem() { mProvider.skipToNextItem_impl(); } diff --git a/media/java/android/media/MediaPlaylistAgent.java b/media/java/android/media/MediaPlaylistAgent.java index 1d7520ff9f0d9..65884743523ab 100644 --- a/media/java/android/media/MediaPlaylistAgent.java +++ b/media/java/android/media/MediaPlaylistAgent.java @@ -266,10 +266,16 @@ public abstract class MediaPlaylistAgent { mProvider.skipToPlaylistItem_impl(item); } + /** + * Skips to the previous item in the playlist. + */ public void skipToPreviousItem() { mProvider.skipToPreviousItem_impl(); } + /** + * Skips to the next item in the playlist. + */ public void skipToNextItem() { mProvider.skipToNextItem_impl(); } diff --git a/media/java/android/media/MediaSession2.java b/media/java/android/media/MediaSession2.java index 91bfacee97897..a7aa3a7fe64cf 100644 --- a/media/java/android/media/MediaSession2.java +++ b/media/java/android/media/MediaSession2.java @@ -1779,20 +1779,41 @@ public class MediaSession2 implements AutoCloseable { } /** - * Skip to the item in the play list. + * Skips to the item in the playlist. + *
+ * This calls {@link MediaPlaylistAgent#skipToPlaylistItem(MediaItem2)} and the behavior depends + * on the playlist agent implementation, especially with the shuffle/repeat mode. * - * @param item item in the play list you want to play - * @throws IllegalArgumentException if the play list is null - * @throws NullPointerException if index is outside play list range + * @param item The item in the playlist you want to play + * @see #getShuffleMode() + * @see #getRepeatMode() */ public void skipToPlaylistItem(@NonNull MediaItem2 item) { mProvider.skipToPlaylistItem_impl(item); } + /** + * Skips to the previous item. + *
+ * This calls {@link MediaPlaylistAgent#skipToPreviousItem()} and the behavior depends on the + * playlist agent implementation, especially with the shuffle/repeat mode. + * + * @see #getShuffleMode() + * @see #getRepeatMode() + **/ public void skipToPreviousItem() { mProvider.skipToPreviousItem_impl(); } + /** + * Skips to the next item. + *
+ * This calls {@link MediaPlaylistAgent#skipToNextItem()} and the behavior depends on the + * playlist agent implementation, especially with the shuffle/repeat mode. + * + * @see #getShuffleMode() + * @see #getRepeatMode() + */ public void skipToNextItem() { mProvider.skipToNextItem_impl(); }