Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/media/tv/ad/TvAdView.TvAdCallback#pubctors) \| [Methods](https://developer.android.com/reference/android/media/tv/ad/TvAdView.TvAdCallback#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/media/tv/ad/TvAdView.TvAdCallback#inhmethods)

# TvAdView.TvAdCallback

*** ** * ** ***


`
public
static

abstract
class
TvAdView.TvAdCallback
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.media.tv.ad.TvAdView.TvAdCallback |

<br />

*** ** * ** ***

Callback used to receive various status updates on the `https://developer.android.com/reference/android/media/tv/ad/TvAdView`.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/media/tv/ad/TvAdView.TvAdCallback#TvAdCallback()() ` |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/media/tv/ad/TvAdView.TvAdCallback#onRequestCurrentChannelUri(java.lang.String)(https://developer.android.com/reference/java/lang/String serviceId) ` This is called when `https://developer.android.com/reference/android/media/tv/ad/TvAdService.Session#requestCurrentChannelUri()` is called. |
| ` void` | ` https://developer.android.com/reference/android/media/tv/ad/TvAdView.TvAdCallback#onRequestCurrentTvInputId(java.lang.String)(https://developer.android.com/reference/java/lang/String serviceId) ` This is called when `https://developer.android.com/reference/android/media/tv/ad/TvAdService.Session#requestCurrentTvInputId()` is called. |
| ` void` | ` https://developer.android.com/reference/android/media/tv/ad/TvAdView.TvAdCallback#onRequestCurrentVideoBounds(java.lang.String)(https://developer.android.com/reference/java/lang/String serviceId) ` This is called when `https://developer.android.com/reference/android/media/tv/ad/TvAdService.Session#requestCurrentVideoBounds()` is called. |
| ` void` | ` https://developer.android.com/reference/android/media/tv/ad/TvAdView.TvAdCallback#onRequestSigning(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20byte[])(https://developer.android.com/reference/java/lang/String serviceId, https://developer.android.com/reference/java/lang/String signingId, https://developer.android.com/reference/java/lang/String algorithm, https://developer.android.com/reference/java/lang/String alias, byte[] data) ` This is called when `https://developer.android.com/reference/android/media/tv/ad/TvAdService.Session#requestSigning(java.lang.String,%20java.lang.String,%20java.lang.String,%20byte[])` is called. |
| ` void` | ` https://developer.android.com/reference/android/media/tv/ad/TvAdView.TvAdCallback#onRequestTrackInfoList(java.lang.String)(https://developer.android.com/reference/java/lang/String serviceId) ` This is called when `https://developer.android.com/reference/android/media/tv/ad/TvAdService.Session#requestTrackInfoList()` is called. |
| ` void` | ` https://developer.android.com/reference/android/media/tv/ad/TvAdView.TvAdCallback#onStateChanged(java.lang.String,%20int,%20int)(https://developer.android.com/reference/java/lang/String serviceId, int state, int err) ` This is called when the state of corresponding AD service is changed. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public constructors

### TvAdCallback

```
public TvAdCallback ()
```

<br />

<br />

## Public methods

### onRequestCurrentChannelUri

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

```
public void onRequestCurrentChannelUri (String serviceId)
```

This is called when `https://developer.android.com/reference/android/media/tv/ad/TvAdService.Session#requestCurrentChannelUri()` is
called.

<br />

| Parameters ||
|---|---|
| `serviceId` | `String`: The ID of the AD service bound to this view. This value cannot be `null`. <br /> |

### onRequestCurrentTvInputId

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

```
public void onRequestCurrentTvInputId (String serviceId)
```

This is called when `https://developer.android.com/reference/android/media/tv/ad/TvAdService.Session#requestCurrentTvInputId()` is called.

<br />

| Parameters ||
|---|---|
| `serviceId` | `String`: The ID of the AD service bound to this view. This value cannot be `null`. <br /> |

### onRequestCurrentVideoBounds

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

```
public void onRequestCurrentVideoBounds (String serviceId)
```

This is called when `https://developer.android.com/reference/android/media/tv/ad/TvAdService.Session#requestCurrentVideoBounds()`
is called.

<br />

| Parameters ||
|---|---|
| `serviceId` | `String`: The ID of the TV AD service bound to this view. This value cannot be `null`. <br /> |

### onRequestSigning

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

```
public void onRequestSigning (String serviceId, 
                String signingId, 
                String algorithm, 
                String alias, 
                byte[] data)
```

This is called when
`https://developer.android.com/reference/android/media/tv/ad/TvAdService.Session#requestSigning(java.lang.String,%20java.lang.String,%20java.lang.String,%20byte[])` is called.

<br />

| Parameters ||
|---|---|
| `serviceId` | `String`: The ID of the AD service bound to this view. This value cannot be `null`. <br /> |
| `signingId` | `String`: the ID to identify the request. This value cannot be `null`. <br /> |
| `algorithm` | `String`: the standard name of the signature algorithm requested, such as MD5withRSA, SHA256withDSA, etc. This value cannot be `null`. <br /> |
| `alias` | `String`: the alias of the corresponding `https://developer.android.com/reference/java/security/KeyStore`. This value cannot be `null`. <br /> |
| `data` | `byte`: the original bytes to be signed. This value cannot be `null`. <br /> |

### onRequestTrackInfoList

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

```
public void onRequestTrackInfoList (String serviceId)
```

This is called when `https://developer.android.com/reference/android/media/tv/ad/TvAdService.Session#requestTrackInfoList()` is called.

<br />

| Parameters ||
|---|---|
| `serviceId` | `String`: The ID of the AD service bound to this view. This value cannot be `null`. <br /> |

### onStateChanged

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

```
public void onStateChanged (String serviceId, 
                int state, 
                int err)
```

This is called when the state of corresponding AD service is changed.

<br />

| Parameters ||
|---|---|
| `serviceId` | `String`: The ID of the AD service bound to this view. This value cannot be `null`. <br /> |
| `state` | `int`: the current state. Value is one of the following: - `https://developer.android.com/reference/android/media/tv/ad/TvAdManager#SESSION_STATE_STOPPED` - `https://developer.android.com/reference/android/media/tv/ad/TvAdManager#SESSION_STATE_RUNNING` - `https://developer.android.com/reference/android/media/tv/ad/TvAdManager#SESSION_STATE_ERROR` |
| `err` | `int`: the error code for error state. `https://developer.android.com/reference/android/media/tv/ad/TvAdManager#ERROR_NONE` is used when the state is not `https://developer.android.com/reference/android/media/tv/ad/TvAdManager#SESSION_STATE_ERROR`. Value is one of the following: - `https://developer.android.com/reference/android/media/tv/ad/TvAdManager#ERROR_NONE` - `https://developer.android.com/reference/android/media/tv/ad/TvAdManager#ERROR_UNKNOWN` - `https://developer.android.com/reference/android/media/tv/ad/TvAdManager#ERROR_NOT_SUPPORTED` - `https://developer.android.com/reference/android/media/tv/ad/TvAdManager#ERROR_WEAK_SIGNAL` - `https://developer.android.com/reference/android/media/tv/ad/TvAdManager#ERROR_RESOURCE_UNAVAILABLE` - `https://developer.android.com/reference/android/media/tv/ad/TvAdManager#ERROR_BLOCKED` - `https://developer.android.com/reference/android/media/tv/ad/TvAdManager#ERROR_ENCRYPTED` - `https://developer.android.com/reference/android/media/tv/ad/TvAdManager#ERROR_UNKNOWN_CHANNEL` |