Skip to content

Most visited

Recently visited

navigation

TvInputService

public abstract class TvInputService
extends Service

java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.app.Service
         ↳ android.media.tv.TvInputService


The TvInputService class represents a TV input or source such as HDMI or built-in tuner which provides pass-through video or broadcast TV programs.

Applications will not normally use this service themselves, instead relying on the standard interaction provided by TvView. Those implementing TV input services should normally do so by deriving from this class and providing their own session implementation based on TvInputService.Session. All TV input services must require that clients hold the BIND_TV_INPUT in order to interact with the service; if this permission is not specified in the manifest, the system will refuse to bind to that TV input service.

Summary

Nested classes

class TvInputService.HardwareSession

Base class for a TV input session which represents an external device connected to a hardware TV input. 

class TvInputService.RecordingSession

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

class TvInputService.Session

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

Constants

String SERVICE_INTERFACE

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

String SERVICE_META_DATA

Name under which a TvInputService component publishes information about itself.

Inherited constants

From class android.app.Service
From class android.content.Context
From interface android.content.ComponentCallbacks2

Public constructors

TvInputService()

Public methods

final IBinder onBind(Intent intent)

Return the communication channel to the service.

TvInputService.RecordingSession onCreateRecordingSession(String inputId)

Returns a concrete implementation of TvInputService.RecordingSession.

abstract TvInputService.Session onCreateSession(String inputId)

Returns a concrete implementation of TvInputService.Session.

Inherited methods

From class android.app.Service
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks2
From interface android.content.ComponentCallbacks

Constants

SERVICE_INTERFACE

added in API level 21
String SERVICE_INTERFACE

This is the interface name that a service implementing a TV input should say that it support -- that is, this is the action it uses for its intent filter. To be supported, the service must also require the BIND_TV_INPUT permission so that other applications cannot abuse it.

Constant Value: "android.media.tv.TvInputService"

SERVICE_META_DATA

added in API level 21
String SERVICE_META_DATA

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

Constant Value: "android.media.tv.input"

Public constructors

TvInputService

added in API level 21
TvInputService ()

Public methods

onBind

added in API level 21
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: The Intent that was used to bind to this service, as given to Context.bindService. Note that any extras that were included with the Intent at that point will not be seen here.
Returns
IBinder Return an IBinder through which clients can call on to the service.

onCreateRecordingSession

added in API level 24
TvInputService.RecordingSession onCreateRecordingSession (String inputId)

Returns a concrete implementation of TvInputService.RecordingSession.

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

Parameters
inputId String: The ID of the TV input associated with the recording session.
Returns
TvInputService.RecordingSession

onCreateSession

added in API level 21
TvInputService.Session onCreateSession (String inputId)

Returns a concrete implementation of TvInputService.Session.

May return null if this TV input service fails to create a session for some reason. If TV input represents an external device connected to a hardware TV input, TvInputService.HardwareSession should be returned.

Parameters
inputId String: The ID of the TV input associated with the session.
Returns
TvInputService.Session
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.