Add setRatingType to MediaSession
This was missing in L. Needed to tell controllers how to rate content. bug:18051829 Change-Id: I26e662ff04f77ed7f2922bf9e74acf74c850547b
This commit is contained in:
@@ -16304,6 +16304,7 @@ package android.media.session {
|
||||
method public void setPlaybackToRemote(android.media.VolumeProvider);
|
||||
method public void setQueue(java.util.List<android.media.session.MediaSession.QueueItem>);
|
||||
method public void setQueueTitle(java.lang.CharSequence);
|
||||
method public void setRatingType(int);
|
||||
method public void setSessionActivity(android.app.PendingIntent);
|
||||
field public static final int FLAG_HANDLES_MEDIA_BUTTONS = 1; // 0x1
|
||||
field public static final int FLAG_HANDLES_TRANSPORT_CONTROLS = 2; // 0x2
|
||||
|
||||
@@ -448,6 +448,27 @@ public final class MediaSession {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the style of rating used by this session. Apps trying to set the
|
||||
* rating should use this style. Must be one of the following:
|
||||
* <ul>
|
||||
* <li>{@link Rating#RATING_NONE}</li>
|
||||
* <li>{@link Rating#RATING_3_STARS}</li>
|
||||
* <li>{@link Rating#RATING_4_STARS}</li>
|
||||
* <li>{@link Rating#RATING_5_STARS}</li>
|
||||
* <li>{@link Rating#RATING_HEART}</li>
|
||||
* <li>{@link Rating#RATING_PERCENTAGE}</li>
|
||||
* <li>{@link Rating#RATING_THUMB_UP_DOWN}</li>
|
||||
* </ul>
|
||||
*/
|
||||
public void setRatingType(int type) {
|
||||
try {
|
||||
mBinder.setRatingType(type);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "Error in setRatingType.", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set some extras that can be associated with the {@link MediaSession}. No assumptions should
|
||||
* be made as to how a {@link MediaController} will handle these extras.
|
||||
|
||||
@@ -306,6 +306,7 @@ public final class PlaybackState implements Parcelable {
|
||||
* <li> {@link PlaybackState#STATE_REWINDING}</li>
|
||||
* <li> {@link PlaybackState#STATE_BUFFERING}</li>
|
||||
* <li> {@link PlaybackState#STATE_ERROR}</li>
|
||||
* </ul>
|
||||
*/
|
||||
public int getState() {
|
||||
return mState;
|
||||
|
||||
Reference in New Issue
Block a user