MediaControlIntent.java revision b8b59e000cb7fcd1effc7b5898557b57a7ce0062
1/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.support.v7.media;
18
19import android.app.PendingIntent;
20import android.content.Intent;
21import android.net.Uri;
22
23/**
24 * Constants for media control intents.
25 * <p>
26 * This class declares a set of standard media control intent categories and actions that
27 * applications can use to identify the capabilities of media routes and control them.
28 * </p>
29 *
30 * <h3>Media control intent categories</h3>
31 * <p>
32 * Media control intent categories specify means by which applications can
33 * send media to the destination of a media route.  Categories are sometimes referred
34 * to as describing "types" or "kinds" of routes.
35 * </p><p>
36 * For example, if a route supports the {@link #CATEGORY_REMOTE_PLAYBACK remote playback category},
37 * then an application can ask it to play media remotely by sending a
38 * {@link #ACTION_PLAY play} or {@link #ACTION_ENQUEUE enqueue} intent with the Uri of the
39 * media content to play.  Such a route may then be referred to as
40 * a "remote playback route" because it supports remote playback requests.  It is common
41 * for a route to support multiple categories of requests at the same time, such as
42 * live audio and live video.
43 * </p><p>
44 * The following standard route categories are defined.
45 * </p><ul>
46 * <li>{@link #CATEGORY_LIVE_AUDIO Live audio}: The route supports streaming live audio
47 * from the device to the destination.  Live audio routes include local speakers
48 * and Bluetooth headsets.
49 * <li>{@link #CATEGORY_LIVE_VIDEO Live video}: The route supports streaming live video
50 * from the device to the destination.  Live video routes include local displays
51 * and wireless displays that support mirroring and
52 * {@link android.app.Presentation presentations}.  Live video routes typically also
53 * support live audio capabilities.
54 * <li>{@link #CATEGORY_REMOTE_PLAYBACK Remote playback}: The route supports sending
55 * remote playback requests for media content to the destination.  The content to be
56 * played is identified by a Uri and mime-type.
57 * </ul><p>
58 * Media route providers may define custom media control intent categories of their own in
59 * addition to the standard ones.  Custom categories can be used to provide a variety
60 * of features to applications that recognize and know how to use them.  For example,
61 * a media route provider might define a custom category to indicate that its routes
62 * support a special device-specific control interface in addition to other
63 * standard features.
64 * </p><p>
65 * Applications can determine which categories a route supports by using the
66 * {@link MediaRouter.RouteInfo#supportsControlCategory MediaRouter.RouteInfo.supportsControlCategory}
67 * or {@link MediaRouter.RouteInfo#getControlFilters MediaRouter.RouteInfo.getControlFilters}
68 * methods.  Applications can also specify the types of routes that they want to use by
69 * creating {@link MediaRouteSelector media route selectors} that contain the desired
70 * categories and are used to filter routes in several parts of the media router API.
71 * </p>
72 *
73 * <h3>Media control intent actions</h3>
74 * <p>
75 * Media control intent actions specify particular functions that applications
76 * can ask the destination of a media route to perform.  Media route control requests
77 * take the form of intents in a similar manner to other intents used to start activities
78 * or send broadcasts.  The difference is that media control intents are directed to
79 * routes rather than activity or broadcast receiver components.
80 * </p><p>
81 * Each media route control intent specifies an action, a category and some number of parameters
82 * that are supplied as extras.  Applications send media control requests to routes using the
83 * {@link MediaRouter.RouteInfo#sendControlRequest MediaRouter.RouteInfo.sendControlRequest}
84 * method and receive results via a callback.
85 * </p><p>
86 * All media control intent actions are associated with the media control intent categories
87 * that support them.  Thus only remote playback routes may perform remote playback actions.
88 * The documentation of each action specifies the category to which the action belongs,
89 * the parameters it requires, and the results it returns.
90 * </p>
91 *
92 * <h3>Live audio and live video routes</h3>
93 * <p>
94 * {@link #CATEGORY_LIVE_AUDIO Live audio} and {@link #CATEGORY_LIVE_VIDEO live video}
95 * routes present media using standard system interfaces such as audio streams,
96 * {@link android.app.Presentation presentations} or display mirroring.  These routes are
97 * the easiest to use because applications simply render content locally on the device
98 * and the system streams it to the route destination automatically.
99 * </p><p>
100 * In most cases, applications can stream content to live audio and live video routes in
101 * the same way they would play the content locally without any modification.  However,
102 * applications may also be able to take advantage of more sophisticated features such
103 * as second-screen presentation APIs that are particular to these routes.
104 * </p>
105 *
106 * <h3>Remote playback routes</h3>
107 * <p>
108 * Remote playback routes present media remotely by playing content from a Uri.
109 * These routes destinations take responsibility for fetching and rendering content
110 * on their own.  Applications do not render the content themselves; instead, applications
111 * send control requests to initiate play, pause, resume, or stop media items and receive
112 * status updates as they change state.
113 * </p>
114 *
115 * <h4>Sessions</h4>
116 * <p>
117 * Each remote media playback action is conducted within the scope of a session.
118 * Sessions are used to prevent applications from accidentally interfering with one
119 * another because at most one session can be valid at a time.
120 * </p><p>
121 * A session can be created using the {@link #ACTION_START_SESSION start session action}
122 * and terminated using the {@link #ACTION_END_SESSION end session action} when the
123 * route provides explicit session management features.
124 * </p><p>
125 * Explicit session management was added in a later revision of the protocol so not
126 * all routes support it.  If the route does not support explicit session management
127 * then implicit session management may still be used.  Implicit session management
128 * relies on the use of the {@link #ACTION_PLAY play} and {@link #ACTION_ENQUEUE enqueue}
129 * actions which have the side-effect of creating a new session if none is provided
130 * as argument.
131 * </p><p>
132 * When a new session is created, the previous session is invalidated and any ongoing
133 * media playback is stopped before the requested action is performed.  Any attempt
134 * to use an invalidated session will result in an error.  (Protocol implementations
135 * are encouraged to aggressively discard information associated with invalidated sessions
136 * since it is no longer of use.)
137 * </p><p>
138 * Each session is identified by a unique session id that may be used to control
139 * the session using actions such as pause, resume, stop and end session.
140 * </p>
141 *
142 * <h4>Media items</h4>
143 * <p>
144 * Each successful {@link #ACTION_PLAY play} or {@link #ACTION_ENQUEUE enqueue} action
145 * returns a unique media item id that an application can use to monitor and control
146 * playback.  The media item id may be passed to other actions such as
147 * {@link #ACTION_SEEK seek} or {@link #ACTION_GET_STATUS get status}.  It will also appear
148 * as a parameter in status update broadcasts to identify the associated playback request.
149 * </p><p>
150 * Each media item is scoped to the session in which it was created.  Therefore media item
151 * ids are only ever used together with session ids.  Media item ids are meaningless
152 * on their own.  When the session is invalidated, all of its media items are also
153 * invalidated.
154 * </p>
155 *
156 * <h4>The playback queue</h4>
157 * <p>
158 * Each session has its own playback queue that consists of the media items that
159 * are pending, playing, buffering or paused.  Items are added to the queue when
160 * a playback request is issued.  Items are removed from the queue when they are no
161 * longer eligible for playback (enter terminal states).
162 * </p><p>
163 * As described in the {@link MediaItemStatus} class, media items initially
164 * start in a pending state, transition to the playing (or buffering or paused) state
165 * during playback, and end in a finished, canceled, invalidated or error state.
166 * Once the current item enters a terminal state, playback proceeds on to the
167 * next item.
168 * </p><p>
169 * The application should determine whether the route supports queuing by checking
170 * whether the {@link #ACTION_ENQUEUE} action is declared in the route's control filter
171 * using {@link MediaRouter.RouteInfo#supportsControlRequest RouteInfo.supportsControlRequest}.
172 * </p><p>
173 * If the {@link #ACTION_ENQUEUE} action is supported by the route, then the route promises
174 * to allow at least two items (possibly more) to be enqueued at a time.  Enqueued items play
175 * back to back one after the other as the previous item completes.  Ideally there should
176 * be no audible pause between items for standard audio content types.
177 * </p><p>
178 * If the {@link #ACTION_ENQUEUE} action is not supported by the route, then the queue
179 * effectively contains at most one item at a time.  Each play action has the effect of
180 * clearing the queue and resetting its state before the next item is played.
181 * </p>
182 *
183 * <h4>Impact of pause, resume, stop and play actions on the playback queue</h4>
184 * <p>
185 * The pause, resume and stop actions affect the session's whole queue.  Pause causes
186 * the playback queue to be suspended no matter which item is currently playing.
187 * Resume reverses the effects of pause.  Stop clears the queue and also resets
188 * the pause flag just like resume.
189 * </p><p>
190 * As described earlier, the play action has the effect of clearing the queue
191 * and completely resetting its state (like the stop action) then enqueuing a
192 * new media item to be played immediately.  Play is therefore equivalent
193 * to stop followed by an action to enqueue an item.
194 * </p><p>
195 * The play action is also special in that it can be used to create new sessions.
196 * An application with simple needs may find that it only needs to use play
197 * (and occasionally stop) to control playback.
198 * </p>
199 *
200 * <h4>Resolving conflicts between applications</h4>
201 * <p>
202 * When an application has a valid session, it is essentially in control of remote playback
203 * on the route.  No other application can view or modify the remote playback state
204 * of that applicaton's session without knowing its id.
205 * </p><p>
206 * However, other applications can perform actions that have the effect of stopping
207 * playback and invalidating the current session.  When this occurs, the former application
208 * will be informed that it has lost control by way of individual media item status
209 * update broadcasts that indicate that its queued media items have become
210 * {@link MediaItemStatus#PLAYBACK_STATE_INVALIDATED invalidated}.  This broadcast
211 * implies that playback was terminated abnormally by an external cause.
212 * </p><p>
213 * Applications should handle conflicts conservatively to allow other applications to
214 * smoothly assume control over the route.  When a conflict occurs, the currently playing
215 * application should release its session and allow the new application to use the
216 * route until such time as the user intervenes to take over the route again and begin
217 * a new playback session.
218 * </p>
219 *
220 * <h4>Basic actions</h4>
221 * <p>
222 * The following basic actions must be supported (all or nothing) by all remote
223 * playback routes.  These actions form the basis of the remote playback protocol
224 * and are required in all implementations.
225 * </p><ul>
226 * <li>{@link #ACTION_PLAY Play}: Starts playing content specified by a given Uri
227 * and returns a new media item id to describe the request.  Implicitly creates a new
228 * session if no session id was specified as a parameter.
229 * <li>{@link #ACTION_SEEK Seek}: Sets the content playback position of a specific media item.
230 * <li>{@link #ACTION_GET_STATUS Get status}: Gets the status of a media item
231 * including the item's current playback position and progress.
232 * <li>{@link #ACTION_PAUSE Pause}: Pauses playback of the queue.
233 * <li>{@link #ACTION_RESUME Resume}: Resumes playback of the queue.
234 * <li>{@link #ACTION_STOP Stop}: Stops playback, clears the queue, and resets the
235 * pause state.
236 * </ul>
237 *
238 * <h4>Queue actions</h4>
239 * <p>
240 * The following queue actions must be supported (all or nothing) by remote
241 * playback routes that offer optional queuing capabilities.
242 * </p><ul>
243 * <li>{@link #ACTION_ENQUEUE Enqueue}: Enqueues content specified by a given Uri
244 * and returns a new media item id to describe the request.  Implicitly creates a new
245 * session if no session id was specified as a parameter.
246 * <li>{@link #ACTION_REMOVE Remove}: Removes a specified media item from the queue.
247 * </ul>
248 *
249 * <h4>Session actions</h4>
250 * <p>
251 * The following session actions must be supported (all or nothing) by remote
252 * playback routes that offer optional session management capabilities.
253 * </p><ul>
254 * <li>{@link #ACTION_START_SESSION Start session}: Starts a new session explicitly.
255 * <li>{@link #ACTION_GET_SESSION_STATUS Get session status}: Gets the status of a session.
256 * <li>{@link #ACTION_END_SESSION End session}: Ends a session explicitly.
257 * </ul>
258 *
259 * <h4>Implementation note</h4>
260 * <p>
261 * Implementations of the remote playback protocol must implement <em>all</em> of the
262 * documented actions, parameters and results.  Note that the documentation is written from
263 * the perspective of a client of the protocol.  In particular, whenever a parameter
264 * is described as being "optional", it is only from the perspective of the client.
265 * Compliant media route provider implementations of this protocol must support all
266 * of the features described herein.
267 * </p>
268 */
269public final class MediaControlIntent {
270    /**
271     * Media control category: Live audio.
272     * <p>
273     * A route that supports live audio routing will allow the media audio stream
274     * to be sent to supported destinations.  This can include internal speakers or
275     * audio jacks on the device itself, A2DP devices, and more.
276     * </p><p>
277     * When a live audio route is selected, audio routing is transparent to the application.
278     * All audio played on the media stream will be routed to the selected destination.
279     * </p>
280     */
281    public static final String CATEGORY_LIVE_AUDIO = "android.media.intent.category.LIVE_AUDIO";
282
283    /**
284     * Media control category: Live video.
285     * <p>
286     * A route that supports live video routing will allow a mirrored version
287     * of the device's primary display or a customized
288     * {@link android.app.Presentation Presentation} to be sent to supported
289     * destinations.
290     * </p><p>
291     * When a live video route is selected, audio and video routing is transparent
292     * to the application.  By default, audio and video is routed to the selected
293     * destination.  For certain live video routes, the application may also use a
294     * {@link android.app.Presentation Presentation} to replace the mirrored view
295     * on the external display with different content.
296     * </p>
297     *
298     * @see MediaRouter.RouteInfo#getPresentationDisplay()
299     * @see android.app.Presentation
300     */
301    public static final String CATEGORY_LIVE_VIDEO = "android.media.intent.category.LIVE_VIDEO";
302
303    /**
304     * Media control category: Remote playback.
305     * <p>
306     * A route that supports remote playback routing will allow an application to send
307     * requests to play content remotely to supported destinations.
308     * </p><p>
309     * Remote playback routes destinations operate independently of the local device.
310     * When a remote playback route is selected, the application can control the content
311     * playing on the destination by sending media control actions to the route.
312     * The application may also receive status updates from the route regarding
313     * remote playback.
314     * </p>
315     *
316     * @see MediaRouter.RouteInfo#sendControlRequest
317     */
318    public static final String CATEGORY_REMOTE_PLAYBACK =
319            "android.media.intent.category.REMOTE_PLAYBACK";
320
321    /* Remote playback actions that affect individual items. */
322
323    /**
324     * Remote playback media control action: Play media item.
325     * <p>
326     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
327     * media control.
328     * </p><p>
329     * This action causes a remote playback route to start playing content with
330     * the {@link Uri} specified in the {@link Intent}'s {@link Intent#getData() data uri}.
331     * The action returns a media session id and media item id which can be used
332     * to control playback using other remote playback actions.
333     * </p><p>
334     * Once initiated, playback of the specified content will be managed independently
335     * by the destination.  The application will receive status updates as the state
336     * of the media item changes.
337     * </p><p>
338     * If the data uri specifies an HTTP or HTTPS scheme, then the destination is
339     * responsible for following HTTP redirects to a reasonable depth of at least 3
340     * levels as might typically be handled by a web browser.  If an HTTP error
341     * occurs, then the destination should send a {@link MediaItemStatus status update}
342     * back to the client indicating the {@link MediaItemStatus#PLAYBACK_STATE_ERROR error}
343     * {@link MediaItemStatus#getPlaybackState() playback state}.
344     * </p>
345     *
346     * <h3>One item at a time</h3>
347     * <p>
348     * Each successful play action <em>replaces</em> the previous play action.
349     * If an item is already playing, then it is canceled, the session's playback queue
350     * is cleared and the new item begins playing immediately (regardless of
351     * whether the previously playing item had been paused).
352     * </p><p>
353     * Play is therefore equivalent to {@link #ACTION_STOP stop} followed by an action
354     * to enqueue a new media item to be played immediately.
355     * </p>
356     *
357     * <h3>Sessions</h3>
358     * <p>
359     * This request has the effect of implicitly creating a media session whenever the
360     * application does not specify the {@link #EXTRA_SESSION_ID session id} parameter.
361     * Because there can only be at most one valid session at a time, creating a new session
362     * has the side-effect of invalidating any existing sessions and their media items,
363     * then handling the playback request with a new session.
364     * </p><p>
365     * If the application specifies an invalid session id, then an error is returned.
366     * When this happens, the application should assume that its session
367     * is no longer valid.  To obtain a new session, the application may try again
368     * and omit the session id parameter.  However, the application should
369     * only retry requests due to an explicit action performed by the user,
370     * such as the user clicking on a "play" button in the UI, since another
371     * application may be trying to take control of the route and the former
372     * application should try to stay out of its way.
373     * </p><p>
374     * For more information on sessions, queues and media items, please refer to the
375     * class documentation.
376     * </p>
377     *
378     * <h3>Request parameters</h3>
379     * <ul>
380     * <li>{@link #EXTRA_SESSION_ID} <em>(optional)</em>: Specifies the session id of the
381     * session to which the playback request belongs.  If omitted, a new session
382     * is created implicitly.
383     * <li>{@link #EXTRA_ITEM_CONTENT_POSITION} <em>(optional)</em>: Specifies the initial
384     * content playback position as a long integer number of milliseconds from
385     * the beginning of the content.
386     * <li>{@link #EXTRA_ITEM_METADATA} <em>(optional)</em>: Specifies metadata associated
387     * with the content such as the title of a song.
388     * <li>{@link #EXTRA_ITEM_STATUS_UPDATE_RECEIVER} <em>(optional)</em>: Specifies a
389     * {@link PendingIntent} for a broadcast receiver that will receive status updates
390     * about the media item.
391     * </ul>
392     *
393     * <h3>Result data</h3>
394     * <ul>
395     * <li>{@link #EXTRA_SESSION_ID} <em>(always returned)</em>: Specifies the session id of the
396     * session that was affected by the request.  This will be a new session in
397     * the case where no session id was supplied as a parameter.
398     * <li>{@link #EXTRA_SESSION_STATUS} <em>(optional, old implementations may
399     * omit this key)</em>: Specifies the status of the media session.
400     * <li>{@link #EXTRA_ITEM_ID} <em>(always returned)</em>: Specifies an opaque string identifier
401     * to use to refer to the media item in subsequent requests such as
402     * {@link #ACTION_GET_STATUS}.
403     * <li>{@link #EXTRA_ITEM_STATUS} <em>(always returned)</em>: Specifies the initial status of
404     * the new media item.
405     * </ul>
406     *
407     * <h3>Status updates</h3>
408     * <p>
409     * If the client supplies an
410     * {@link #EXTRA_ITEM_STATUS_UPDATE_RECEIVER item status update receiver}
411     * then the media route provider is responsible for sending status updates to the receiver
412     * when significant media item state changes occur such as when playback starts or
413     * stops.  The receiver will not be invoked for content playback position changes.
414     * The application may retrieve the current playback position when necessary
415     * using the {@link #ACTION_GET_STATUS} request.
416     * </p><p>
417     * Refer to {@link MediaItemStatus} for details.
418     * </p>
419     *
420     * <h3>Errors</h3>
421     * <p>
422     * This action returns an error if a session id was provided but is unknown or
423     * no longer valid, if the item Uri or content type is not supported, or if
424     * any other arguments are invalid.
425     * </p><ul>
426     * <li>{@link #EXTRA_ERROR_CODE} <em>(optional)</em>: Specifies the cause of the error.
427     * </ul>
428     *
429     * <h3>Example</h3>
430     * <pre>
431     * MediaRouter mediaRouter = MediaRouter.getInstance(context);
432     * MediaRouter.RouteInfo route = mediaRouter.getSelectedRoute();
433     * Intent intent = new Intent(MediaControlIntent.ACTION_PLAY);
434     * intent.addCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK);
435     * intent.setDataAndType("http://example.com/videos/movie.mp4", "video/mp4");
436     * if (route.supportsControlRequest(intent)) {
437     *     MediaRouter.ControlRequestCallback callback = new MediaRouter.ControlRequestCallback() {
438     *         public void onResult(Bundle data) {
439     *             // The request succeeded.
440     *             // Playback may be controlled using the returned session and item id.
441     *             String sessionId = data.getString(MediaControlIntent.EXTRA_SESSION_ID);
442     *             String itemId = data.getString(MediaControlIntent.EXTRA_ITEM_ID);
443     *             MediaItemStatus status = MediaItemStatus.fromBundle(data.getBundle(
444     *                     MediaControlIntent.EXTRA_ITEM_STATUS));
445     *             // ...
446     *         }
447     *
448     *         public void onError(String message, Bundle data) {
449     *             // An error occurred!
450     *         }
451     *     };
452     *     route.sendControlRequest(intent, callback);
453     * }</pre>
454     *
455     * @see MediaRouter.RouteInfo#sendControlRequest
456     * @see #CATEGORY_REMOTE_PLAYBACK
457     * @see #ACTION_SEEK
458     * @see #ACTION_GET_STATUS
459     * @see #ACTION_PAUSE
460     * @see #ACTION_RESUME
461     * @see #ACTION_STOP
462     */
463    public static final String ACTION_PLAY = "android.media.intent.action.PLAY";
464
465    /**
466     * Remote playback media control action: Enqueue media item.
467     * <p>
468     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
469     * media control.
470     * </p><p>
471     * This action works just like {@link #ACTION_PLAY play} except that it does
472     * not clear the queue or reset the pause state when it enqueues the
473     * new media item into the session's playback queue.  This action only
474     * enqueues a media item with no other side-effects on the queue.
475     * </p><p>
476     * If the queue is currently empty and then the item will play immediately
477     * (assuming the queue is not paused).  Otherwise, the item will play
478     * after all earlier items in the queue have finished or been removed.
479     * </p><p>
480     * The enqueue action can be used to create new sessions just like play.
481     * Its parameters and results are also the same.  Only the queuing behavior
482     * is different.
483     * </p>
484     *
485     * @see #ACTION_PLAY
486     */
487    public static final String ACTION_ENQUEUE = "android.media.intent.action.ENQUEUE";
488
489    /**
490     * Remote playback media control action: Seek media item to a new playback position.
491     * <p>
492     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
493     * media control.
494     * </p><p>
495     * This action causes a remote playback route to modify the current playback position
496     * of the specified media item.
497     * </p><p>
498     * This action only affects the playback position of the media item; not its playback state.
499     * If the playback queue is paused, then seeking sets the position but the item
500     * remains paused.  Likewise if the item is playing, then seeking will cause playback
501     * to jump to the new position and continue playing from that point.  If the item has
502     * not yet started playing, then the new playback position is remembered by the
503     * queue and used as the item's initial content position when playback eventually begins.
504     * </p><p>
505     * If successful, the media item's playback position is changed.
506     * </p>
507     *
508     * <h3>Request parameters</h3>
509     * <ul>
510     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of the session
511     * to which the media item belongs.
512     * <li>{@link #EXTRA_ITEM_ID} <em>(required)</em>: Specifies the media item id of
513     * the media item to seek.
514     * <li>{@link #EXTRA_ITEM_CONTENT_POSITION} <em>(required)</em>: Specifies the new
515     * content position for playback as a long integer number of milliseconds from
516     * the beginning of the content.
517     * </ul>
518     *
519     * <h3>Result data</h3>
520     * <ul>
521     * <li>{@link #EXTRA_SESSION_STATUS} <em>(optional, old implementations may
522     * omit this key)</em>: Specifies the status of the media session.
523     * <li>{@link #EXTRA_ITEM_STATUS} <em>(always returned)</em>: Specifies the new status of
524     * the media item.
525     * </ul>
526     *
527     * <h3>Errors</h3>
528     * <p>
529     * This action returns an error if the session id or media item id are unknown
530     * or no longer valid, if the content position is invalid, or if the media item
531     * is in a terminal state.
532     * </p><ul>
533     * <li>{@link #EXTRA_ERROR_CODE} <em>(optional)</em>: Specifies the cause of the error.
534     * </ul>
535     *
536     * @see MediaRouter.RouteInfo#sendControlRequest
537     * @see #CATEGORY_REMOTE_PLAYBACK
538     */
539    public static final String ACTION_SEEK = "android.media.intent.action.SEEK";
540
541    /**
542     * Remote playback media control action: Get media item playback status
543     * and progress information.
544     * <p>
545     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
546     * media control.
547     * </p><p>
548     * This action asks a remote playback route to provide updated playback status and progress
549     * information about the specified media item.
550     * </p>
551     *
552     * <h3>Request parameters</h3>
553     * <ul>
554     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of the session
555     * to which the media item belongs.
556     * <li>{@link #EXTRA_ITEM_ID} <em>(required)</em>: Specifies the media item id of
557     * the media item to query.
558     * </ul>
559     *
560     * <h3>Result data</h3>
561     * <ul>
562     * <li>{@link #EXTRA_SESSION_STATUS} <em>(optional, old implementations may
563     * omit this key)</em>: Specifies the status of the media session.
564     * <li>{@link #EXTRA_ITEM_STATUS} <em>(always returned)</em>: Specifies the current status of
565     * the media item.
566     * </ul>
567     *
568     * <h3>Errors</h3>
569     * <p>
570     * This action returns an error if the session id or media item id are unknown
571     * or no longer valid.
572     * </p><ul>
573     * <li>{@link #EXTRA_ERROR_CODE} <em>(optional)</em>: Specifies the cause of the error.
574     * </ul>
575     *
576     * @see MediaRouter.RouteInfo#sendControlRequest
577     * @see #CATEGORY_REMOTE_PLAYBACK
578     * @see #EXTRA_ITEM_STATUS_UPDATE_RECEIVER
579     */
580    public static final String ACTION_GET_STATUS = "android.media.intent.action.GET_STATUS";
581
582    /**
583     * Remote playback media control action: Remove media item from session's queue.
584     * <p>
585     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
586     * media control.
587     * </p><p>
588     * This action asks a remote playback route to remove the specified media item
589     * from the session's playback queue.  If the current item is removed, then
590     * playback will proceed to the next media item (assuming the queue has not been
591     * paused).
592     * </p><p>
593     * This action does not affect the pause state of the queue.  If the queue was paused
594     * then it remains paused (even if it is now empty) until a resume, stop or play
595     * action is issued that causes the pause state to be cleared.
596     * </p>
597     *
598     * <h3>Request parameters</h3>
599     * <ul>
600     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of the session
601     * to which the media item belongs.
602     * <li>{@link #EXTRA_ITEM_ID} <em>(required)</em>: Specifies the media item id of
603     * the media item to remove.
604     * </ul>
605     *
606     * <h3>Result data</h3>
607     * <ul>
608     * <li>{@link #EXTRA_SESSION_STATUS} <em>(optional, old implementations may
609     * omit this key)</em>: Specifies the status of the media session.
610     * <li>{@link #EXTRA_ITEM_STATUS} <em>(always returned)</em>: Specifies the new status of
611     * the media item.
612     * </ul>
613     *
614     * <h3>Errors</h3>
615     * <p>
616     * This action returns an error if the session id or media item id are unknown
617     * or no longer valid, or if the media item is in a terminal state (and therefore
618     * no longer in the queue).
619     * </p><ul>
620     * <li>{@link #EXTRA_ERROR_CODE} <em>(optional)</em>: Specifies the cause of the error.
621     * </ul>
622     *
623     * @see MediaRouter.RouteInfo#sendControlRequest
624     * @see #CATEGORY_REMOTE_PLAYBACK
625     */
626    public static final String ACTION_REMOVE = "android.media.intent.action.REMOVE";
627
628    /* Remote playback actions that affect the whole playback queue. */
629
630    /**
631     * Remote playback media control action: Pause media playback.
632     * <p>
633     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
634     * media control.
635     * </p><p>
636     * This action causes the playback queue of the specified session to be paused.
637     * </p>
638     *
639     * <h3>Request parameters</h3>
640     * <ul>
641     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of the session
642     * whose playback queue is to be paused.
643     * </ul>
644     *
645     * <h3>Result data</h3>
646     * <ul>
647     * <li>{@link #EXTRA_SESSION_STATUS} <em>(optional, old implementations may
648     * omit this key)</em>: Specifies the status of the media session.
649     * </ul>
650     *
651     * <h3>Errors</h3>
652     * <p>
653     * This action returns an error if the session id is unknown or no longer valid.
654     * </p><ul>
655     * <li>{@link #EXTRA_ERROR_CODE} <em>(optional)</em>: Specifies the cause of the error.
656     * </ul>
657     *
658     * @see MediaRouter.RouteInfo#sendControlRequest
659     * @see #CATEGORY_REMOTE_PLAYBACK
660     * @see #ACTION_RESUME
661     */
662    public static final String ACTION_PAUSE = "android.media.intent.action.PAUSE";
663
664    /**
665     * Remote playback media control action: Resume media playback (unpause).
666     * <p>
667     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
668     * media control.
669     * </p><p>
670     * This action causes the playback queue of the specified session to be resumed.
671     * Reverses the effects of {@link #ACTION_PAUSE}.
672     * </p>
673     *
674     * <h3>Request parameters</h3>
675     * <ul>
676     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of the session
677     * whose playback queue is to be resumed.
678     * </ul>
679     *
680     * <h3>Result data</h3>
681     * <ul>
682     * <li>{@link #EXTRA_SESSION_STATUS} <em>(optional, old implementations may
683     * omit this key)</em>: Specifies the status of the media session.
684     * </ul>
685     *
686     * <h3>Errors</h3>
687     * <p>
688     * This action returns an error if the session id is unknown or no longer valid.
689     * </p><ul>
690     * <li>{@link #EXTRA_ERROR_CODE} <em>(optional)</em>: Specifies the cause of the error.
691     * </ul>
692     *
693     * @see MediaRouter.RouteInfo#sendControlRequest
694     * @see #CATEGORY_REMOTE_PLAYBACK
695     * @see #ACTION_PAUSE
696     */
697    public static final String ACTION_RESUME = "android.media.intent.action.RESUME";
698
699    /**
700     * Remote playback media control action: Stop media playback (clear queue and unpause).
701     * <p>
702     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
703     * media control.
704     * </p><p>
705     * This action causes a remote playback route to stop playback, cancel and remove
706     * all media items from the session's media item queue and, reset the queue's
707     * pause state.
708     * </p><p>
709     * If successful, the status of all media items in the queue is set to
710     * {@link MediaItemStatus#PLAYBACK_STATE_CANCELED canceled} and a status update is sent
711     * to the appropriate status update receivers indicating the new status of each item.
712     * </p>
713     *
714     * <h3>Request parameters</h3>
715     * <ul>
716     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of
717     * the session whose playback queue is to be stopped (cleared and unpaused).
718     * </ul>
719     *
720     * <h3>Result data</h3>
721     * <ul>
722     * <li>{@link #EXTRA_SESSION_STATUS} <em>(optional, old implementations may
723     * omit this key)</em>: Specifies the status of the media session.
724     * </ul>
725     *
726     * <h3>Errors</h3>
727     * <p>
728     * This action returns an error if the session id is unknown or no longer valid.
729     * </p><ul>
730     * <li>{@link #EXTRA_ERROR_CODE} <em>(optional)</em>: Specifies the cause of the error.
731     * </ul>
732     *
733     * @see MediaRouter.RouteInfo#sendControlRequest
734     * @see #CATEGORY_REMOTE_PLAYBACK
735     */
736    public static final String ACTION_STOP = "android.media.intent.action.STOP";
737
738    /**
739     * Remote playback media control action: Start session.
740     * <p>
741     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
742     * media control.
743     * </p><p>
744     * This action causes a remote playback route to invalidate the current session
745     * and start a new session.  The new session initially has an empty queue.
746     * </p><p>
747     * If successful, the status of all media items in the previous session's queue is set to
748     * {@link MediaItemStatus#PLAYBACK_STATE_INVALIDATED invalidated} and a status update
749     * is sent to the appropriate status update receivers indicating the new status
750     * of each item.  The previous session becomes no longer valid and the new session
751     * takes control of the route.
752     * </p>
753     *
754     * <h3>Request parameters</h3>
755     * <ul>
756     * <li>{@link #EXTRA_SESSION_STATUS_UPDATE_RECEIVER} <em>(optional)</em>: Specifies a
757     * {@link PendingIntent} for a broadcast receiver that will receive status updates
758     * about the media session.
759     * </ul>
760     *
761     * <h3>Result data</h3>
762     * <ul>
763     * <li>{@link #EXTRA_SESSION_ID} <em>(always returned)</em>: Specifies the session id of the
764     * session that was started by the request.  This will always be a brand new session
765     * distinct from any other previously created sessions.
766     * <li>{@link #EXTRA_SESSION_STATUS} <em>(always returned)</em>: Specifies the
767     * status of the media session.
768     * </ul>
769     *
770     * <h3>Status updates</h3>
771     * <p>
772     * If the client supplies a
773     * {@link #EXTRA_SESSION_STATUS_UPDATE_RECEIVER status update receiver}
774     * then the media route provider is responsible for sending status updates to the receiver
775     * when significant media session state changes occur such as when the session's
776     * queue is paused or resumed or when the session is terminated or invalidated.
777     * </p><p>
778     * Refer to {@link MediaSessionStatus} for details.
779     * </p>
780     *
781     * <h3>Errors</h3>
782     * <p>
783     * This action returns an error if the session could not be created.
784     * </p><ul>
785     * <li>{@link #EXTRA_ERROR_CODE} <em>(optional)</em>: Specifies the cause of the error.
786     * </ul>
787     *
788     * @see MediaRouter.RouteInfo#sendControlRequest
789     * @see #CATEGORY_REMOTE_PLAYBACK
790     */
791    public static final String ACTION_START_SESSION = "android.media.intent.action.START_SESSION";
792
793    /**
794     * Remote playback media control action: Get media session status information.
795     * <p>
796     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
797     * media control.
798     * </p><p>
799     * This action asks a remote playback route to provide updated status information
800     * about the specified media session.
801     * </p>
802     *
803     * <h3>Request parameters</h3>
804     * <ul>
805     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of the
806     * session whose status is to be retrieved.
807     * </ul>
808     *
809     * <h3>Result data</h3>
810     * <ul>
811     * <li>{@link #EXTRA_SESSION_STATUS} <em>(always returned)</em>: Specifies the
812     * current status of the media session.
813     * </ul>
814     *
815     * <h3>Errors</h3>
816     * <p>
817     * This action returns an error if the session id is unknown or no longer valid.
818     * </p><ul>
819     * <li>{@link #EXTRA_ERROR_CODE} <em>(optional)</em>: Specifies the cause of the error.
820     * </ul>
821     *
822     * @see MediaRouter.RouteInfo#sendControlRequest
823     * @see #CATEGORY_REMOTE_PLAYBACK
824     * @see #EXTRA_SESSION_STATUS_UPDATE_RECEIVER
825     */
826    public static final String ACTION_GET_SESSION_STATUS =
827            "android.media.intent.action.GET_SESSION_STATUS";
828
829    /**
830     * Remote playback media control action: End session.
831     * <p>
832     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
833     * media control.
834     * </p><p>
835     * This action causes a remote playback route to end the specified session.
836     * The session becomes no longer valid and the route ceases to be under control
837     * of the session.
838     * </p><p>
839     * If successful, the status of the session is set to
840     * {@link MediaSessionStatus#SESSION_STATE_ENDED} and a status update is sent to
841     * the session's status update receiver.
842     * </p><p>
843     * Additionally, the status of all media items in the queue is set to
844     * {@link MediaItemStatus#PLAYBACK_STATE_CANCELED canceled} and a status update is sent
845     * to the appropriate status update receivers indicating the new status of each item.
846     * </p>
847     *
848     * <h3>Request parameters</h3>
849     * <ul>
850     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of
851     * the session to end.
852     * </ul>
853     *
854     * <h3>Result data</h3>
855     * <ul>
856     * <li>{@link #EXTRA_SESSION_STATUS} <em>(always returned)</em>: Specifies the
857     * status of the media session.
858     * </ul>
859     *
860     * <h3>Errors</h3>
861     * <p>
862     * This action returns an error if the session id is unknown or no longer valid.
863     * In other words, it is an error to attempt to end a session other than the
864     * current session.
865     * </p><ul>
866     * <li>{@link #EXTRA_ERROR_CODE} <em>(optional)</em>: Specifies the cause of the error.
867     * </ul>
868     *
869     * @see MediaRouter.RouteInfo#sendControlRequest
870     * @see #CATEGORY_REMOTE_PLAYBACK
871     */
872    public static final String ACTION_END_SESSION = "android.media.intent.action.END_SESSION";
873
874    /**
875     * Bundle extra: Media session id.
876     * <p>
877     * An opaque unique identifier that identifies the remote playback media session.
878     * </p><p>
879     * Used with various actions to specify the id of the media session to be controlled.
880     * </p><p>
881     * Included in broadcast intents sent to
882     * {@link #EXTRA_ITEM_STATUS_UPDATE_RECEIVER item status update receivers} to identify
883     * the session to which the item in question belongs.
884     * </p><p>
885     * Included in broadcast intents sent to
886     * {@link #EXTRA_SESSION_STATUS_UPDATE_RECEIVER session status update receivers} to identify
887     * the session.
888     * </p><p>
889     * The value is a unique string value generated by the media route provider
890     * to represent one particular media session.
891     * </p>
892     *
893     * @see #ACTION_PLAY
894     * @see #ACTION_SEEK
895     * @see #ACTION_GET_STATUS
896     * @see #ACTION_PAUSE
897     * @see #ACTION_RESUME
898     * @see #ACTION_STOP
899     * @see #ACTION_START_SESSION
900     * @see #ACTION_GET_SESSION_STATUS
901     * @see #ACTION_END_SESSION
902     */
903    public static final String EXTRA_SESSION_ID =
904            "android.media.intent.extra.SESSION_ID";
905
906    /**
907     * Bundle extra: Media session status.
908     * <p>
909     * Returned as a result from media session actions such as {@link #ACTION_START_SESSION},
910     * {@link #ACTION_PAUSE}, and {@link #ACTION_GET_SESSION_STATUS}
911     * to describe the status of the specified media session.
912     * </p><p>
913     * Included in broadcast intents sent to
914     * {@link #EXTRA_SESSION_STATUS_UPDATE_RECEIVER session status update receivers} to provide
915     * updated status information.
916     * </p><p>
917     * The value is a {@link android.os.Bundle} of data that can be converted into
918     * a {@link MediaSessionStatus} object using
919     * {@link MediaSessionStatus#fromBundle MediaSessionStatus.fromBundle}.
920     * </p>
921     *
922     * @see #ACTION_PLAY
923     * @see #ACTION_SEEK
924     * @see #ACTION_GET_STATUS
925     * @see #ACTION_PAUSE
926     * @see #ACTION_RESUME
927     * @see #ACTION_STOP
928     * @see #ACTION_START_SESSION
929     * @see #ACTION_GET_SESSION_STATUS
930     * @see #ACTION_END_SESSION
931     */
932    public static final String EXTRA_SESSION_STATUS =
933            "android.media.intent.extra.SESSION_STATUS";
934
935    /**
936     * Bundle extra: Media item status update receiver.
937     * <p>
938     * Used with {@link #ACTION_START_SESSION} to specify a {@link PendingIntent} for a
939     * broadcast receiver that will receive status updates about the media session.
940     * </p><p>
941     * Whenever the status of the media session changes, the media route provider will
942     * send a broadcast to the pending intent with extras that identify the session
943     * id and its updated status.
944     * </p><p>
945     * The value is a {@link PendingIntent}.
946     * </p>
947     *
948     * <h3>Broadcast extras</h3>
949     * <ul>
950     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of
951     * the session.
952     * <li>{@link #EXTRA_SESSION_STATUS} <em>(required)</em>: Specifies the status of the
953     * session as a bundle that can be decoded into a {@link MediaSessionStatus} object.
954     * </ul>
955     *
956     * @see #ACTION_START_SESSION
957     */
958    public static final String EXTRA_SESSION_STATUS_UPDATE_RECEIVER =
959            "android.media.intent.extra.SESSION_STATUS_UPDATE_RECEIVER";
960
961    /**
962     * Bundle extra: Media item id.
963     * <p>
964     * An opaque unique identifier returned as a result from {@link #ACTION_PLAY} or
965     * {@link #ACTION_ENQUEUE} that represents the media item that was created by the
966     * playback request.
967     * </p><p>
968     * Used with various actions to specify the id of the media item to be controlled.
969     * </p><p>
970     * Included in broadcast intents sent to
971     * {@link #EXTRA_ITEM_STATUS_UPDATE_RECEIVER status update receivers} to identify
972     * the item in question.
973     * </p><p>
974     * The value is a unique string value generated by the media route provider
975     * to represent one particular media item.
976     * </p>
977     *
978     * @see #ACTION_PLAY
979     * @see #ACTION_ENQUEUE
980     * @see #ACTION_SEEK
981     * @see #ACTION_GET_STATUS
982     */
983    public static final String EXTRA_ITEM_ID =
984            "android.media.intent.extra.ITEM_ID";
985
986    /**
987     * Bundle extra: Media item status.
988     * <p>
989     * Returned as a result from media item actions such as {@link #ACTION_PLAY},
990     * {@link #ACTION_ENQUEUE}, {@link #ACTION_SEEK}, and {@link #ACTION_GET_STATUS}
991     * to describe the status of the specified media item.
992     * </p><p>
993     * Included in broadcast intents sent to
994     * {@link #EXTRA_ITEM_STATUS_UPDATE_RECEIVER item status update receivers} to provide
995     * updated status information.
996     * </p><p>
997     * The value is a {@link android.os.Bundle} of data that can be converted into
998     * a {@link MediaItemStatus} object using
999     * {@link MediaItemStatus#fromBundle MediaItemStatus.fromBundle}.
1000     * </p>
1001     *
1002     * @see #ACTION_PLAY
1003     * @see #ACTION_ENQUEUE
1004     * @see #ACTION_SEEK
1005     * @see #ACTION_GET_STATUS
1006     */
1007    public static final String EXTRA_ITEM_STATUS =
1008            "android.media.intent.extra.ITEM_STATUS";
1009
1010    /**
1011     * Long extra: Media item content position.
1012     * <p>
1013     * Used with {@link #ACTION_PLAY} or {@link #ACTION_ENQUEUE} to specify the
1014     * starting playback position.
1015     * </p><p>
1016     * Used with {@link #ACTION_SEEK} to set a new playback position.
1017     * </p><p>
1018     * The value is a long integer number of milliseconds from the beginning of the content.
1019     * <p>
1020     *
1021     * @see #ACTION_PLAY
1022     * @see #ACTION_ENQUEUE
1023     * @see #ACTION_SEEK
1024     */
1025    public static final String EXTRA_ITEM_CONTENT_POSITION =
1026            "android.media.intent.extra.ITEM_POSITION";
1027
1028    /**
1029     * Bundle extra: Media item metadata.
1030     * <p>
1031     * Used with {@link #ACTION_PLAY} or {@link #ACTION_ENQUEUE} to specify metadata
1032     * associated with the content of a media item.
1033     * </p><p>
1034     * The value is a {@link android.os.Bundle} of metadata key-value pairs as defined
1035     * in {@link MediaItemMetadata}.
1036     * </p>
1037     *
1038     * @see #ACTION_PLAY
1039     * @see #ACTION_ENQUEUE
1040     */
1041    public static final String EXTRA_ITEM_METADATA =
1042            "android.media.intent.extra.ITEM_METADATA";
1043
1044    /**
1045     * Bundle extra: HTTP request headers.
1046     * <p>
1047     * Used with {@link #ACTION_PLAY} or {@link #ACTION_ENQUEUE} to specify HTTP request
1048     * headers to be included when fetching to the content indicated by the media
1049     * item's data Uri.
1050     * </p><p>
1051     * This extra may be used to provide authentication tokens and other
1052     * parameters to the server separately from the media item's data Uri.
1053     * </p><p>
1054     * The value is a {@link android.os.Bundle} of string based key-value pairs
1055     * that describe the HTTP request headers.
1056     * </p>
1057     *
1058     * @see #ACTION_PLAY
1059     * @see #ACTION_ENQUEUE
1060     */
1061    public static final String EXTRA_ITEM_HTTP_HEADERS =
1062            "android.media.intent.extra.HTTP_HEADERS";
1063
1064    /**
1065     * Bundle extra: Media item status update receiver.
1066     * <p>
1067     * Used with {@link #ACTION_PLAY} or {@link #ACTION_ENQUEUE} to specify
1068     * a {@link PendingIntent} for a
1069     * broadcast receiver that will receive status updates about a particular
1070     * media item.
1071     * </p><p>
1072     * Whenever the status of the media item changes, the media route provider will
1073     * send a broadcast to the pending intent with extras that identify the session
1074     * to which the item belongs, the session status, the item's id
1075     * and the item's updated status.
1076     * </p><p>
1077     * The same pending intent and broadcast receiver may be shared by any number of
1078     * media items since the broadcast intent includes the media session id
1079     * and media item id.
1080     * </p><p>
1081     * The value is a {@link PendingIntent}.
1082     * </p>
1083     *
1084     * <h3>Broadcast extras</h3>
1085     * <ul>
1086     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of
1087     * the session to which the item in question belongs.
1088     * <li>{@link #EXTRA_SESSION_STATUS} <em>(optional, old implementations may
1089     * omit this key)</em>: Specifies the status of the media session.
1090     * <li>{@link #EXTRA_ITEM_ID} <em>(required)</em>: Specifies the media item id of the
1091     * media item in question.
1092     * <li>{@link #EXTRA_ITEM_STATUS} <em>(required)</em>: Specifies the status of the
1093     * item as a bundle that can be decoded into a {@link MediaItemStatus} object.
1094     * </ul>
1095     *
1096     * @see #ACTION_PLAY
1097     * @see #ACTION_ENQUEUE
1098     */
1099    public static final String EXTRA_ITEM_STATUS_UPDATE_RECEIVER =
1100            "android.media.intent.extra.ITEM_STATUS_UPDATE_RECEIVER";
1101
1102    /**
1103     * Integer extra: Error code.
1104     * <p>
1105     * Used with all media control requests to describe the cause of an error.
1106     * This extra may be omitted when the error is unknown.
1107     * </p><p>
1108     * The value is one of: {@link #ERROR_UNKNOWN}, {@link #ERROR_UNSUPPORTED_OPERATION},
1109     * {@link #ERROR_INVALID_SESSION_ID}, {@link #ERROR_INVALID_ITEM_ID}.
1110     * </p>
1111     */
1112    public static final String EXTRA_ERROR_CODE = "android.media.intent.extra.ERROR_CODE";
1113
1114    /**
1115     * Error code: An unknown error occurred.
1116     *
1117     * @see #EXTRA_ERROR_CODE
1118     */
1119    public static final int ERROR_UNKNOWN = 0;
1120
1121    /**
1122     * Error code: The operation is not supported.
1123     *
1124     * @see #EXTRA_ERROR_CODE
1125     */
1126    public static final int ERROR_UNSUPPORTED_OPERATION = 1;
1127
1128    /**
1129     * Error code: The session id specified in the request was invalid.
1130     *
1131     * @see #EXTRA_ERROR_CODE
1132     */
1133    public static final int ERROR_INVALID_SESSION_ID = 2;
1134
1135    /**
1136     * Error code: The item id specified in the request was invalid.
1137     *
1138     * @see #EXTRA_ERROR_CODE
1139     */
1140    public static final int ERROR_INVALID_ITEM_ID = 3;
1141
1142    private MediaControlIntent() {
1143    }
1144}
1145