TvAdService


abstract class TvAdService : Service
kotlin.Any
   ↳ android.content.Context
   ↳ android.content.ContextWrapper
   ↳ android.app.Service
   ↳ android.media.tv.ad.TvAdService

The TvAdService class represents a TV client-side advertisement service.

Summary

Nested classes
abstract

Base class for derived classes to implement to provide a TV AD session.

Constants
static String

This is the interface name that a service implementing a TV AD service should say that it supports -- that is, this is the action it uses for its intent filter.

static String

Name under which a TvAdService component publishes information about itself.

Inherited constants
Public constructors

Public methods
open Unit

Called when app link command is received.

IBinder?
onBind(intent: Intent?)

Return the communication channel to the service.

abstract TvAdService.Session?
onCreateSession(serviceId: String, type: String)

Returns a concrete implementation of Session.

Inherited functions

Constants

SERVICE_INTERFACE

static val SERVICE_INTERFACE: String

This is the interface name that a service implementing a TV AD service should say that it supports -- that is, this is the action it uses for its intent filter. To be supported, the service must also require the android.Manifest.permission#BIND_TV_AD_SERVICE permission so that other applications cannot abuse it.

Value: "android.media.tv.ad.TvAdService"

SERVICE_META_DATA

static val SERVICE_META_DATA: String

Name under which a TvAdService component publishes information about itself. This meta-data must reference an XML resource containing an <tv-ad-service> tag.

Value: "android.media.tv.ad.service"

Public constructors

TvAdService

TvAdService()

Public methods

onAppLinkCommand

open fun onAppLinkCommand(command: Bundle): Unit

Called when app link command is received.

Parameters
command Bundle: This value cannot be null.

onBind

fun onBind(intent: Intent?): IBinder?

Return the communication channel to the service. May return null if clients can not bind to the service. The returned android.os.IBinder is usually for a complex interface that has been described using aidl.

Note that unlike other application components, calls on to the IBinder interface returned here may not happen on the main thread of the process. More information about the main thread can be found in Processes and Threads.

Parameters
intent Intent?: This value may be null.
Return
IBinder? This value may be null.

onCreateSession

abstract fun onCreateSession(
    serviceId: String,
    type: String
): TvAdService.Session?

Returns a concrete implementation of Session.

May return null if this TV AD service fails to create a session for some reason.

Parameters
serviceId String: The ID of the TV AD associated with the session. This value cannot be null.
type String: The type of the TV AD associated with the session. This value cannot be null.