# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Nested Classes | Ctors | Methods | Inherited Methods

# TvRecordingClient

`public class TvRecordingClient`
`extends Object` ``

java.lang.Object
↳ | android.media.tv.TvRecordingClient

The public interface object used to interact with a specific TV input service for TV program recording.

## Summary

### Nested classes
`class` | `TvRecordingClient.RecordingCallback` Callback used to receive various status updates on the `TvInputService.RecordingSession`

### Public constructors
`TvRecordingClient(Context context, String tag, TvRecordingClient.RecordingCallback callback, Handler handler)` Creates a new TvRecordingClient object.

### Public methods
`void` | `pauseRecording()` Pause TV program recording in the current recording session.
`void` | `pauseRecording(Bundle params)` Pause TV program recording in the current recording session.
`void` | `release()` Releases the resources in the current recording session immediately.
`void` | `resumeRecording()` Resume TV program recording only in recording pause status in the current recording session.
`void` | `resumeRecording(Bundle params)` Resume TV program recording only in recording pause status in the current recording session.
`void` | `sendAppPrivateCommand(String action, Bundle data)` Sends a private command to the underlying TV input.
`void` | `startRecording(Uri programUri, Bundle params)` Starts TV program recording in the current recording session.
`void` | `startRecording(Uri programUri)` Starts TV program recording in the current recording session.
`void` | `stopRecording()` Stops TV program recording in the current recording session.
`void` | `tune(String inputId, Uri channelUri, Bundle params)` Tunes to a given channel for TV program recording.
`void` | `tune(String inputId, Uri channelUri)` Tunes to a given channel for TV program recording.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public constructors

### TvRecordingClient

    public TvRecordingClient (Context context,
                    String tag,
                    TvRecordingClient.RecordingCallback callback,
                    Handler handler)

Creates a new TvRecordingClient object.

Parameters
`context` | `Context`: The application context to create a TvRecordingClient with.
`tag` | `String`: A short name for debugging purposes.
`callback` | `TvRecordingClient.RecordingCallback`: The callback to receive recording status changes. This value cannot be `null`.
`handler` | `Handler`: The handler to invoke the callback on.

## Public methods

### pauseRecording

    public void pauseRecording ()

Pause TV program recording in the current recording session. Recording is expected to pause immediately when this method is called. If recording has not yet started in the current recording session, this method does nothing.

In pause status, the application can tune during recording. To continue recording, please call `TvRecordingClient#resumeRecording()` to resume instead of `TvRecordingClient#startRecording(Uri)`. Application can stop the recording with `TvRecordingClient#stopRecording()` in recording pause status.

If the pause request cannot be fulfilled, the recording session will respond by calling `RecordingCallback#onError(int)`.

### pauseRecording

    public void pauseRecording (Bundle params)

Pause TV program recording in the current recording session. Recording is expected to pause immediately when this method is called. If recording has not yet started in the current recording session, this method does nothing.

In pause status, the application can tune during recording. To continue recording, please call `TvRecordingClient#resumeRecording()` to resume instead of `TvRecordingClient#startRecording(Uri)`. Application can stop the recording with `TvRecordingClient#stopRecording()` in recording pause status.

If the pause request cannot be fulfilled, the recording session will respond by calling `RecordingCallback#onError(int)`.

Parameters
`params` | `Bundle`: Domain-specific data for this request. This value cannot be `null`.

### release

    public void release ()

Releases the resources in the current recording session immediately. This may be called at any time, however if the session is already released, it does nothing.

### resumeRecording

    public void resumeRecording ()

Resume TV program recording only in recording pause status in the current recording session. Recording is expected to resume immediately when this method is called. If recording has not yet paused in the current recording session, this method does nothing.

When record is resumed, the recording is continue and can not re-tune. Application can stop the recording with `TvRecordingClient#stopRecording()` after record resumed.

If the pause request cannot be fulfilled, the recording session will respond by calling `RecordingCallback#onError(int)`.

### resumeRecording

    public void resumeRecording (Bundle params)

Resume TV program recording only in recording pause status in the current recording session. Recording is expected to resume immediately when this method is called. If recording has not yet paused in the current recording session, this method does nothing.

