From d48d029da43babf265fccbf5d84a06b4b275f72c Mon Sep 17 00:00:00 2001 From: Jiabin Date: Wed, 23 Mar 2016 20:34:10 +0900 Subject: [PATCH] TIF: Unhide TvRecordingClient.tune(String, Uri, Bundle) Bug: 27762945 Change-Id: I7f9757f8ca1eb92f892fb2961717125c8b909663 --- api/current.txt | 2 ++ api/test-current.txt | 2 ++ media/java/android/media/tv/TvInputService.java | 11 ++++++----- media/java/android/media/tv/TvRecordingClient.java | 11 ++++++----- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/api/current.txt b/api/current.txt index a5d8a930e40fe..1aafe0cc9be25 100644 --- a/api/current.txt +++ b/api/current.txt @@ -23083,6 +23083,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 { @@ -23132,6 +23133,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 fa2669c26435e..732dc1323b7de 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -23148,6 +23148,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 { @@ -23197,6 +23198,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 88be686095972..b467b25895968 100644 --- a/media/java/android/media/tv/TvInputService.java +++ b/media/java/android/media/tv/TvInputService.java @@ -1688,19 +1688,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)) {