FileDocCategorySizeDatePackage
MediaRouteProviderProtocol.javaAPI DocAndroid 5.1 API6608Thu Mar 12 22:22:56 GMT 2015android.support.v7.media

MediaRouteProviderProtocol

public abstract class MediaRouteProviderProtocol extends Object
Defines the communication protocol for media route provider services.
hide

Fields Summary
public static final String
SERVICE_INTERFACE
The {@link Intent} that must be declared as handled by the service. Put this in your manifest.
public static final int
CLIENT_MSG_REGISTER
(client v1) Register client. - replyTo : client messenger - arg1 : request id - arg2 : client version
public static final int
CLIENT_MSG_UNREGISTER
(client v1) Unregister client. - replyTo : client messenger - arg1 : request id
public static final int
CLIENT_MSG_CREATE_ROUTE_CONTROLLER
(client v1) Create route controller. - replyTo : client messenger - arg1 : request id - arg2 : route controller id - CLIENT_DATA_ROUTE_ID : route id string
public static final int
CLIENT_MSG_RELEASE_ROUTE_CONTROLLER
(client v1) Release route controller. - replyTo : client messenger - arg1 : request id - arg2 : route controller id
public static final int
CLIENT_MSG_SELECT_ROUTE
(client v1) Select route. - replyTo : client messenger - arg1 : request id - arg2 : route controller id
public static final int
CLIENT_MSG_UNSELECT_ROUTE
(client v1) Unselect route. - replyTo : client messenger - arg1 : request id - arg2 : route controller id
public static final int
CLIENT_MSG_SET_ROUTE_VOLUME
(client v1) Set route volume. - replyTo : client messenger - arg1 : request id - arg2 : route controller id - CLIENT_DATA_VOLUME : volume integer
public static final int
CLIENT_MSG_UPDATE_ROUTE_VOLUME
(client v1) Update route volume. - replyTo : client messenger - arg1 : request id - arg2 : route controller id - CLIENT_DATA_VOLUME : volume delta integer
public static final int
CLIENT_MSG_ROUTE_CONTROL_REQUEST
(client v1) Route control request. - replyTo : client messenger - arg1 : request id - arg2 : route controller id - obj : media control intent
public static final int
CLIENT_MSG_SET_DISCOVERY_REQUEST
(client v1) Sets the discovery request. - replyTo : client messenger - arg1 : request id - obj : discovery request bundle, or null if none
public static final String
CLIENT_DATA_ROUTE_ID
public static final String
CLIENT_DATA_VOLUME
public static final String
CLIENT_DATA_UNSELECT_REASON
public static final int
SERVICE_MSG_GENERIC_FAILURE
(service v1) Generic failure sent in response to any unrecognized or malformed request. - arg1 : request id
public static final int
SERVICE_MSG_GENERIC_SUCCESS
(service v1) Generic failure sent in response to a successful message. - arg1 : request id
public static final int
SERVICE_MSG_REGISTERED
(service v1) Registration succeeded. - arg1 : request id - arg2 : server version - obj : route provider descriptor bundle, or null
public static final int
SERVICE_MSG_CONTROL_REQUEST_SUCCEEDED
(service v1) Route control request success result. - arg1 : request id - obj : result data bundle, or null
public static final int
SERVICE_MSG_CONTROL_REQUEST_FAILED
(service v1) Route control request failure result. - arg1 : request id - obj : result data bundle, or null - SERVICE_DATA_ERROR: error message
public static final int
SERVICE_MSG_DESCRIPTOR_CHANGED
(service v1) Route provider descriptor changed. (unsolicited event) - arg1 : reserved (0) - obj : route provider descriptor bundle, or null
public static final String
SERVICE_DATA_ERROR
public static final int
CLIENT_VERSION_1
public static final int
CLIENT_VERSION_CURRENT
public static final int
SERVICE_VERSION_1
public static final int
SERVICE_VERSION_CURRENT
Constructors Summary
Methods Summary
public static booleanisValidRemoteMessenger(android.os.Messenger messenger)
Returns true if the messenger object is valid.

The messenger constructor and unparceling code does not check whether the provided IBinder is a valid IMessenger object. As a result, it's possible for a peer to send an invalid IBinder that will result in crashes downstream. This method checks that the messenger is in a valid state.


                                                                    
         
        try {
            return messenger != null && messenger.getBinder() != null;
        } catch (NullPointerException ex) {
            // If the messenger was constructed with a binder interface other than
            // IMessenger then the call to getBinder() will crash with an NPE.
            return false;
        }