When record is resumed, the recording is continues and can not re-tune. Application can stop the recording with `TvRecordingClient#stopRecording()` after record resumed.

If the resume request cannot be fulfilled, the recording session will respond by calling `RecordingCallback#onError(int)`.

Parameters
`params` | `Bundle`: Domain-specific data for this request. This value cannot be `null`.

### sendAppPrivateCommand

    public void sendAppPrivateCommand (String action,
                    Bundle data)

Sends a private command to the underlying TV input. This can be used to provide domain-specific features that are only known between certain clients and their TV inputs.

Parameters
`action` | `String`: The name of the private command to send. This must be a scoped name, i.e. prefixed with a package name you own, so that different developers will not create conflicting commands. This value cannot be `null`.
`data` | `Bundle`: An optional bundle to send with the command.

### startRecording

    public void startRecording (Uri programUri,
                    Bundle params)

Starts TV program recording in the current recording session. Recording is expected to start immediately when this method is called. If the current recording session has not yet tuned to any channel, this method throws an exception.

The application may supply the URI for a TV program for filling in program specific data fields in the `TvContract.RecordedPrograms` table. A non-null `programUri` implies the started recording should be of that specific program, whereas null `programUri` does not impose such a requirement and the recording can span across multiple TV programs. In either case, the application must call `TvRecordingClient#stopRecording()` to stop the recording.

The recording session will respond by calling `RecordingCallback#onError(int)` if the start request cannot be fulfilled.

Parameters
`programUri` | `Uri`: The URI for the TV program to record, built by `TvContract#buildProgramUri(long)`. Can be `null`. This value may be `null`.
`params` | `Bundle`: Domain-specific data for this 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. This value cannot be `null`.

Throws
`IllegalStateException` | If `tune(String, Uri)` request hasn't been handled yet or during pause.

### startRecording

    public void startRecording (Uri programUri)

Starts TV program recording in the current recording session. Recording is expected to start immediately when this method is called. If the current recording session has not yet tuned to any channel, this method throws an exception.

The application may supply the URI for a TV program for filling in program specific data fields in the `TvContract.RecordedPrograms` table. A non-null `programUri` implies the started recording should be of that specific program, whereas null `programUri` does not impose such a requirement and the recording can span across multiple TV programs. In either case, the application must call `TvRecordingClient#stopRecording()` to stop the recording.

The recording session will respond by calling `RecordingCallback#onError(int)` if the start request cannot be fulfilled.

Parameters
`programUri` | `Uri`: The URI for the TV program to record, built by `TvContract#buildProgramUri(long)`. Can be `null`. This value may be `null`.

Throws
`IllegalStateException` | If `tune(String, Uri)` request hasn't been handled yet or during pause.

### stopRecording

    public void stopRecording ()

Stops TV program recording in the current recording session. Recording is expected to stop immediately when this method is called. If recording has not yet started in the current recording session, this method does nothing.

The recording session is expected to create a new data entry in the `TvContract.RecordedPrograms` table that describes the newly recorded program and pass the URI to that entry through to `RecordingCallback#onRecordingStopped(Uri)`. If the stop request cannot be fulfilled, the recording session will respond by calling `RecordingCallback#onError(int)`.

### tune

    public void tune (String inputId,
                    Uri channelUri,
                    Bundle params)

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. 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 `RecordingCallback#onTuned(Uri)` if the tune request was fulfilled, or `RecordingCallback#onError(int)` otherwise.

Parameters
`inputId` | `String`: The ID of the TV input for the given channel.
`channelUri` | `Uri`: The URI of a channel.
`params` | `Bundle`: 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.

### tune

    public void tune (String inputId,
                    Uri channelUri)

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.

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

The recording session will respond by calling `RecordingCallback#onTuned(Uri)` if the tune request was fulfilled, or `RecordingCallback#onError(int)` otherwise.

Parameters
`inputId` | `String`: The ID of the TV input for the given channel.
`channelUri` | `Uri`: The URI of a channel.

Throws
`IllegalStateException` | If recording is already started.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*