# TvAdManager.TvAdServiceCallback

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

# TvAdServiceCallback

*** ** * ** ***

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

```
abstract class TvAdServiceCallback
```

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

Callback used to monitor status of the TV advertisement service.

## Summary

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

|                                                                                                                                                                                                 Public methods                                                                                                                                                                                                  ||
|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onAdServiceAdded](https://developer.android.com/reference/kotlin/android/media/tv/ad/TvAdManager.TvAdServiceCallback#onAdServiceAdded(kotlin.String))`(`serviceId:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` This is called when a TV AD service is added to the system.         |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onAdServiceRemoved](https://developer.android.com/reference/kotlin/android/media/tv/ad/TvAdManager.TvAdServiceCallback#onAdServiceRemoved(kotlin.String))`(`serviceId:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` This is called when a TV AD service is removed from the system. |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onAdServiceUpdated](https://developer.android.com/reference/kotlin/android/media/tv/ad/TvAdManager.TvAdServiceCallback#onAdServiceUpdated(kotlin.String))`(`serviceId:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` This is called when a TV AD service is updated on the system.   |

## Public constructors

### TvAdServiceCallback

```
TvAdServiceCallback()
```

## Public methods

### onAdServiceAdded

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

```
open fun onAdServiceAdded(serviceId: String): Unit
```

This is called when a TV AD service is added to the system.

Normally it happens when the user installs a new TV AD service package that implements[TvAdService](https://developer.android.com/reference/kotlin/android/media/tv/ad/TvAdService)interface.

|                                                                       Parameters                                                                       ||
|-------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| `serviceId` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):The ID of the TV AD service. This value cannot be`null`. |

### onAdServiceRemoved

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

```
open fun onAdServiceRemoved(serviceId: String): Unit
```

This is called when a TV AD service is removed from the system.

Normally it happens when the user uninstalls the previously installed TV AD service package.

|                                                                       Parameters                                                                       ||
|-------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| `serviceId` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):The ID of the TV AD service. This value cannot be`null`. |

### onAdServiceUpdated

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

```
open fun onAdServiceUpdated(serviceId: String): Unit
```

This is called when a TV AD service is updated on the system.

Normally it happens when a previously installed TV AD service package is re-installed or a newer version of the package exists becomes available/unavailable.

|                                                                       Parameters                                                                       ||
|-------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| `serviceId` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):The ID of the TV AD service. This value cannot be`null`. |