TvInputService

abstract class TvInputService : Service
kotlin.Any
   ↳ 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 android.Manifest.permission#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.
Requires API level 21 (Android 5.0, Lollipop)

Summary

Nested classes
abstract

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

abstract

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

abstract

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

Constants
static String

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.

static String

Name under which a TvInputService component publishes information about itself.

Inherited constants
Public constructors

Public methods
open TvInputService.RecordingSession?

Returns a concrete implementation of RecordingSession.

abstract TvInputService.Session?

Returns a concrete implementation of Session.

IBinder?
onBind(intent: Intent!)

Return the communication channel to the service.

Inherited functions

Constants

SERVICE_INTERFACE

added in API level 21
static val SERVICE_INTERFACE: String

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 android.Manifest.permission#BIND_TV_INPUT permission so that other applications cannot abuse it.
Requires API level 21 (Android 5.0, Lollipop)

Value: "android.media.tv.TvInputService"

SERVICE_META_DATA

added in API level 21
static val SERVICE_META_DATA: String

Name under which a TvInputService component publishes information about itself. This meta-data must reference an XML resource containing an <tv-input> tag.
Requires API level 21 (Android 5.0, Lollipop)

Value: "android.media.tv.input"

Public constructors

<init>

TvInputService()

Public methods

onCreateRecordingSession

added in API level 24
open fun onCreateRecordingSession(inputId: String!): TvInputService.RecordingSession?

Returns a concrete implementation of RecordingSession.

May return null if this TV input service fails to create a recording session for some reason.
Requires API level 24 (Android 7.0, Nougat)

Parameters
inputId String!: The ID of the TV input associated with the recording session.

onCreateSession

added in API level 21
abstract fun onCreateSession(inputId: String!): TvInputService.Session?

Returns a concrete implementation of 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, HardwareSession should be returned.
Requires API level 21 (Android 5.0, Lollipop)

Parameters
inputId String!: The ID of the TV input associated with the session.

onBind

added in API level 21
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.

Requires API level 21 (Android 5.0, Lollipop)
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.
Return
IBinder?: Return an IBinder through which clients can call on to the service.