Merge "MediaSession2: Revisit command code" into pi-dev
am: ec0ab63ccb
Change-Id: I2827f7099008ebee00f9193e40258b74a0f5afec
This commit is contained in:
@@ -116,18 +116,20 @@ public class MediaSession2 implements AutoCloseable {
|
||||
/**
|
||||
* Command code for {@link MediaController2#skipToNextItem()}.
|
||||
* <p>
|
||||
* Command would be sent directly to the player if the session doesn't reject the request
|
||||
* through the {@link SessionCallback#onCommandRequest(MediaSession2, ControllerInfo, Command)}.
|
||||
* Command would be sent directly to the playlist agent if the session doesn't reject the
|
||||
* request through the {@link SessionCallback#onCommandRequest(
|
||||
* MediaSession2, ControllerInfo, Command)}.
|
||||
*/
|
||||
public static final int COMMAND_CODE_PLAYBACK_SKIP_NEXT_ITEM = 4;
|
||||
public static final int COMMAND_CODE_PLAYLIST_SKIP_NEXT_ITEM = 4;
|
||||
|
||||
/**
|
||||
* Command code for {@link MediaController2#skipToPreviousItem()}.
|
||||
* <p>
|
||||
* Command would be sent directly to the player if the session doesn't reject the request
|
||||
* through the {@link SessionCallback#onCommandRequest(MediaSession2, ControllerInfo, Command)}.
|
||||
* Command would be sent directly to the playlist agent if the session doesn't reject the
|
||||
* request through the {@link SessionCallback#onCommandRequest(
|
||||
* MediaSession2, ControllerInfo, Command)}.
|
||||
*/
|
||||
public static final int COMMAND_CODE_PLAYBACK_SKIP_PREV_ITEM = 5;
|
||||
public static final int COMMAND_CODE_PLAYLIST_SKIP_PREV_ITEM = 5;
|
||||
|
||||
/**
|
||||
* Command code for {@link MediaController2#prepare()}.
|
||||
@@ -275,48 +277,60 @@ public class MediaSession2 implements AutoCloseable {
|
||||
/**
|
||||
* Command code for {@link MediaController2#playFromMediaId(String, Bundle)}.
|
||||
*/
|
||||
public static final int COMMAND_CODE_PLAY_FROM_MEDIA_ID = 22;
|
||||
public static final int COMMAND_CODE_SESSION_PLAY_FROM_MEDIA_ID = 22;
|
||||
|
||||
/**
|
||||
* Command code for {@link MediaController2#playFromUri(Uri, Bundle)}.
|
||||
*/
|
||||
public static final int COMMAND_CODE_PLAY_FROM_URI = 23;
|
||||
public static final int COMMAND_CODE_SESSION_PLAY_FROM_URI = 23;
|
||||
|
||||
/**
|
||||
* Command code for {@link MediaController2#playFromSearch(String, Bundle)}.
|
||||
*/
|
||||
public static final int COMMAND_CODE_PLAY_FROM_SEARCH = 24;
|
||||
public static final int COMMAND_CODE_SESSION_PLAY_FROM_SEARCH = 24;
|
||||
|
||||
/**
|
||||
* Command code for {@link MediaController2#prepareFromMediaId(String, Bundle)}.
|
||||
*/
|
||||
public static final int COMMAND_CODE_PREPARE_FROM_MEDIA_ID = 25;
|
||||
public static final int COMMAND_CODE_SESSION_PREPARE_FROM_MEDIA_ID = 25;
|
||||
|
||||
/**
|
||||
* Command code for {@link MediaController2#prepareFromUri(Uri, Bundle)}.
|
||||
*/
|
||||
public static final int COMMAND_CODE_PREPARE_FROM_URI = 26;
|
||||
public static final int COMMAND_CODE_SESSION_PREPARE_FROM_URI = 26;
|
||||
|
||||
/**
|
||||
* Command code for {@link MediaController2#prepareFromSearch(String, Bundle)}.
|
||||
*/
|
||||
public static final int COMMAND_CODE_PREPARE_FROM_SEARCH = 27;
|
||||
public static final int COMMAND_CODE_SESSION_PREPARE_FROM_SEARCH = 27;
|
||||
|
||||
/**
|
||||
* Command code for {@link MediaController2#setRating(String, Rating2)}.
|
||||
* @hide
|
||||
*/
|
||||
// TODO(jaewan): Unhide
|
||||
public static final int COMMAND_CODE_SET_RATING = 29;
|
||||
public static final int COMMAND_CODE_SESSION_SET_RATING = 28;
|
||||
|
||||
/**
|
||||
* Command code for {@link MediaBrowser2} specific functions that allows navigation and search
|
||||
* from the {@link MediaLibraryService2}. This would be ignored for a {@link MediaSession2},
|
||||
* not {@link android.media.MediaLibraryService2.MediaLibrarySession}.
|
||||
* Command code for {@link android.media.MediaLibraryService2.MediaLibrarySession} specific
|
||||
* functions. With or without this, a {@link MediaSession2} that isn't
|
||||
* {@link android.media.MediaLibraryService2.MediaLibrarySession} would automatically reject
|
||||
* the calls.
|
||||
*
|
||||
* @see android.media.MediaLibraryService2.MediaLibrarySession
|
||||
* @see MediaBrowser2
|
||||
* @hide
|
||||
*/
|
||||
public static final int COMMAND_CODE_BROWSER = 28;
|
||||
// TODO(jaewan): Remove
|
||||
public static final int COMMAND_CODE_BROWSER = 29;
|
||||
|
||||
// TODO(jaewan): Add javadoc
|
||||
public static final int COMMAND_CODE_LIBRARY_GET_CHILDREN = 29;
|
||||
public static final int COMMAND_CODE_LIBRARY_GET_ITEM = 30;
|
||||
public static final int COMMAND_CODE_LIBRARY_GET_LIBRARY_ROOT = 31;
|
||||
public static final int COMMAND_CODE_LIBRARY_GET_SEARCH_RESULT = 32;
|
||||
public static final int COMMAND_CODE_LIBRARY_SEARCH = 33;
|
||||
public static final int COMMAND_CODE_LIBRARY_SUBSCRIBE = 34;
|
||||
public static final int COMMAND_CODE_LIBRARY_UNSUBSCRIBE = 35;
|
||||
|
||||
/**
|
||||
* @hide
|
||||
@@ -627,8 +641,8 @@ public class MediaSession2 implements AutoCloseable {
|
||||
* @see #COMMAND_CODE_PLAYBACK_PLAY
|
||||
* @see #COMMAND_CODE_PLAYBACK_PAUSE
|
||||
* @see #COMMAND_CODE_PLAYBACK_STOP
|
||||
* @see #COMMAND_CODE_PLAYBACK_SKIP_NEXT_ITEM
|
||||
* @see #COMMAND_CODE_PLAYBACK_SKIP_PREV_ITEM
|
||||
* @see #COMMAND_CODE_PLAYLIST_SKIP_NEXT_ITEM
|
||||
* @see #COMMAND_CODE_PLAYLIST_SKIP_PREV_ITEM
|
||||
* @see #COMMAND_CODE_PLAYBACK_PREPARE
|
||||
* @see #COMMAND_CODE_PLAYBACK_FAST_FORWARD
|
||||
* @see #COMMAND_CODE_PLAYBACK_REWIND
|
||||
@@ -683,7 +697,7 @@ public class MediaSession2 implements AutoCloseable {
|
||||
* @param controller controller information
|
||||
* @param mediaId media id
|
||||
* @param extras optional extra bundle
|
||||
* @see #COMMAND_CODE_PLAY_FROM_MEDIA_ID
|
||||
* @see #COMMAND_CODE_SESSION_PLAY_FROM_MEDIA_ID
|
||||
*/
|
||||
public void onPlayFromMediaId(@NonNull MediaSession2 session,
|
||||
@NonNull ControllerInfo controller, @NonNull String mediaId,
|
||||
@@ -700,7 +714,7 @@ public class MediaSession2 implements AutoCloseable {
|
||||
* @param controller controller information
|
||||
* @param query query string. Can be empty to indicate any suggested media
|
||||
* @param extras optional extra bundle
|
||||
* @see #COMMAND_CODE_PLAY_FROM_SEARCH
|
||||
* @see #COMMAND_CODE_SESSION_PLAY_FROM_SEARCH
|
||||
*/
|
||||
public void onPlayFromSearch(@NonNull MediaSession2 session,
|
||||
@NonNull ControllerInfo controller, @NonNull String query,
|
||||
@@ -714,7 +728,7 @@ public class MediaSession2 implements AutoCloseable {
|
||||
* @param controller controller information
|
||||
* @param uri uri
|
||||
* @param extras optional extra bundle
|
||||
* @see #COMMAND_CODE_PLAY_FROM_URI
|
||||
* @see #COMMAND_CODE_SESSION_PLAY_FROM_URI
|
||||
*/
|
||||
public void onPlayFromUri(@NonNull MediaSession2 session,
|
||||
@NonNull ControllerInfo controller, @NonNull Uri uri,
|
||||
@@ -738,7 +752,7 @@ public class MediaSession2 implements AutoCloseable {
|
||||
* @param controller controller information
|
||||
* @param mediaId media id to prepare
|
||||
* @param extras optional extra bundle
|
||||
* @see #COMMAND_CODE_PREPARE_FROM_MEDIA_ID
|
||||
* @see #COMMAND_CODE_SESSION_PREPARE_FROM_MEDIA_ID
|
||||
*/
|
||||
public void onPrepareFromMediaId(@NonNull MediaSession2 session,
|
||||
@NonNull ControllerInfo controller, @NonNull String mediaId,
|
||||
@@ -762,7 +776,7 @@ public class MediaSession2 implements AutoCloseable {
|
||||
* @param controller controller information
|
||||
* @param query query string. Can be empty to indicate any suggested media
|
||||
* @param extras optional extra bundle
|
||||
* @see #COMMAND_CODE_PREPARE_FROM_SEARCH
|
||||
* @see #COMMAND_CODE_SESSION_PREPARE_FROM_SEARCH
|
||||
*/
|
||||
public void onPrepareFromSearch(@NonNull MediaSession2 session,
|
||||
@NonNull ControllerInfo controller, @NonNull String query,
|
||||
@@ -786,7 +800,7 @@ public class MediaSession2 implements AutoCloseable {
|
||||
* @param controller controller information
|
||||
* @param uri uri
|
||||
* @param extras optional extra bundle
|
||||
* @see #COMMAND_CODE_PREPARE_FROM_URI
|
||||
* @see #COMMAND_CODE_SESSION_PREPARE_FROM_URI
|
||||
*/
|
||||
public void onPrepareFromUri(@NonNull MediaSession2 session,
|
||||
@NonNull ControllerInfo controller, @NonNull Uri uri, @Nullable Bundle extras) { }
|
||||
|
||||
Reference in New Issue
Block a user