Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0179a3a authored by Hyundo Moon's avatar Hyundo Moon Committed by Android (Google) Code Review
Browse files

Merge "MediaSession2: Convert DataSourceDesc to MediaItem2 in MyPlayerEventCallback" into pi-dev

parents 0b795eb8 e14acb53
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -329,4 +329,19 @@ public abstract class MediaPlaylistAgent {
    public void setShuffleMode(@ShuffleMode int shuffleMode) {
        mProvider.setShuffleMode_impl(shuffleMode);
    }

    /**
     * Gets a {@link MediaItem2} in the playlist that matches given {@code dsd}.
     * You can override this method to have more finer control of updating {@link DataSourceDesc}
     * on items in the playlist.
     *
     * @return A {@link MediaItem2} object in the playlist that matches given {@code dsd}.
     *         {@code null} if playlist is not set, or if the playlist has no matching item.
     * @throws IllegalArgumentException if {@code dsd} is null
     * @hide
     */
    // TODO(jaewan): Unhide
    public @Nullable MediaItem2 getMediaItem(@NonNull DataSourceDesc dsd) {
        return mProvider.getMediaItem_impl(dsd);
    }
}
+3 −0
Original line number Diff line number Diff line
@@ -1651,6 +1651,7 @@ public class MediaSession2 implements AutoCloseable {
     * @return player state
     * @hide
     */
    // TODO(jaewan): Unhide (b/74578458)
    public @PlayerState int getPlayerState() {
        // TODO(jaewan): implement this (b/74578458)
        return PLAYER_STATE_IDLE;
@@ -1662,6 +1663,7 @@ public class MediaSession2 implements AutoCloseable {
     * @return position
     * @hide
     */
    // TODO(jaewan): Unhide (b/74578458)
    public long getCurrentPosition() {
        // TODO(jaewan): implement this (b/74578458)
        return -1;
@@ -1673,6 +1675,7 @@ public class MediaSession2 implements AutoCloseable {
     * @return buffered position
     * @hide
     */
    // TODO(jaewan): Unhide (b/74578458)
    public long getBufferedPosition() {
        // TODO(jaewan): implement this (b/74578458)
        return -1;
+2 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.media.update;

import android.media.DataSourceDesc;
import android.media.MediaItem2;
import android.media.MediaMetadata2;
import android.media.MediaPlaylistAgent.PlaylistEventCallback;
@@ -50,4 +51,5 @@ public interface MediaPlaylistAgentProvider {
    void setRepeatMode_impl(int repeatMode);
    int getShuffleMode_impl();
    void setShuffleMode_impl(int shuffleMode);
    MediaItem2 getMediaItem_impl(DataSourceDesc dsd);
}