# TvRecordingClient.RecordingCallback

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# RecordingCallback

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/media/tv/TvRecordingClient.RecordingCallback "View this page in Java")  

```
abstract class RecordingCallback
```

|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                               ||
| ↳ | [android.media.tv.TvRecordingClient.RecordingCallback](https://developer.android.com/reference/kotlin/android/media/tv/TvRecordingClient.RecordingCallback#) |

Callback used to receive various status updates on the[android.media.tv.TvInputService.RecordingSession](https://developer.android.com/reference/kotlin/android/media/tv/TvInputService.RecordingSession)

## Summary

|                                                                    Public constructors                                                                     ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [RecordingCallback](https://developer.android.com/reference/kotlin/android/media/tv/TvRecordingClient.RecordingCallback#RecordingCallback())`()` <br /> |

|                                                                                                                                                                                                                                                                                                                Public methods                                                                                                                                                                                                                                                                                                                 ||
|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onConnectionFailed](https://developer.android.com/reference/kotlin/android/media/tv/TvRecordingClient.RecordingCallback#onConnectionFailed(kotlin.String))`(`inputId:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` This is called when an error occurred while establishing a connection to the recording session for the corresponding TV input.                                                                                                                                                                |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onDisconnected](https://developer.android.com/reference/kotlin/android/media/tv/TvRecordingClient.RecordingCallback#onDisconnected(kotlin.String))`(`inputId:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` This is called when the connection to the current recording session is lost.                                                                                                                                                                                                                          |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onError](https://developer.android.com/reference/kotlin/android/media/tv/TvRecordingClient.RecordingCallback#onError(kotlin.Int))`(`error:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` This is called when an issue has occurred.                                                                                                                                                                                                                                                                                      |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onRecordingStopped](https://developer.android.com/reference/kotlin/android/media/tv/TvRecordingClient.RecordingCallback#onRecordingStopped(android.net.Uri))`(`recordedProgramUri:` `[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)!`)` This is called when the current recording session has stopped recording and created a new data entry in the[TvContract.RecordedPrograms](https://developer.android.com/reference/kotlin/android/media/tv/TvContract.RecordedPrograms)table that describes the newly recorded program. |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onTuned](https://developer.android.com/reference/kotlin/android/media/tv/TvRecordingClient.RecordingCallback#onTuned(android.net.Uri))`(`channelUri:` `[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)!`)` This is called when the recording session has been tuned to the given channel and is ready to start recording.                                                                                                                                                                                                      |

## Public constructors

### RecordingCallback

```
RecordingCallback()
```

## Public methods

### onConnectionFailed

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onConnectionFailed(inputId: String!): Unit
```

This is called when an error occurred while establishing a connection to the recording session for the corresponding TV input.

|                                                                         Parameters                                                                          ||
|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| `inputId` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:The ID of the TV input bound to the current TvRecordingClient. |

### onDisconnected

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onDisconnected(inputId: String!): Unit
```

This is called when the connection to the current recording session is lost.

|                                                                         Parameters                                                                          ||
|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| `inputId` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:The ID of the TV input bound to the current TvRecordingClient. |

### onError

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onError(error: Int): Unit
```

This is called when an issue has occurred. It may be called at any time after the current recording session is created until it is released.

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `error` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The error code. Should be one of the followings. - [TvInputManager.RECORDING_ERROR_UNKNOWN](https://developer.android.com/reference/kotlin/android/media/tv/TvInputManager#RECORDING_ERROR_UNKNOWN:kotlin.Int) - [TvInputManager.RECORDING_ERROR_INSUFFICIENT_SPACE](https://developer.android.com/reference/kotlin/android/media/tv/TvInputManager#RECORDING_ERROR_INSUFFICIENT_SPACE:kotlin.Int) - [TvInputManager.RECORDING_ERROR_RESOURCE_BUSY](https://developer.android.com/reference/kotlin/android/media/tv/TvInputManager#RECORDING_ERROR_RESOURCE_BUSY:kotlin.Int) Value is[android.media.tv.TvInputManager#RECORDING_ERROR_UNKNOWN](https://developer.android.com/reference/kotlin/android/media/tv/TvInputManager#RECORDING_ERROR_UNKNOWN:kotlin.Int),[android.media.tv.TvInputManager#RECORDING_ERROR_INSUFFICIENT_SPACE](https://developer.android.com/reference/kotlin/android/media/tv/TvInputManager#RECORDING_ERROR_INSUFFICIENT_SPACE:kotlin.Int), or[android.media.tv.TvInputManager#RECORDING_ERROR_RESOURCE_BUSY](https://developer.android.com/reference/kotlin/android/media/tv/TvInputManager#RECORDING_ERROR_RESOURCE_BUSY:kotlin.Int) |

### onRecordingStopped

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onRecordingStopped(recordedProgramUri: Uri!): Unit
```

This is called when the current recording session has stopped recording and created a new data entry in the[TvContract.RecordedPrograms](https://developer.android.com/reference/kotlin/android/media/tv/TvContract.RecordedPrograms)table that describes the newly recorded program.

|                                                                 Parameters                                                                 ||
|----------------------|----------------------------------------------------------------------------------------------------------------------|
| `recordedProgramUri` | [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)!:The URI for the newly recorded program. |

### onTuned

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onTuned(channelUri: Uri!): Unit
```

This is called when the recording session has been tuned to the given channel and is ready to start recording.

|                                                    Parameters                                                    ||
|--------------|----------------------------------------------------------------------------------------------------|
| `channelUri` | [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)!:The URI of a channel. |