MediaControlIntent.java revision aaa9719b402f15df68f9536b813e06dcd9a5d73a
1c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown/*
2c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown * Copyright (C) 2013 The Android Open Source Project
3c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown *
4c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown * Licensed under the Apache License, Version 2.0 (the "License");
5c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown * you may not use this file except in compliance with the License.
6c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown * You may obtain a copy of the License at
7c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown *
8c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown *      http://www.apache.org/licenses/LICENSE-2.0
9c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown *
10c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown * Unless required by applicable law or agreed to in writing, software
11c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown * distributed under the License is distributed on an "AS IS" BASIS,
12c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown * See the License for the specific language governing permissions and
14c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown * limitations under the License.
15c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown */
16c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown
17b507e525a61ed761eecfc2eaaf19af7e8db5dca5Jeff Brownpackage android.support.v7.media;
18c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown
1955eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brownimport android.app.PendingIntent;
20c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brownimport android.content.Intent;
21c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brownimport android.net.Uri;
22c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown
23c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown/**
24de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * Constants for media control intents.
25c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown * <p>
26de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * This class declares a set of standard media control intent categories and actions that
27de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * applications can use to identify the capabilities of media routes and control them.
28de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * </p>
2943f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown *
30de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * <h3>Media control intent categories</h3>
3143f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * <p>
32de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * Media control intent categories specify means by which applications can
33de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * send media to the destination of a media route.  Categories are sometimes referred
34de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * to as describing "types" or "kinds" of routes.
35de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * </p><p>
36de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * For example, if a route supports the {@link #CATEGORY_REMOTE_PLAYBACK remote playback category},
373e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * then an application can ask it to play media remotely by sending a
383e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * {@link #ACTION_PLAY play} or {@link #ACTION_ENQUEUE enqueue} intent with the Uri of the
393e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * media content to play.  Such a route may then be referred to as
40de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * a "remote playback route" because it supports remote playback requests.  It is common
41de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * for a route to support multiple categories of requests at the same time, such as
42de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * live audio and live video.
43de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * </p><p>
44de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * The following standard route categories are defined.
4543f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * </p><ul>
4643f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * <li>{@link #CATEGORY_LIVE_AUDIO Live audio}: The route supports streaming live audio
4743f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * from the device to the destination.  Live audio routes include local speakers
4843f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * and Bluetooth headsets.
4943f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * <li>{@link #CATEGORY_LIVE_VIDEO Live video}: The route supports streaming live video
5043f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * from the device to the destination.  Live video routes include local displays
5143f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * and wireless displays that support mirroring and
52de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * {@link android.app.Presentation presentations}.  Live video routes typically also
53de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * support live audio capabilities.
5443f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * <li>{@link #CATEGORY_REMOTE_PLAYBACK Remote playback}: The route supports sending
5543f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * remote playback requests for media content to the destination.  The content to be
5643f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * played is identified by a Uri and mime-type.
57de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * </ul><p>
58de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * Media route providers may define custom media control intent categories of their own in
59de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * addition to the standard ones.  Custom categories can be used to provide a variety
60de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * of features to applications that recognize and know how to use them.  For example,
61de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * a media route provider might define a custom category to indicate that its routes
62de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * support a special device-specific control interface in addition to other
63de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * standard features.
64de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * </p><p>
65de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * Applications can determine which categories a route supports by using the
66de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * {@link MediaRouter.RouteInfo#supportsControlCategory MediaRouter.RouteInfo.supportsControlCategory}
67de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * or {@link MediaRouter.RouteInfo#getControlFilters MediaRouter.RouteInfo.getControlFilters}
68de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * methods.  Applications can also specify the types of routes that they want to use by
69de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * creating {@link MediaRouteSelector media route selectors} that contain the desired
70de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * categories and are used to filter routes in several parts of the media router API.
71de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * </p>
7243f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown *
73de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * <h3>Media control intent actions</h3>
7443f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * <p>
75de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * Media control intent actions specify particular functions that applications
76de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * can ask the destination of a media route to perform.  Media route control requests
77de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * take the form of intents in a similar manner to other intents used to start activities
78de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * or send broadcasts.  The difference is that media control intents are directed to
79de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * routes rather than activity or broadcast receiver components.
80de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * </p><p>
81eff7719415542ba819054863b0995f07742a7a8aJeff Brown * Each media route control intent specifies an action, a category and some number of parameters
82eff7719415542ba819054863b0995f07742a7a8aJeff Brown * that are supplied as extras.  Applications send media control requests to routes using the
83de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * {@link MediaRouter.RouteInfo#sendControlRequest MediaRouter.RouteInfo.sendControlRequest}
84de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * method and receive results via a callback.
8543f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * </p><p>
86de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * All media control intent actions are associated with the media control intent categories
87de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * that support them.  Thus only remote playback routes may perform remote playback actions.
88de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * The documentation of each action specifies the category to which the action belongs,
89de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * the parameters it requires, and the results it returns.
9043f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * </p>
9143f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown *
92de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * <h3>Live audio and live video routes</h3>
9343f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * <p>
94de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * {@link #CATEGORY_LIVE_AUDIO Live audio} and {@link #CATEGORY_LIVE_VIDEO live video}
95de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * routes present media using standard system interfaces such as audio streams,
96de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * {@link android.app.Presentation presentations} or display mirroring.  These routes are
97de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * the easiest to use because applications simply render content locally on the device
98de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * and the system streams it to the route destination automatically.
9943f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * </p><p>
100de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * In most cases, applications can stream content to live audio and live video routes in
101de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * the same way they would play the content locally without any modification.  However,
102de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * applications may also be able to take advantage of more sophisticated features such
103de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * as second-screen presentation APIs that are particular to these routes.
10443f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * </p>
10543f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown *
106de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * <h3>Remote playback routes</h3>
10743f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * <p>
108de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * Remote playback routes present media remotely by playing content from a Uri.
109de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * These routes destinations take responsibility for fetching and rendering content
110de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * on their own.  Applications do not render the content themselves; instead, applications
111eff7719415542ba819054863b0995f07742a7a8aJeff Brown * send control requests to initiate play, pause, resume, or stop media items and receive
112eff7719415542ba819054863b0995f07742a7a8aJeff Brown * status updates as they change state.
113de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * </p>
114de3d4d3c033fc939af83775a443b295a4034444cJeff Brown *
115eff7719415542ba819054863b0995f07742a7a8aJeff Brown * <h4>Sessions</h4>
116de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * <p>
117eff7719415542ba819054863b0995f07742a7a8aJeff Brown * Each remote media playback action is conducted within the scope of a session.
118eff7719415542ba819054863b0995f07742a7a8aJeff Brown * Sessions are used to prevent applications from accidentally interfering with one
119eff7719415542ba819054863b0995f07742a7a8aJeff Brown * another because at most one session can be valid at a time.
120eff7719415542ba819054863b0995f07742a7a8aJeff Brown * </p><p>
121aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * A session can be created using the {@link #ACTION_START_SESSION start session action}
122aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * and terminated using the {@link #ACTION_END_SESSION end session action} when the
123aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * route provides explicit session management features.
124eff7719415542ba819054863b0995f07742a7a8aJeff Brown * </p><p>
125aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * Explicit session management was added in a later revision of the protocol so not
126aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * all routes support it.  If the route does not support explicit session management
127aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * then implicit session management may still be used.  Implicit session management
128aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * relies on the use of the {@link #ACTION_PLAY play} and {@link #ACTION_ENQUEUE enqueue}
129aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * actions which have the side-effect of creating a new session if none is provided
130aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * as argument.
131aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * </p><p>
132aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * When a new session is created, the previous session is invalidated and any ongoing
133aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * media playback is stopped before the requested action is performed.  Any attempt
134aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * to use an invalidated session will result in an error.  (Protocol implementations
135aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * are encouraged to aggressively discard information associated with invalidated sessions
136aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * since it is no longer of use.)
137aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * </p><p>
138aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * Each session is identified by a unique session id that may be used to control
139aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * the session using actions such as pause, resume, stop and end session.
140eff7719415542ba819054863b0995f07742a7a8aJeff Brown * </p>
141de3d4d3c033fc939af83775a443b295a4034444cJeff Brown *
142de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * <h4>Media items</h4>
143de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * <p>
1443e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * Each successful {@link #ACTION_PLAY play} or {@link #ACTION_ENQUEUE enqueue} action
1453e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * returns a unique media item id that an application can use to monitor and control
1463e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * playback.  The media item id may be passed to other actions such as
1473e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * {@link #ACTION_SEEK seek} or {@link #ACTION_GET_STATUS get status}.  It will also appear
1483e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * as a parameter in status update broadcasts to identify the associated playback request.
149eff7719415542ba819054863b0995f07742a7a8aJeff Brown * </p><p>
150eff7719415542ba819054863b0995f07742a7a8aJeff Brown * Each media item is scoped to the session in which it was created.  Therefore media item
151eff7719415542ba819054863b0995f07742a7a8aJeff Brown * ids are only ever used together with session ids.  Media item ids are meaningless
152eff7719415542ba819054863b0995f07742a7a8aJeff Brown * on their own.  When the session is invalidated, all of its media items are also
153eff7719415542ba819054863b0995f07742a7a8aJeff Brown * invalidated.
154de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * </p>
155eff7719415542ba819054863b0995f07742a7a8aJeff Brown *
156eff7719415542ba819054863b0995f07742a7a8aJeff Brown * <h4>The playback queue</h4>
157de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * <p>
158eff7719415542ba819054863b0995f07742a7a8aJeff Brown * Each session has its own playback queue that consists of the media items that
159eff7719415542ba819054863b0995f07742a7a8aJeff Brown * are pending, playing, buffering or paused.  Items are added to the queue when
160eff7719415542ba819054863b0995f07742a7a8aJeff Brown * a playback request is issued.  Items are removed from the queue when they are no
161eff7719415542ba819054863b0995f07742a7a8aJeff Brown * longer eligible for playback (enter terminal states).
162de3d4d3c033fc939af83775a443b295a4034444cJeff Brown * </p><p>
163eff7719415542ba819054863b0995f07742a7a8aJeff Brown * As described in the {@link MediaItemStatus} class, media items initially
164eff7719415542ba819054863b0995f07742a7a8aJeff Brown * start in a pending state, transition to the playing (or buffering or paused) state
165eff7719415542ba819054863b0995f07742a7a8aJeff Brown * during playback, and end in a finished, canceled, invalidated or error state.
166eff7719415542ba819054863b0995f07742a7a8aJeff Brown * Once the current item enters a terminal state, playback proceeds on to the
167eff7719415542ba819054863b0995f07742a7a8aJeff Brown * next item.
16843f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * </p><p>
1693e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * The application should determine whether the route supports queuing by checking
1703e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * whether the {@link #ACTION_ENQUEUE} action is declared in the route's control filter
1713e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * using {@link MediaRouter.RouteInfo#supportsControlRequest RouteInfo.supportsControlRequest}.
1723e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * </p><p>
1733e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * If the {@link #ACTION_ENQUEUE} action is supported by the route, then the route promises
1743e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * to allow at least two items (possibly more) to be enqueued at a time.  Enqueued items play
1753e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * back to back one after the other as the previous item completes.  Ideally there should
1763e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * be no audible pause between items for standard audio content types.
1773e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * </p><p>
1783e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * If the {@link #ACTION_ENQUEUE} action is not supported by the route, then the queue
1793e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * effectively contains at most one item at a time.  Each play action has the effect of
1803e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * clearing the queue and resetting its state before the next item is played.
181eff7719415542ba819054863b0995f07742a7a8aJeff Brown * </p>
182eff7719415542ba819054863b0995f07742a7a8aJeff Brown *
183eff7719415542ba819054863b0995f07742a7a8aJeff Brown * <h4>Impact of pause, resume, stop and play actions on the playback queue</h4>
184eff7719415542ba819054863b0995f07742a7a8aJeff Brown * <p>
185eff7719415542ba819054863b0995f07742a7a8aJeff Brown * The pause, resume and stop actions affect the session's whole queue.  Pause causes
186eff7719415542ba819054863b0995f07742a7a8aJeff Brown * the playback queue to be suspended no matter which item is currently playing.
187eff7719415542ba819054863b0995f07742a7a8aJeff Brown * Resume reverses the effects of pause.  Stop clears the queue and also resets
188eff7719415542ba819054863b0995f07742a7a8aJeff Brown * the pause flag just like resume.
18943f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * </p><p>
190eff7719415542ba819054863b0995f07742a7a8aJeff Brown * As described earlier, the play action has the effect of clearing the queue
191eff7719415542ba819054863b0995f07742a7a8aJeff Brown * and completely resetting its state (like the stop action) then enqueuing a
192eff7719415542ba819054863b0995f07742a7a8aJeff Brown * new media item to be played immediately.  Play is therefore equivalent
193eff7719415542ba819054863b0995f07742a7a8aJeff Brown * to stop followed by an action to enqueue an item.
19443f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * </p><p>
195eff7719415542ba819054863b0995f07742a7a8aJeff Brown * The play action is also special in that it can be used to create new sessions.
196eff7719415542ba819054863b0995f07742a7a8aJeff Brown * An application with simple needs may find that it only needs to use play
197eff7719415542ba819054863b0995f07742a7a8aJeff Brown * (and occasionally stop) to control playback.
198eff7719415542ba819054863b0995f07742a7a8aJeff Brown * </p>
199eff7719415542ba819054863b0995f07742a7a8aJeff Brown *
200eff7719415542ba819054863b0995f07742a7a8aJeff Brown * <h4>Resolving conflicts between applications</h4>
201eff7719415542ba819054863b0995f07742a7a8aJeff Brown * <p>
202eff7719415542ba819054863b0995f07742a7a8aJeff Brown * When an application has a valid session, it is essentially in control of remote playback
203eff7719415542ba819054863b0995f07742a7a8aJeff Brown * on the route.  No other application can view or modify the remote playback state
204eff7719415542ba819054863b0995f07742a7a8aJeff Brown * of that applicaton's session without knowing its id.
205eff7719415542ba819054863b0995f07742a7a8aJeff Brown * </p><p>
206eff7719415542ba819054863b0995f07742a7a8aJeff Brown * However, other applications can perform actions that have the effect of stopping
207eff7719415542ba819054863b0995f07742a7a8aJeff Brown * playback and invalidating the current session.  When this occurs, the former application
208eff7719415542ba819054863b0995f07742a7a8aJeff Brown * will be informed that it has lost control by way of individual media item status
209eff7719415542ba819054863b0995f07742a7a8aJeff Brown * update broadcasts that indicate that its queued media items have become
210eff7719415542ba819054863b0995f07742a7a8aJeff Brown * {@link MediaItemStatus#PLAYBACK_STATE_INVALIDATED invalidated}.  This broadcast
211eff7719415542ba819054863b0995f07742a7a8aJeff Brown * implies that playback was terminated abnormally by an external cause.
212eff7719415542ba819054863b0995f07742a7a8aJeff Brown * </p><p>
213eff7719415542ba819054863b0995f07742a7a8aJeff Brown * Applications should handle conflicts conservatively to allow other applications to
214eff7719415542ba819054863b0995f07742a7a8aJeff Brown * smoothly assume control over the route.  When a conflict occurs, the currently playing
215eff7719415542ba819054863b0995f07742a7a8aJeff Brown * application should release its session and allow the new application to use the
216eff7719415542ba819054863b0995f07742a7a8aJeff Brown * route until such time as the user intervenes to take over the route again and begin
217eff7719415542ba819054863b0995f07742a7a8aJeff Brown * a new playback session.
218eff7719415542ba819054863b0995f07742a7a8aJeff Brown * </p>
219eff7719415542ba819054863b0995f07742a7a8aJeff Brown *
2203e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * <h4>Basic actions</h4>
221eff7719415542ba819054863b0995f07742a7a8aJeff Brown * <p>
2223e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * The following basic actions must be supported (all or nothing) by all remote
2233e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * playback routes.  These actions form the basis of the remote playback protocol
2243e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * and are required in all implementations.
225eff7719415542ba819054863b0995f07742a7a8aJeff Brown * </p><ul>
226eff7719415542ba819054863b0995f07742a7a8aJeff Brown * <li>{@link #ACTION_PLAY Play}: Starts playing content specified by a given Uri
227eff7719415542ba819054863b0995f07742a7a8aJeff Brown * and returns a new media item id to describe the request.  Implicitly creates a new
228eff7719415542ba819054863b0995f07742a7a8aJeff Brown * session if no session id was specified as a parameter.
229eff7719415542ba819054863b0995f07742a7a8aJeff Brown * <li>{@link #ACTION_SEEK Seek}: Sets the content playback position of a specific media item.
230eff7719415542ba819054863b0995f07742a7a8aJeff Brown * <li>{@link #ACTION_GET_STATUS Get status}: Gets the status of a media item
231eff7719415542ba819054863b0995f07742a7a8aJeff Brown * including the item's current playback position and progress.
232eff7719415542ba819054863b0995f07742a7a8aJeff Brown * <li>{@link #ACTION_PAUSE Pause}: Pauses playback of the queue.
233eff7719415542ba819054863b0995f07742a7a8aJeff Brown * <li>{@link #ACTION_RESUME Resume}: Resumes playback of the queue.
234eff7719415542ba819054863b0995f07742a7a8aJeff Brown * <li>{@link #ACTION_STOP Stop}: Stops playback, clears the queue, and resets the
235eff7719415542ba819054863b0995f07742a7a8aJeff Brown * pause state.
236eff7719415542ba819054863b0995f07742a7a8aJeff Brown * </ul>
237eff7719415542ba819054863b0995f07742a7a8aJeff Brown *
2383e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * <h4>Queue actions</h4>
2393e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * <p>
2403e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * The following queue actions must be supported (all or nothing) by remote
2413e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * playback routes that offer optional queuing capabilities.
2423e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * </p><ul>
2433e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * <li>{@link #ACTION_ENQUEUE Enqueue}: Enqueues content specified by a given Uri
2443e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * and returns a new media item id to describe the request.  Implicitly creates a new
2453e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * session if no session id was specified as a parameter.
2463e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * <li>{@link #ACTION_REMOVE Remove}: Removes a specified media item from the queue.
2473e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown * </ul>
2483e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown *
249aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * <h4>Session actions</h4>
250aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * <p>
251aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * The following session actions must be supported (all or nothing) by remote
252aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * playback routes that offer optional session management capabilities.
253aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * </p><ul>
254aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * <li>{@link #ACTION_START_SESSION Start session}: Starts a new session explicitly.
255aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * <li>{@link #ACTION_GET_SESSION_STATUS Get session status}: Gets the status of a session.
256aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * <li>{@link #ACTION_END_SESSION End session}: Ends a session explicitly.
257aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown * </ul>
258aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown *
259eff7719415542ba819054863b0995f07742a7a8aJeff Brown * <h4>Implementation note</h4>
260eff7719415542ba819054863b0995f07742a7a8aJeff Brown * <p>
261eff7719415542ba819054863b0995f07742a7a8aJeff Brown * Implementations of the remote playback protocol must implement <em>all</em> of the
262eff7719415542ba819054863b0995f07742a7a8aJeff Brown * documented actions, parameters and results.  Note that the documentation is written from
263eff7719415542ba819054863b0995f07742a7a8aJeff Brown * the perspective of a client of the protocol.  In particular, whenever a parameter
264eff7719415542ba819054863b0995f07742a7a8aJeff Brown * is described as being "optional", it is only from the perspective of the client.
265eff7719415542ba819054863b0995f07742a7a8aJeff Brown * Compliant media route provider implementations of this protocol must support all
266eff7719415542ba819054863b0995f07742a7a8aJeff Brown * of the features described herein.
26743f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown * </p>
268c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown */
269c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brownpublic final class MediaControlIntent {
270c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown    /**
271c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * Media control category: Live audio.
272c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * <p>
273c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * A route that supports live audio routing will allow the media audio stream
274c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * to be sent to supported destinations.  This can include internal speakers or
275c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * audio jacks on the device itself, A2DP devices, and more.
276c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * </p><p>
277c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * When a live audio route is selected, audio routing is transparent to the application.
278c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * All audio played on the media stream will be routed to the selected destination.
279c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * </p>
280c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     */
281c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown    public static final String CATEGORY_LIVE_AUDIO = "android.media.intent.category.LIVE_AUDIO";
282c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown
283c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown    /**
284c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * Media control category: Live video.
285c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * <p>
286c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * A route that supports live video routing will allow a mirrored version
287c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * of the device's primary display or a customized
288c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * {@link android.app.Presentation Presentation} to be sent to supported
289c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * destinations.
290c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * </p><p>
291c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * When a live video route is selected, audio and video routing is transparent
292c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * to the application.  By default, audio and video is routed to the selected
293c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * destination.  For certain live video routes, the application may also use a
294c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * {@link android.app.Presentation Presentation} to replace the mirrored view
295c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * on the external display with different content.
296c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * </p>
297c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     *
298c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * @see MediaRouter.RouteInfo#getPresentationDisplay()
299c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * @see android.app.Presentation
300c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     */
301c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown    public static final String CATEGORY_LIVE_VIDEO = "android.media.intent.category.LIVE_VIDEO";
302c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown
303c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown    /**
304c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * Media control category: Remote playback.
305c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * <p>
306c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * A route that supports remote playback routing will allow an application to send
307c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * requests to play content remotely to supported destinations.
308c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * </p><p>
309c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * Remote playback routes destinations operate independently of the local device.
310c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * When a remote playback route is selected, the application can control the content
311c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * playing on the destination by sending media control actions to the route.
312c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * The application may also receive status updates from the route regarding
313c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * remote playback.
314c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * </p>
315c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     *
316c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * @see MediaRouter.RouteInfo#sendControlRequest
317c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     */
318c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown    public static final String CATEGORY_REMOTE_PLAYBACK =
319c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown            "android.media.intent.category.REMOTE_PLAYBACK";
320c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown
321eff7719415542ba819054863b0995f07742a7a8aJeff Brown    /* Remote playback actions that affect individual items. */
322eff7719415542ba819054863b0995f07742a7a8aJeff Brown
323c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown    /**
324eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * Remote playback media control action: Play media item.
325c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * <p>
326c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
327c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * media control.
328c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * </p><p>
329c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * This action causes a remote playback route to start playing content with
330c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * the {@link Uri} specified in the {@link Intent}'s {@link Intent#getData() data uri}.
331eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * The action returns a media session id and media item id which can be used
332eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * to control playback using other remote playback actions.
333c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * </p><p>
334eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * Once initiated, playback of the specified content will be managed independently
335eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * by the destination.  The application will receive status updates as the state
336eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * of the media item changes.
33755eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown     * </p><p>
33855eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown     * If the data uri specifies an HTTP or HTTPS scheme, then the destination is
33955eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown     * responsible for following HTTP redirects to a reasonable depth of at least 3
34055eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown     * levels as might typically be handled by a web browser.  If an HTTP error
3413d4c9459ed77f732dd3ba602713af6ebf9280c8cJeff Brown     * occurs, then the destination should send a {@link MediaItemStatus status update}
3423d4c9459ed77f732dd3ba602713af6ebf9280c8cJeff Brown     * back to the client indicating the {@link MediaItemStatus#PLAYBACK_STATE_ERROR error}
343eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * {@link MediaItemStatus#getPlaybackState() playback state}.
344c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * </p>
345c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     *
346eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <h3>One item at a time</h3>
347de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * <p>
348eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * Each successful play action <em>replaces</em> the previous play action.
349eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * If an item is already playing, then it is canceled, the session's playback queue
350eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * is cleared and the new item begins playing immediately (regardless of
351eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * whether the previously playing item had been paused).
352eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * </p><p>
353eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * Play is therefore equivalent to {@link #ACTION_STOP stop} followed by an action
354eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * to enqueue a new media item to be played immediately.
355eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * </p>
356eff7719415542ba819054863b0995f07742a7a8aJeff Brown     *
357eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <h3>Sessions</h3>
358eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <p>
359eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * This request has the effect of implicitly creating a media session whenever the
360eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * application does not specify the {@link #EXTRA_SESSION_ID session id} parameter.
361eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * Because there can only be at most one valid session at a time, creating a new session
362eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * has the side-effect of invalidating any existing sessions and their media items,
363eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * then handling the playback request with a new session.
364eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * </p><p>
365eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * If the application specifies an invalid session id, then an error is returned.
366eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * When this happens, the application should assume that its session
367eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * is no longer valid.  To obtain a new session, the application may try again
368eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * and omit the session id parameter.  However, the application should
369eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * only retry requests due to an explicit action performed by the user,
370eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * such as the user clicking on a "play" button in the UI, since another
371eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * application may be trying to take control of the route and the former
372eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * application should try to stay out of its way.
373eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * </p><p>
374eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * For more information on sessions, queues and media items, please refer to the
375eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * class documentation.
376de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * </p>
377de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     *
378c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * <h3>Request parameters</h3>
379c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * <ul>
380eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_SESSION_ID} <em>(optional)</em>: Specifies the session id of the
381eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * session to which the playback request belongs.  If omitted, a new session
382eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * is created implicitly.
383eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_ITEM_CONTENT_POSITION} <em>(optional)</em>: Specifies the initial
384ba811896e3057cb48ad0f017efe1bf0c262430ecJeff Brown     * content playback position as a long integer number of milliseconds from
385ba811896e3057cb48ad0f017efe1bf0c262430ecJeff Brown     * the beginning of the content.
386eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_ITEM_METADATA} <em>(optional)</em>: Specifies metadata associated
387de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * with the content such as the title of a song.
388eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_ITEM_STATUS_UPDATE_RECEIVER} <em>(optional)</em>: Specifies a
389de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * {@link PendingIntent} for a broadcast receiver that will receive status updates
390de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * about the media item.
391c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * </ul>
392c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     *
393c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * <h3>Result data</h3>
394c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * <ul>
395eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_SESSION_ID} <em>(always returned)</em>: Specifies the session id of the
396eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * session that was affected by the request.  This will be a new session in
397eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * the case where no session id was supplied as a parameter.
398aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <li>{@link #EXTRA_SESSION_STATUS} <em>(optional, old implementations may
399aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * omit this key)</em>: Specifies the status of the media session.
400eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_ITEM_ID} <em>(always returned)</em>: Specifies an opaque string identifier
401eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * to use to refer to the media item in subsequent requests such as
402eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * {@link #ACTION_GET_STATUS}.
403eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_ITEM_STATUS} <em>(always returned)</em>: Specifies the initial status of
404eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * the new media item.
405c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * </ul>
406c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     *
40755eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown     * <h3>Status updates</h3>
40855eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown     * <p>
4093e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * If the client supplies an
4103e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * {@link #EXTRA_ITEM_STATUS_UPDATE_RECEIVER item status update receiver}
41155eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown     * then the media route provider is responsible for sending status updates to the receiver
4123d4c9459ed77f732dd3ba602713af6ebf9280c8cJeff Brown     * when significant media item state changes occur such as when playback starts or
4133d4c9459ed77f732dd3ba602713af6ebf9280c8cJeff Brown     * stops.  The receiver will not be invoked for content playback position changes.
4143d4c9459ed77f732dd3ba602713af6ebf9280c8cJeff Brown     * The application may retrieve the current playback position when necessary
4153d4c9459ed77f732dd3ba602713af6ebf9280c8cJeff Brown     * using the {@link #ACTION_GET_STATUS} request.
4163d4c9459ed77f732dd3ba602713af6ebf9280c8cJeff Brown     * </p><p>
4173d4c9459ed77f732dd3ba602713af6ebf9280c8cJeff Brown     * Refer to {@link MediaItemStatus} for details.
41855eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown     * </p>
41955eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown     *
420eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <h3>Errors</h3>
421eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <p>
422eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * This action returns an error if a session id was provided but is unknown or
423eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * no longer valid, if the item Uri or content type is not supported, or if
424eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * any other arguments are invalid.
425eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * </p>
426eff7719415542ba819054863b0995f07742a7a8aJeff Brown     *
427c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * <h3>Example</h3>
428c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * <pre>
429c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * MediaRouter mediaRouter = MediaRouter.getInstance(context);
430c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * MediaRouter.RouteInfo route = mediaRouter.getSelectedRoute();
431c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * Intent intent = new Intent(MediaControlIntent.ACTION_PLAY);
432c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * intent.addCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK);
433c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * intent.setDataAndType("http://example.com/videos/movie.mp4", "video/mp4");
434fa326a4649d9d0e8113e315f6c8251fe686abce4Jeff Brown     * if (route.supportsControlRequest(intent)) {
435fa326a4649d9d0e8113e315f6c8251fe686abce4Jeff Brown     *     MediaRouter.ControlRequestCallback callback = new MediaRouter.ControlRequestCallback() {
436de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     *         public void onResult(Bundle data) {
437de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     *             // The request succeeded.
438eff7719415542ba819054863b0995f07742a7a8aJeff Brown     *             // Playback may be controlled using the returned session and item id.
439eff7719415542ba819054863b0995f07742a7a8aJeff Brown     *             String sessionId = data.getString(MediaControlIntent.EXTRA_SESSION_ID);
440de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     *             String itemId = data.getString(MediaControlIntent.EXTRA_ITEM_ID);
441de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     *             MediaItemStatus status = MediaItemStatus.fromBundle(data.getBundle(
442de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     *                     MediaControlIntent.EXTRA_ITEM_STATUS));
443de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     *             // ...
444de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     *         }
445de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     *
446de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     *         public void onError(String message, Bundle data) {
447de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     *             // An error occurred!
448c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     *         }
449fa326a4649d9d0e8113e315f6c8251fe686abce4Jeff Brown     *     };
450fa326a4649d9d0e8113e315f6c8251fe686abce4Jeff Brown     *     route.sendControlRequest(intent, callback);
451c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * }</pre>
452c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     *
453c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * @see MediaRouter.RouteInfo#sendControlRequest
454c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * @see #CATEGORY_REMOTE_PLAYBACK
45543f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * @see #ACTION_SEEK
45643f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * @see #ACTION_GET_STATUS
457eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * @see #ACTION_PAUSE
458eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * @see #ACTION_RESUME
459eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * @see #ACTION_STOP
460c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     */
461c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown    public static final String ACTION_PLAY = "android.media.intent.action.PLAY";
462c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown
463c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown    /**
464eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * Remote playback media control action: Enqueue media item.
465129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * <p>
466129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
467129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * media control.
468129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </p><p>
469eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * This action works just like {@link #ACTION_PLAY play} except that it does
470eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * not clear the queue or reset the pause state when it enqueues the
471eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * new media item into the session's playback queue.  This action only
472eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * enqueues a media item with no other side-effects on the queue.
473129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </p><p>
474eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * If the queue is currently empty and then the item will play immediately
475eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * (assuming the queue is not paused).  Otherwise, the item will play
476eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * after all earlier items in the queue have finished or been removed.
477de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * </p><p>
478eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * The enqueue action can be used to create new sessions just like play.
479eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * Its parameters and results are also the same.  Only the queuing behavior
480eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * is different.
481129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </p>
482129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     *
483eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * @see #ACTION_PLAY
484129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     */
485eff7719415542ba819054863b0995f07742a7a8aJeff Brown    public static final String ACTION_ENQUEUE = "android.media.intent.action.ENQUEUE";
486129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown
487129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown    /**
488eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * Remote playback media control action: Seek media item to a new playback position.
48943f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * <p>
49043f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
49143f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * media control.
49243f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * </p><p>
493eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * This action causes a remote playback route to modify the current playback position
494eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * of the specified media item.
49543f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * </p><p>
496de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * This action only affects the playback position of the media item; not its playback state.
497eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * If the playback queue is paused, then seeking sets the position but the item
498eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * remains paused.  Likewise if the item is playing, then seeking will cause playback
499eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * to jump to the new position and continue playing from that point.  If the item has
500eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * not yet started playing, then the new playback position is remembered by the
501eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * queue and used as the item's initial content position when playback eventually begins.
502eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * </p><p>
503eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * If successful, the media item's playback position is changed.
50443f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * </p>
50543f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     *
50643f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * <h3>Request parameters</h3>
50743f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * <ul>
508eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of the session
509de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * to which the media item belongs.
510eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_ITEM_ID} <em>(required)</em>: Specifies the media item id of
511de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * the media item to seek.
512eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_ITEM_CONTENT_POSITION} <em>(required)</em>: Specifies the new
513ba811896e3057cb48ad0f017efe1bf0c262430ecJeff Brown     * content position for playback as a long integer number of milliseconds from
514ba811896e3057cb48ad0f017efe1bf0c262430ecJeff Brown     * the beginning of the content.
51543f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * </ul>
51643f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     *
51743f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * <h3>Result data</h3>
51843f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * <ul>
519aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <li>{@link #EXTRA_SESSION_STATUS} <em>(optional, old implementations may
520aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * omit this key)</em>: Specifies the status of the media session.
521eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_ITEM_STATUS} <em>(always returned)</em>: Specifies the new status of
522eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * the media item.
52343f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * </ul>
52443f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     *
525eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <h3>Errors</h3>
526eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <p>
527eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * This action returns an error if the session id or media item id are unknown
528eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * or no longer valid, if the content position is invalid, or if the media item
529eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * is in a terminal state.
530eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * </p>
531eff7719415542ba819054863b0995f07742a7a8aJeff Brown     *
53243f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * @see MediaRouter.RouteInfo#sendControlRequest
53343f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * @see #CATEGORY_REMOTE_PLAYBACK
53443f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     */
535de3d4d3c033fc939af83775a443b295a4034444cJeff Brown    public static final String ACTION_SEEK = "android.media.intent.action.SEEK";
53643f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown
53743f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown    /**
538eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * Remote playback media control action: Get media item playback status
539eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * and progress information.
540129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * <p>
541129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
542129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * media control.
543129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </p><p>
544de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * This action asks a remote playback route to provide updated playback status and progress
545de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * information about the specified media item.
546129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </p>
547129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     *
548129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * <h3>Request parameters</h3>
549129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * <ul>
550eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of the session
551de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * to which the media item belongs.
552eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_ITEM_ID} <em>(required)</em>: Specifies the media item id of
553de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * the media item to query.
554129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </ul>
555129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     *
556129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * <h3>Result data</h3>
557129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * <ul>
558aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <li>{@link #EXTRA_SESSION_STATUS} <em>(optional, old implementations may
559aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * omit this key)</em>: Specifies the status of the media session.
560eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_ITEM_STATUS} <em>(always returned)</em>: Specifies the current status of
561eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * the media item.
562129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </ul>
563129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     *
564eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <h3>Errors</h3>
565eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <p>
566eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * This action returns an error if the session id or media item id are unknown
567eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * or no longer valid.
568eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * </p>
569eff7719415542ba819054863b0995f07742a7a8aJeff Brown     *
570129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * @see MediaRouter.RouteInfo#sendControlRequest
571129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * @see #CATEGORY_REMOTE_PLAYBACK
572de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * @see #EXTRA_ITEM_STATUS_UPDATE_RECEIVER
573129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     */
574de3d4d3c033fc939af83775a443b295a4034444cJeff Brown    public static final String ACTION_GET_STATUS = "android.media.intent.action.GET_STATUS";
575129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown
576129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown    /**
577eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * Remote playback media control action: Remove media item from session's queue.
578129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * <p>
579129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
580129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * media control.
581129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </p><p>
582eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * This action asks a remote playback route to remove the specified media item
583eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * from the session's playback queue.  If the current item is removed, then
584eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * playback will proceed to the next media item (assuming the queue has not been
585eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * paused).
586eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * </p><p>
587eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * This action does not affect the pause state of the queue.  If the queue was paused
588eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * then it remains paused (even if it is now empty) until a resume, stop or play
589eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * action is issued that causes the pause state to be cleared.
590129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </p>
591129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     *
592129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * <h3>Request parameters</h3>
593129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * <ul>
594eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of the session
595eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * to which the media item belongs.
596eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_ITEM_ID} <em>(required)</em>: Specifies the media item id of
597eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * the media item to remove.
598129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </ul>
599129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     *
600129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * <h3>Result data</h3>
601129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * <ul>
602aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <li>{@link #EXTRA_SESSION_STATUS} <em>(optional, old implementations may
603aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * omit this key)</em>: Specifies the status of the media session.
604eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_ITEM_STATUS} <em>(always returned)</em>: Specifies the new status of
605eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * the media item.
606129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </ul>
607129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     *
608eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <h3>Errors</h3>
609eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <p>
610eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * This action returns an error if the session id or media item id are unknown
611eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * or no longer valid, or if the media item is in a terminal state (and therefore
612eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * no longer in the queue).
613eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * </p>
614eff7719415542ba819054863b0995f07742a7a8aJeff Brown     *
615129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * @see MediaRouter.RouteInfo#sendControlRequest
616129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * @see #CATEGORY_REMOTE_PLAYBACK
617129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     */
618eff7719415542ba819054863b0995f07742a7a8aJeff Brown    public static final String ACTION_REMOVE = "android.media.intent.action.REMOVE";
619eff7719415542ba819054863b0995f07742a7a8aJeff Brown
620eff7719415542ba819054863b0995f07742a7a8aJeff Brown    /* Remote playback actions that affect the whole playback queue. */
621129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown
622129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown    /**
623eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * Remote playback media control action: Pause media playback.
624129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * <p>
625129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
626129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * media control.
627129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </p><p>
628eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * This action causes the playback queue of the specified session to be paused.
629129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </p>
630129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     *
631129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * <h3>Request parameters</h3>
632129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * <ul>
633eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of the session
634eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * whose playback queue is to be paused.
635129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </ul>
636129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     *
637129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * <h3>Result data</h3>
638129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * <ul>
639aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <li>{@link #EXTRA_SESSION_STATUS} <em>(optional, old implementations may
640aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * omit this key)</em>: Specifies the status of the media session.
641129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </ul>
642129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     *
643eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <h3>Errors</h3>
644eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <p>
645eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * This action returns an error if the session id is unknown or no longer valid.
646eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * </p>
647eff7719415542ba819054863b0995f07742a7a8aJeff Brown     *
648129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * @see MediaRouter.RouteInfo#sendControlRequest
649129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * @see #CATEGORY_REMOTE_PLAYBACK
650eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * @see #ACTION_RESUME
651129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     */
652eff7719415542ba819054863b0995f07742a7a8aJeff Brown    public static final String ACTION_PAUSE = "android.media.intent.action.PAUSE";
653129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown
654129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown    /**
655eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * Remote playback media control action: Resume media playback (unpause).
656c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * <p>
657de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
658de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * media control.
659c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * </p><p>
660eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * This action causes the playback queue of the specified session to be resumed.
661eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * Reverses the effects of {@link #ACTION_PAUSE}.
662c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * </p>
663c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     *
664de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * <h3>Request parameters</h3>
665de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * <ul>
666eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of the session
667eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * whose playback queue is to be resumed.
668de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * </ul>
669de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     *
670de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * <h3>Result data</h3>
671de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * <ul>
672aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <li>{@link #EXTRA_SESSION_STATUS} <em>(optional, old implementations may
673aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * omit this key)</em>: Specifies the status of the media session.
674de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * </ul>
675de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     *
676eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <h3>Errors</h3>
677eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <p>
678eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * This action returns an error if the session id is unknown or no longer valid.
679eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * </p>
680eff7719415542ba819054863b0995f07742a7a8aJeff Brown     *
681de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * @see MediaRouter.RouteInfo#sendControlRequest
682de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * @see #CATEGORY_REMOTE_PLAYBACK
683eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * @see #ACTION_PAUSE
684c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     */
685eff7719415542ba819054863b0995f07742a7a8aJeff Brown    public static final String ACTION_RESUME = "android.media.intent.action.RESUME";
686c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown
687c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown    /**
688eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * Remote playback media control action: Stop media playback (clear queue and unpause).
689c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * <p>
690eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
691eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * media control.
692de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * </p><p>
693eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * This action causes a remote playback route to stop playback, cancel and remove
694eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * all media items from the session's media item queue and, reset the queue's
695eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * pause state.
696eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * </p><p>
697eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * If successful, the status of all media items in the queue is set to
698eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * {@link MediaItemStatus#PLAYBACK_STATE_CANCELED canceled} and a status update is sent
699eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * to the appropriate status update receivers indicating the new status of each item.
700eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * </p>
701eff7719415542ba819054863b0995f07742a7a8aJeff Brown     *
702eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <h3>Request parameters</h3>
703eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <ul>
704eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of
705eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * the session whose playback queue is to be stopped (cleared and unpaused).
706eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * </ul>
707eff7719415542ba819054863b0995f07742a7a8aJeff Brown     *
708eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <h3>Result data</h3>
709eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <ul>
710aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <li>{@link #EXTRA_SESSION_STATUS} <em>(optional, old implementations may
711aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * omit this key)</em>: Specifies the status of the media session.
712eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * </ul>
713eff7719415542ba819054863b0995f07742a7a8aJeff Brown     *
714eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <h3>Errors</h3>
715eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <p>
716eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * This action returns an error if the session id is unknown or no longer valid.
717eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * </p>
718eff7719415542ba819054863b0995f07742a7a8aJeff Brown     *
719eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * @see MediaRouter.RouteInfo#sendControlRequest
720eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * @see #CATEGORY_REMOTE_PLAYBACK
721eff7719415542ba819054863b0995f07742a7a8aJeff Brown     */
722eff7719415542ba819054863b0995f07742a7a8aJeff Brown    public static final String ACTION_STOP = "android.media.intent.action.STOP";
723eff7719415542ba819054863b0995f07742a7a8aJeff Brown
724eff7719415542ba819054863b0995f07742a7a8aJeff Brown    /**
725aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * Remote playback media control action: Start session.
726aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <p>
727aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
728aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * media control.
729aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p><p>
730aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * This action causes a remote playback route to invalidate the current session
731aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * and start a new session.  The new session initially has an empty queue.
732aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p><p>
733aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * If successful, the status of all media items in the previous session's queue is set to
734aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * {@link MediaItemStatus#PLAYBACK_STATE_INVALIDATED invalidated} and a status update
735aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * is sent to the appropriate status update receivers indicating the new status
736aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * of each item.  The previous session becomes no longer valid and the new session
737aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * takes control of the route.
738aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p>
739aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     *
740aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <h3>Request parameters</h3>
741aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <ul>
742aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <li>{@link #EXTRA_SESSION_STATUS_UPDATE_RECEIVER} <em>(optional)</em>: Specifies a
743aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * {@link PendingIntent} for a broadcast receiver that will receive status updates
744aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * about the media session.
745aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </ul>
746aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     *
747aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <h3>Result data</h3>
748aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <ul>
749aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <li>{@link #EXTRA_SESSION_ID} <em>(always returned)</em>: Specifies the session id of the
750aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * session that was started by the request.  This will always be a brand new session
751aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * distinct from any other previously created sessions.
752aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <li>{@link #EXTRA_SESSION_STATUS} <em>(always returned)</em>: Specifies the
753aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * status of the media session.
754aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </ul>
755aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     *
756aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <h3>Status updates</h3>
757aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <p>
758aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * If the client supplies a
759aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * {@link #EXTRA_SESSION_STATUS_UPDATE_RECEIVER status update receiver}
760aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * then the media route provider is responsible for sending status updates to the receiver
761aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * when significant media session state changes occur such as when the session's
762aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * queue is paused or resumed or when the session is terminated or invalidated.
763aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p><p>
764aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * Refer to {@link MediaSessionStatus} for details.
765aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p>
766aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     *
767aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <h3>Errors</h3>
768aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <p>
769aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * This action returns an error if the session could not be created.
770aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p>
771aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     *
772aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see MediaRouter.RouteInfo#sendControlRequest
773aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see #CATEGORY_REMOTE_PLAYBACK
774aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     */
775aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown    public static final String ACTION_START_SESSION = "android.media.intent.action.START_SESSION";
776aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown
777aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown    /**
778aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * Remote playback media control action: Get media session status information.
779aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <p>
780aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
781aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * media control.
782aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p><p>
783aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * This action asks a remote playback route to provide updated status information
784aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * about the specified media session.
785aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p>
786aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     *
787aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <h3>Request parameters</h3>
788aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <ul>
789aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of the
790aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * session whose status is to be retrieved.
791aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </ul>
792aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     *
793aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <h3>Result data</h3>
794aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <ul>
795aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <li>{@link #EXTRA_SESSION_STATUS} <em>(always returned)</em>: Specifies the
796aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * current status of the media session.
797aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </ul>
798aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     *
799aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <h3>Errors</h3>
800aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <p>
801aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * This action returns an error if the session id is unknown or no longer valid.
802aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p>
803aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     *
804aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see MediaRouter.RouteInfo#sendControlRequest
805aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see #CATEGORY_REMOTE_PLAYBACK
806aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see #EXTRA_SESSION_STATUS_UPDATE_RECEIVER
807aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     */
808aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown    public static final String ACTION_GET_SESSION_STATUS =
809aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown            "android.media.intent.action.GET_SESSION_STATUS";
810aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown
811aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown    /**
812aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * Remote playback media control action: End session.
813aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <p>
814aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * Used with routes that support {@link #CATEGORY_REMOTE_PLAYBACK remote playback}
815aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * media control.
816aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p><p>
817aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * This action causes a remote playback route to end the specified session.
818aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * The session becomes no longer valid and the route ceases to be under control
819aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * of the session.
820aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p><p>
821aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * If successful, the status of the session is set to
822aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * {@link MediaSessionStatus#SESSION_STATE_ENDED} and a status update is sent to
823aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * the session's status update receiver.
824aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p><p>
825aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * Additionally, the status of all media items in the queue is set to
826aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * {@link MediaItemStatus#PLAYBACK_STATE_CANCELED canceled} and a status update is sent
827aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * to the appropriate status update receivers indicating the new status of each item.
828aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p>
829aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     *
830aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <h3>Request parameters</h3>
831aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <ul>
832aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of
833aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * the session to end.
834aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </ul>
835aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     *
836aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <h3>Result data</h3>
837aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <ul>
838aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <li>{@link #EXTRA_SESSION_STATUS} <em>(always returned)</em>: Specifies the
839aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * status of the media session.
840aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </ul>
841aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     *
842aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <h3>Errors</h3>
843aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <p>
844aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * This action returns an error if the session id is unknown or no longer valid.
845aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * In other words, it is an error to attempt to end a session other than the
846aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * current session.
847aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p>
848aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     *
849aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see MediaRouter.RouteInfo#sendControlRequest
850aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see #CATEGORY_REMOTE_PLAYBACK
851aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     */
852aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown    public static final String ACTION_END_SESSION = "android.media.intent.action.END_SESSION";
853aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown
854aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown    /**
855eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * Bundle extra: Media session id.
856eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <p>
857eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * An opaque unique identifier that identifies the remote playback media session.
858eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * </p><p>
859eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * Used with various actions to specify the id of the media session to be controlled.
860de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * </p><p>
861de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * Included in broadcast intents sent to
8623e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * {@link #EXTRA_ITEM_STATUS_UPDATE_RECEIVER item status update receivers} to identify
863eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * the session to which the item in question belongs.
86455eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown     * </p><p>
865aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * Included in broadcast intents sent to
866aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * {@link #EXTRA_SESSION_STATUS_UPDATE_RECEIVER session status update receivers} to identify
867aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * the session.
868aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p><p>
869de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * The value is a unique string value generated by the media route provider
870eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * to represent one particular media session.
871c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * </p>
872c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     *
873de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * @see #ACTION_PLAY
874de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * @see #ACTION_SEEK
875de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * @see #ACTION_GET_STATUS
876eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * @see #ACTION_PAUSE
877eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * @see #ACTION_RESUME
878eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * @see #ACTION_STOP
879aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see #ACTION_START_SESSION
880aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see #ACTION_GET_SESSION_STATUS
881aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see #ACTION_END_SESSION
882c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     */
883eff7719415542ba819054863b0995f07742a7a8aJeff Brown    public static final String EXTRA_SESSION_ID =
884eff7719415542ba819054863b0995f07742a7a8aJeff Brown            "android.media.intent.extra.SESSION_ID";
885c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown
886c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown    /**
887aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * Bundle extra: Media session status.
888aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <p>
889aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * Returned as a result from media session actions such as {@link #ACTION_START_SESSION},
890aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * {@link #ACTION_PAUSE}, and {@link #ACTION_GET_SESSION_STATUS}
891aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * to describe the status of the specified media session.
892aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p><p>
893aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * Included in broadcast intents sent to
894aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * {@link #EXTRA_SESSION_STATUS_UPDATE_RECEIVER session status update receivers} to provide
895aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * updated status information.
896aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p><p>
897aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * The value is a {@link android.os.Bundle} of data that can be converted into
898aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * a {@link MediaSessionStatus} object using
899aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * {@link MediaSessionStatus#fromBundle MediaSessionStatus.fromBundle}.
900aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p>
901aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     *
902aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see #ACTION_PLAY
903aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see #ACTION_SEEK
904aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see #ACTION_GET_STATUS
905aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see #ACTION_PAUSE
906aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see #ACTION_RESUME
907aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see #ACTION_STOP
908aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see #ACTION_START_SESSION
909aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see #ACTION_GET_SESSION_STATUS
910aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see #ACTION_END_SESSION
911aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     */
912aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown    public static final String EXTRA_SESSION_STATUS =
913aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown            "android.media.intent.extra.SESSION_STATUS";
914aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown
915aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown    /**
916aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * Bundle extra: Media item status update receiver.
917aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <p>
918aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * Used with {@link #ACTION_START_SESSION} to specify a {@link PendingIntent} for a
919aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * broadcast receiver that will receive status updates about the media session.
920aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p><p>
921aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * Whenever the status of the media session changes, the media route provider will
922aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * send a broadcast to the pending intent with extras that identify the session
923aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * id and its updated status.
924aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p><p>
925aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * The value is a {@link PendingIntent}.
926aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </p>
927aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     *
928aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <h3>Broadcast extras</h3>
929aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <ul>
930aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of
931aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * the session.
932aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * <li>{@link #EXTRA_SESSION_STATUS} <em>(required)</em>: Specifies the status of the
933aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * session as a bundle that can be decoded into a {@link MediaSessionStatus} object.
934aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * </ul>
935aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     *
936aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     * @see #ACTION_START_SESSION
937aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown     */
938aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown    public static final String EXTRA_SESSION_STATUS_UPDATE_RECEIVER =
939aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown            "android.media.intent.extra.SESSION_STATUS_UPDATE_RECEIVER";
940aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown
941aaa9719b402f15df68f9536b813e06dcd9a5d73aJeff Brown    /**
942de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * Bundle extra: Media item id.
943c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * <p>
9443e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * An opaque unique identifier returned as a result from {@link #ACTION_PLAY} or
9453e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * {@link #ACTION_ENQUEUE} that represents the media item that was created by the
9463e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * playback request.
947de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * </p><p>
948de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * Used with various actions to specify the id of the media item to be controlled.
949de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * </p><p>
950de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * Included in broadcast intents sent to
951de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * {@link #EXTRA_ITEM_STATUS_UPDATE_RECEIVER status update receivers} to identify
952de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * the item in question.
953de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * </p><p>
954de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * The value is a unique string value generated by the media route provider
955de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * to represent one particular media item.
956c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * </p>
957c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     *
958de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * @see #ACTION_PLAY
9593e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * @see #ACTION_ENQUEUE
960de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * @see #ACTION_SEEK
961de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * @see #ACTION_GET_STATUS
962c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     */
963de3d4d3c033fc939af83775a443b295a4034444cJeff Brown    public static final String EXTRA_ITEM_ID =
964de3d4d3c033fc939af83775a443b295a4034444cJeff Brown            "android.media.intent.extra.ITEM_ID";
965c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown
966c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown    /**
967de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * Bundle extra: Media item status.
968c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * <p>
969de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * Returned as a result from media item actions such as {@link #ACTION_PLAY},
9703e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * {@link #ACTION_ENQUEUE}, {@link #ACTION_SEEK}, and {@link #ACTION_GET_STATUS}
971eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * to describe the status of the specified media item.
972de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * </p><p>
973de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * Included in broadcast intents sent to
9743e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * {@link #EXTRA_ITEM_STATUS_UPDATE_RECEIVER item status update receivers} to provide
975de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * updated status information.
976de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * </p><p>
977de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * The value is a {@link android.os.Bundle} of data that can be converted into
978de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * a {@link MediaItemStatus} object using
979de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * {@link MediaItemStatus#fromBundle MediaItemStatus.fromBundle}.
980c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * </p>
981c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     *
982de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * @see #ACTION_PLAY
9833e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * @see #ACTION_ENQUEUE
984de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * @see #ACTION_SEEK
985de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * @see #ACTION_GET_STATUS
986c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     */
987de3d4d3c033fc939af83775a443b295a4034444cJeff Brown    public static final String EXTRA_ITEM_STATUS =
988de3d4d3c033fc939af83775a443b295a4034444cJeff Brown            "android.media.intent.extra.ITEM_STATUS";
989c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown
990c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown    /**
991ba811896e3057cb48ad0f017efe1bf0c262430ecJeff Brown     * Long extra: Media item content position.
992c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * <p>
9933e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * Used with {@link #ACTION_PLAY} or {@link #ACTION_ENQUEUE} to specify the
9943e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * starting playback position.
995129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </p><p>
996129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * Used with {@link #ACTION_SEEK} to set a new playback position.
997129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </p><p>
998ba811896e3057cb48ad0f017efe1bf0c262430ecJeff Brown     * The value is a long integer number of milliseconds from the beginning of the content.
999129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * <p>
1000129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     *
1001129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * @see #ACTION_PLAY
10023e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * @see #ACTION_ENQUEUE
1003129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * @see #ACTION_SEEK
1004129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     */
10053d4c9459ed77f732dd3ba602713af6ebf9280c8cJeff Brown    public static final String EXTRA_ITEM_CONTENT_POSITION =
100643f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown            "android.media.intent.extra.ITEM_POSITION";
1007129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown
1008129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown    /**
100943f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * Bundle extra: Media item metadata.
1010129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * <p>
10113e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * Used with {@link #ACTION_PLAY} or {@link #ACTION_ENQUEUE} to specify metadata
10123e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * associated with the content of a media item.
1013129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </p><p>
1014de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * The value is a {@link android.os.Bundle} of metadata key-value pairs as defined
101543f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * in {@link MediaItemMetadata}.
1016c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * </p>
1017c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     *
1018c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * @see #ACTION_PLAY
10193e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * @see #ACTION_ENQUEUE
1020c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     */
102143f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown    public static final String EXTRA_ITEM_METADATA =
102243f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown            "android.media.intent.extra.ITEM_METADATA";
1023c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown
1024c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown    /**
1025fb75232cb13b19004ec1189888b46767db20daf4Jeff Brown     * Bundle extra: HTTP request headers.
1026c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * <p>
10273e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * Used with {@link #ACTION_PLAY} or {@link #ACTION_ENQUEUE} to specify HTTP request
10283e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * headers to be included when fetching to the content indicated by the media
10293e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * item's data Uri.
1030129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </p><p>
1031de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * This extra may be used to provide authentication tokens and other
1032de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * parameters to the server separately from the media item's data Uri.
1033129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown     * </p><p>
1034de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * The value is a {@link android.os.Bundle} of string based key-value pairs
1035fb75232cb13b19004ec1189888b46767db20daf4Jeff Brown     * that describe the HTTP request headers.
1036c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * </p>
1037c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     *
1038c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     * @see #ACTION_PLAY
10393e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * @see #ACTION_ENQUEUE
1040c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown     */
1041de3d4d3c033fc939af83775a443b295a4034444cJeff Brown    public static final String EXTRA_ITEM_HTTP_HEADERS =
1042de3d4d3c033fc939af83775a443b295a4034444cJeff Brown            "android.media.intent.extra.HTTP_HEADERS";
1043129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown
1044129abf73ce9be1bc172b945263c7975ad1a3006fJeff Brown    /**
104543f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * Bundle extra: Media item status update receiver.
104655eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown     * <p>
10473e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * Used with {@link #ACTION_PLAY} or {@link #ACTION_ENQUEUE} to specify
10483e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * a {@link PendingIntent} for a
1049de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * broadcast receiver that will receive status updates about a particular
1050de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * media item.
105155eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown     * </p><p>
105243f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * Whenever the status of the media item changes, the media route provider will
10533e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * send a broadcast to the pending intent with extras that identify the session
1054de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * to which the item belongs, the item itself and the item's updated status.
1055de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * </p><p>
1056de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * The same pending intent and broadcast receiver may be shared by any number of
1057eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * media items since the broadcast intent includes the media session id
1058eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * and media item id.
105955eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown     * </p><p>
106055eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown     * The value is a {@link PendingIntent}.
106155eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown     * </p>
106255eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown     *
106343f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * <h3>Broadcast extras</h3>
106443f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * <ul>
1065eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_SESSION_ID} <em>(required)</em>: Specifies the session id of
1066eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * the session to which the item in question belongs.
1067eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_ITEM_ID} <em>(required)</em>: Specifies the media item id of the
1068de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * media item in question.
1069eff7719415542ba819054863b0995f07742a7a8aJeff Brown     * <li>{@link #EXTRA_ITEM_STATUS} <em>(required)</em>: Specifies the status of the
1070de3d4d3c033fc939af83775a443b295a4034444cJeff Brown     * item as a bundle that can be decoded into a {@link MediaItemStatus} object.
107143f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     * </ul>
107243f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown     *
107355eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown     * @see #ACTION_PLAY
10743e472786d3d51c19db5661732ecc13ae3b907db2Jeff Brown     * @see #ACTION_ENQUEUE
107555eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown     */
107643f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown    public static final String EXTRA_ITEM_STATUS_UPDATE_RECEIVER =
107743f79f79a5117550a7dfedf9c65124afd163ea43Jeff Brown            "android.media.intent.extra.ITEM_STATUS_UPDATE_RECEIVER";
107855eb54486dde6c1eb7857bdfff29f420fb2ecdfbJeff Brown
1079c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown    private MediaControlIntent() {
1080c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown    }
1081c21f57ed68b81a77167f1df000b0e272e1598bc0Jeff Brown}
1082