diff --git a/api/current.txt b/api/current.txt index 71179fe1f2d25..6a514a47b2217 100644 --- a/api/current.txt +++ b/api/current.txt @@ -23053,6 +23053,7 @@ package android.media.tv { method public abstract void onStartRecording(android.net.Uri); method public abstract void onStopRecording(); method public abstract void onTune(android.net.Uri); + method public void onTune(android.net.Uri, android.os.Bundle); } public static abstract class TvInputService.Session implements android.view.KeyEvent.Callback { @@ -23102,6 +23103,7 @@ package android.media.tv { method public void startRecording(android.net.Uri); method public void stopRecording(); method public void tune(java.lang.String, android.net.Uri); + method public void tune(java.lang.String, android.net.Uri, android.os.Bundle); } public static abstract class TvRecordingClient.RecordingCallback { diff --git a/api/test-current.txt b/api/test-current.txt index 108fee710ae89..1303212e2fe32 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -23118,6 +23118,7 @@ package android.media.tv { method public abstract void onStartRecording(android.net.Uri); method public abstract void onStopRecording(); method public abstract void onTune(android.net.Uri); + method public void onTune(android.net.Uri, android.os.Bundle); } public static abstract class TvInputService.Session implements android.view.KeyEvent.Callback { @@ -23167,6 +23168,7 @@ package android.media.tv { method public void startRecording(android.net.Uri); method public void stopRecording(); method public void tune(java.lang.String, android.net.Uri); + method public void tune(java.lang.String, android.net.Uri, android.os.Bundle); } public static abstract class TvRecordingClient.RecordingCallback { diff --git a/media/java/android/media/tv/TvInputService.java b/media/java/android/media/tv/TvInputService.java index 612a147456980..97ef6d83607d4 100644 --- a/media/java/android/media/tv/TvInputService.java +++ b/media/java/android/media/tv/TvInputService.java @@ -1689,19 +1689,20 @@ public abstract class TvInputService extends Service { public abstract void onTune(Uri channelUri); /** - * Called when the application requests to tune to a given channel for TV program recording. + * Calls {@link #onTune(Uri)}. Override this method in order to handle domain-specific + * features that are only known between certain TV inputs and their clients. * *

The application may call this method before starting or after stopping recording, but * not during recording. * - *

The session must call {@link #notifyTuned()} if the tune request was fulfilled, or + *

The session must call {@link #notifyTuned(Uri)} if the tune request was fulfilled, or * {@link #notifyError(int)} otherwise. * * @param channelUri The URI of a channel. - * @param params Extra parameters. - * @hide + * @param params Domain-specific data for this tune request. Keys must be a scoped + * name, i.e. prefixed with a package name you own, so that different developers + * will not create conflicting keys. */ - @SystemApi public void onTune(Uri channelUri, Bundle params) { onTune(channelUri); } diff --git a/media/java/android/media/tv/TvRecordingClient.java b/media/java/android/media/tv/TvRecordingClient.java index da1002d650e78..a5ff29f3a651a 100644 --- a/media/java/android/media/tv/TvRecordingClient.java +++ b/media/java/android/media/tv/TvRecordingClient.java @@ -91,22 +91,23 @@ public class TvRecordingClient { * Tunes to a given channel for TV program recording. The first tune request will create a new * recording session for the corresponding TV input and establish a connection between the * application and the session. If recording has already started in the current recording - * session, this method throws an exception. + * session, this method throws an exception. This can be used to provide domain-specific + * features that are only known between certain client and their TV inputs. * *

The application may call this method before starting or after stopping recording, but not * during recording. * *

The recording session will respond by calling - * {@link RecordingCallback#onTuned()} if the tune request was fulfilled, or + * {@link RecordingCallback#onTuned(Uri)} if the tune request was fulfilled, or * {@link RecordingCallback#onError(int)} otherwise. * * @param inputId The ID of the TV input for the given channel. * @param channelUri The URI of a channel. - * @param params Extra parameters. + * @param params Domain-specific data for this tune request. Keys must be a scoped + * name, i.e. prefixed with a package name you own, so that different developers will + * not create conflicting keys. * @throws IllegalStateException If recording is already started. - * @hide */ - @SystemApi public void tune(String inputId, Uri channelUri, Bundle params) { if (DEBUG) Log.d(TAG, "tune(" + channelUri + ")"); if (TextUtils.isEmpty(inputId)) {