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

Commit 650fa857 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "MediaController2: Implement get/setPlaylistParams"

parents 00715bc4 f6a39e49
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ oneway interface IMediaSession2 {
    //////////////////////////////////////////////////////////////////////////////////////////////
    void sendCommand(IMediaSession2Callback caller, in Bundle command, in Bundle args);
    void sendTransportControlCommand(IMediaSession2Callback caller,
            int commandCode, long arg);
            int commandCode, in Bundle args);

    //////////////////////////////////////////////////////////////////////////////////////////////
    // Get library service specific
+7 −3
Original line number Diff line number Diff line
@@ -599,9 +599,13 @@ public class MediaController2 implements AutoCloseable {
        return mProvider.getPlaylist_impl();
    }

    public @Nullable
    PlaylistParams getPlaylistParam() {
        return mProvider.getPlaylistParam_impl();
    /**
     * Returns the {@link PlaylistParams} for the current play list.
     * Can return {@code null} if the controller doesn't have enough permission, or if the session
     * has not set the parameters.
     */
    public @Nullable PlaylistParams getPlaylistParams() {
        return mProvider.getPlaylistParams_impl();
    }

    /**
+3 −0
Original line number Diff line number Diff line
@@ -108,6 +108,8 @@ public class MediaSession2 implements AutoCloseable {
    public static final int COMMAND_CODE_PREPARE_FROM_URI = 18;
    public static final int COMMAND_CODE_PREPARE_FROM_SEARCH = 19;

    public static final int COMMAND_CODE_PLAYBACK_SET_PLAYLIST_PARAMS = 20;

    /**
     * Define a command that a {@link MediaController2} can send to a {@link MediaSession2}.
     * <p>
@@ -237,6 +239,7 @@ public class MediaSession2 implements AutoCloseable {
            mCommands.add(new Command(COMMAND_CODE_PLAYBACK_REWIND));
            mCommands.add(new Command(COMMAND_CODE_PLAYBACK_SEEK_TO));
            mCommands.add(new Command(COMMAND_CODE_PLAYBACK_SET_CURRENT_PLAYLIST_ITEM));
            mCommands.add(new Command(COMMAND_CODE_PLAYBACK_SET_PLAYLIST_PARAMS));
        }

        public void removeCommand(Command command) {
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ public interface MediaController2Provider extends TransportControlProvider {
    void removePlaylistItem_impl(MediaItem2 index);
    void addPlaylistItem_impl(int index, MediaItem2 item);

    PlaylistParams getPlaylistParam_impl();
    PlaylistParams getPlaylistParams_impl();
    void setPlaylistParams_impl(PlaylistParams params);
    PlaybackState2 getPlaybackState_impl();
}