Skip to content

Commit fb1f5bd

Browse files
author
Ricardo Cervera
committed
docs: Removing radio from music intents
Change-Id: Iaf645d692b247994dd8c12835c387ff296b26019
1 parent d084238 commit fb1f5bd

1 file changed

Lines changed: 5 additions & 28 deletions

File tree

docs/html/guide/components/intents-common.jd

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,7 @@ the search is for an artist name or song name.</p>
13161316
<dt>{@link android.provider.MediaStore#EXTRA_MEDIA_FOCUS MediaStore.EXTRA_MEDIA_FOCUS} (required)</dt>
13171317
<dd>
13181318
<p>Indicates the search mode (whether the user is looking for a particular artist, album, song,
1319-
playlist, or radio channel). Most search modes take additional extras. For example, if the user
1319+
or playlist). Most search modes take additional extras. For example, if the user
13201320
is interested in listening to a particular song, the intent might have three additional extras:
13211321
the song title, the artist, and the album. This intent supports the following search modes for
13221322
each value of {@link android.provider.MediaStore#EXTRA_MEDIA_FOCUS}:</p>
@@ -1399,24 +1399,6 @@ listen to. Apps should use more specific search modes when possible.</p>
13991399
intent as an unstructured search.</li>
14001400
</ul>
14011401
</dd>
1402-
<dt><p><em>Radio channel</em> - <code>"vnd.android.cursor.item/radio"</code></p></dt>
1403-
<dd>
1404-
<p>Play a particular radio channel or a radio channel that matches some criteria specified
1405-
by additional extras.</p>
1406-
<p>Additional extras:</p>
1407-
<ul>
1408-
<li>{@link android.provider.MediaStore#EXTRA_MEDIA_ALBUM} - The album.</li>
1409-
<li>{@link android.provider.MediaStore#EXTRA_MEDIA_ARTIST} - The artist.</li>
1410-
<li><code>"android.intent.extra.genre"</code> - The genre.</li>
1411-
<li><code>"android.intent.extra.radio_channel"</code> - The radio channel.</li>
1412-
<li>{@link android.provider.MediaStore#EXTRA_MEDIA_TITLE} - The song name that the radio
1413-
channel is based on.</li>
1414-
<li>{@link android.app.SearchManager#QUERY} (required) - A string that contains any combination
1415-
of: the album, the artist, the genre, the radio channel, or the title. This extra is
1416-
always provided for backward compatibility: existing apps that do not know about search
1417-
modes can process this intent as an unstructured search.</li>
1418-
</ul>
1419-
</dd>
14201402
<dt><p><em>Playlist</em> - {@link android.provider.MediaStore.Audio.Playlists#ENTRY_CONTENT_TYPE Audio.Playlists.ENTRY_CONTENT_TYPE}</p></dt>
14211403
<dd>
14221404
<p>Play a particular playlist or a playlist that matches some criteria specified
@@ -1444,13 +1426,13 @@ by additional extras.</p>
14441426

14451427

14461428
<p><b>Example intent:</b></p>
1447-
<p>If the user wants to listen to a radio station that plays songs from a particular artist,
1448-
a search app may generate the following intent:</p>
1429+
<p>If the user wants to listen to music from a particular artist, a search app may generate the
1430+
following intent:</p>
14491431
<pre>
1450-
public void playSearchRadioByArtist(String artist) {
1432+
public void playSearchArtist(String artist) {
14511433
Intent intent = new Intent(MediaStore.INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH);
14521434
intent.putExtra(MediaStore.EXTRA_MEDIA_FOCUS,
1453-
"vnd.android.cursor.item/radio");
1435+
MediaStore.Audio.Artists.ENTRY_CONTENT_TYPE);
14541436
intent.putExtra(MediaStore.EXTRA_MEDIA_ARTIST, artist);
14551437
intent.putExtra(SearchManager.QUERY, artist);
14561438
if (intent.resolveActivity(getPackageManager()) != null) {
@@ -1488,7 +1470,6 @@ protected void onCreate(Bundle savedInstanceState) {
14881470
String artist = intent.getStringExtra(MediaStore.EXTRA_MEDIA_ARTIST);
14891471
String genre = intent.getStringExtra("android.intent.extra.genre");
14901472
String playlist = intent.getStringExtra("android.intent.extra.playlist");
1491-
String rchannel = intent.getStringExtra("android.intent.extra.radio_channel");
14921473
String title = intent.getStringExtra(MediaStore.EXTRA_MEDIA_TITLE);
14931474

14941475
// Determine the search mode and use the corresponding extras
@@ -1521,10 +1502,6 @@ protected void onCreate(Bundle savedInstanceState) {
15211502
// 'Song' search mode
15221503
playSong(album, artist, genre, title);
15231504

1524-
} else if (mediaFocus.compareTo("vnd.android.cursor.item/radio") == 0) {
1525-
// 'Radio channel' search mode
1526-
playRadioChannel(album, artist, genre, rchannel, title);
1527-
15281505
} else if (mediaFocus.compareTo(MediaStore.Audio.Playlists.ENTRY_CONTENT_TYPE) == 0) {
15291506
// 'Playlist' search mode
15301507
playPlaylist(album, artist, genre, playlist, title);

0 commit comments

Comments
 (0)