/**@class android.media.session.MediaController @extends java.lang.Object Allows an app to interact with an ongoing media session. Media buttons and other commands can be sent to the session. A callback may be registered to receive updates from the session, such as metadata and play state changes. <p> A MediaController can be created through {@link android.media.session.MediaSessionManager} if you hold the "android.permission.MEDIA_CONTENT_CONTROL" permission or are an enabled notification listener or by getting a {@link android.media.session.MediaSession.Token} directly from the session owner. <p> MediaController objects are thread-safe. */ var MediaController = { /**Get a {@link android.media.session.MediaController.TransportControls} instance to send transport actions to the associated session. @return {Object {android.media.session.MediaController.TransportControls}} A transport controls instance. */ getTransportControls : function( ) {}, /**Send the specified media button event to the session. Only media keys can be sent by this method, other keys will be ignored. @param {Object {KeyEvent}} keyEvent The media button event to dispatch. @return {Boolean} true if the event was sent to the session, false otherwise. */ dispatchMediaButtonEvent : function( ) {}, /**Get the current playback state for this session. @return {Object {android.media.session.PlaybackState}} The current PlaybackState or null */ getPlaybackState : function( ) {}, /**Get the current metadata for this session. @return {Object {android.media.MediaMetadata}} The current MediaMetadata or null. */ getMetadata : function( ) {}, /**Get the current play queue for this session if one is set. If you only care about the current item {@link #getMetadata}() should be used. @return {Object {java.util.List}} The current play queue or null. */ getQueue : function( ) {}, /**Get the queue title for this session. */ getQueueTitle : function( ) {}, /**Get the extras for this session. */ getExtras : function( ) {}, /**Get the rating type supported by the session. One of: <ul> <li>{@link Rating#RATING_NONE}</li> <li>{@link Rating#RATING_HEART}</li> <li>{@link Rating#RATING_THUMB_UP_DOWN}</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_PERCENTAGE}</li> </ul> @return {Number} The supported rating type */ getRatingType : function( ) {}, /**Get the flags for this session. Flags are defined in {@link android.media.session.MediaSession}. @return {Number} The current set of flags for the session. */ getFlags : function( ) {}, /**Get the current playback info for this session. @return {Object {android.media.session.MediaController.PlaybackInfo}} The current playback info or null. */ getPlaybackInfo : function( ) {}, /**Get an intent for launching UI associated with this session if one exists. @return {Object {android.app.PendingIntent}} A {@link PendingIntent} to launch UI or null. */ getSessionActivity : function( ) {}, /**Get the token for the session this is connected to. @return {Object {android.media.session.MediaSession.Token}} The token for the connected session. */ getSessionToken : function( ) {}, /**Set the volume of the output this session is playing on. The command will be ignored if it does not support {@link VolumeProvider#VOLUME_CONTROL_ABSOLUTE}. The flags in {@link AudioManager} may be used to affect the handling. @param {Number} value The value to set it to, between 0 and the reported max. @param {Number} flags Flags from {@link AudioManager} to include with the volume request. @param flags Flags from {@link AudioManager} to include with the volume request. */ setVolumeTo : function( ) {}, /**Adjust the volume of the output this session is playing on. The direction must be one of {@link AudioManager#ADJUST_LOWER}, {@link AudioManager#ADJUST_RAISE}, or {@link AudioManager#ADJUST_SAME}. The command will be ignored if the session does not support {@link VolumeProvider#VOLUME_CONTROL_RELATIVE} or {@link VolumeProvider#VOLUME_CONTROL_ABSOLUTE}. The flags in {@link AudioManager} may be used to affect the handling. @param {Number} direction The direction to adjust the volume in. @param {Number} flags Any flags to pass with the command. @param flags Any flags to pass with the command. */ adjustVolume : function( ) {}, /**Registers a callback to receive updates from the Session. Updates will be posted on the caller's thread. @param {Object {MediaController.Callback}} callback The callback object, must not be null. */ registerCallback : function( ) {}, /**Registers a callback to receive updates from the session. Updates will be posted on the specified handler's thread. @param {Object {MediaController.Callback}} callback The callback object, must not be null. @param {Object {Handler}} handler The handler to post updates on. If null the callers thread will be used. */ registerCallback : function( ) {}, /**Unregisters the specified callback. If an update has already been posted you may still receive it after calling this method. @param {Object {MediaController.Callback}} callback The callback to remove. */ unregisterCallback : function( ) {}, /**Sends a generic command to the session. It is up to the session creator to decide what commands and parameters they will support. As such, commands should only be sent to sessions that the controller owns. @param {String} command The command to send @param {Object {Bundle}} args Any parameters to include with the command @param {Object {ResultReceiver}} cb The callback to receive the result on */ sendCommand : function( ) {}, /**Get the session owner's package name. @return {String} The package name of of the session owner. */ getPackageName : function( ) {}, /**Gets the additional session information which was set when the session was created. @return {Object {android.os.Bundle}} The additional session information, or an empty {@link Bundle} if not set. */ getSessionInfo : function( ) {}, /**Get the session's tag for debugging purposes. @return {String} The session's tag. @hide */ getTag : function( ) {}, /** @hide */ controlsSameSession : function( ) {}, };