This CL adds following APIs:
- MediaPlayerInterface.set/getPlaylistParams()
- MediaSession2.set/getPlaylistParams()
- MediaController2.setPlaylistParams()
- ControllerCallback.onPlaylistParamsChanged()
Bug:
72537520
Test: Passed MediaSession2Test
Change-Id: I84ea00ee0876725af1c0e01ad50da15fdb222418
*/
oneway interface IMediaSession2Callback {
void onPlaybackStateChanged(in Bundle state);
+ void onPlaylistParamsChanged(in Bundle params);
/**
* Called only when the controller is created with service's token.
* @param state
*/
public void onPlaybackStateChanged(@NonNull PlaybackState2 state) { }
+
+ /**
+ * Called when the playlist parameters are changed.
+ *
+ * @param params The new play list parameters.
+ */
+ public void onPlaylistParamsChanged(@NonNull PlaylistParams params) { }
}
/**
}
/**
+ * Sets the {@link PlaylistParams} for the current play list. Repeat/shuffle mode and metadata
+ * for the list can be set by calling this method.
+ *
+ * @param params A {@link PlaylistParams} object to set.
+ * @throws IllegalArgumentException if given {@param param} is null.
+ */
+ public void setPlaylistParams(PlaylistParams params) {
+ mProvider.setPlaylistParams_impl(params);
+ }
+
+ /**
* @hide
*/
public void skipForward() {
void setPlaylist(List<MediaItem2> item, PlaylistParams param);
void setCurrentPlaylistItem(int index);
+ void setPlaylistParams(PlaylistParams params);
+ PlaylistParams getPlaylistParams();
/**
* Add a {@link PlaybackListener} to be invoked when the playback state is changed.
public void setPlaylist(@NonNull List<MediaItem2> playlist, @NonNull PlaylistParams param) {
mProvider.setPlaylist_impl(playlist, param);
}
+
+ /**
+ * Sets the {@link PlaylistParams} for the current play list. Repeat/shuffle mode and metadata
+ * for the list can be set by calling this method.
+ *
+ * @param params A {@link PlaylistParams} object to set.
+ * @throws IllegalArgumentException if given {@param param} is null.
+ */
+ public void setPlaylistParams(PlaylistParams params) {
+ mProvider.setPlaylistParams_impl(params);
+ }
+
+ /**
+ * Returns the {@link PlaylistParams} for the current play list.
+ * Returns {@code null} if not set.
+ */
+ public PlaylistParams getPlaylistParams() {
+ return mProvider.getPlaylistParams_impl();
+ }
}
void addPlaylistItem_impl(int index, MediaItem2 item);
PlaylistParams getPlaylistParam_impl();
+ void setPlaylistParams_impl(PlaylistParams params);
PlaybackState2 getPlaybackState_impl();
}
ResultReceiver receiver);
void sendCustomCommand_impl(Command command, Bundle args);
void setPlaylist_impl(List<MediaItem2> playlist, PlaylistParams param);
+ void setPlaylistParams_impl(PlaylistParams params);
+ PlaylistParams getPlaylistParams_impl();
interface ControllerInfoProvider {
String getPackageName_impl();