TvAdService


public abstract class TvAdService
extends Service

java.lang.Object
   ↳ 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

class TvAdService.Session

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

Constants

String SERVICE_INTERFACE

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.

String SERVICE_META_DATA

Name under which a TvAdService component publishes information about itself.

Inherited constants

Public constructors

TvAdService()

Public methods

void onAppLinkCommand(Bundle command)

Called when app link command is received.

final IBinder onBind(Intent intent)

Return the communication channel to the service.

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

Returns a concrete implementation of Session.

Inherited methods

Constants

SERVICE_INTERFACE

public static final String SERVICE_INTERFACE

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.

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

SERVICE_META_DATA

public static final String SERVICE_META_DATA

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

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

Public constructors

TvAdService

public TvAdService ()

Public methods

onAppLinkCommand

public void onAppLinkCommand (Bundle command)

Called when app link command is received.

Parameters
command Bundle: This value cannot be null.

onBind

public final IBinder onBind (Intent intent)

Return the communication channel to the service. May return null if clients can not bind to the service. The returned 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.

Returns
IBinder This value may be null.

onCreateSession

public abstract TvAdService.Session onCreateSession (String serviceId, 
                String type)

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.

Returns
TvAdService.Session