Added in API level 33

TvInteractiveAppService


abstract class TvInteractiveAppService : Service
kotlin.Any
   ↳ android.content.Context
   ↳ android.content.ContextWrapper
   ↳ android.app.Service
   ↳ android.media.tv.interactive.TvInteractiveAppService

A TV interactive application service is a service that provides runtime environment and runs TV interactive applications.

Summary

Nested classes
abstract

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

Constants
static String

Command to quiet channel change.

static String

Playback command parameter: channel URI.

static String

Playback command parameter: TV input ID.

static String

Time shift command parameter: playback params.

static String

Time shift command parameter: program URI.

static String

Playback command parameter: stop mode.

static String

Time shift command parameter: time position for time shifting, in milliseconds.

static String

Time shift command parameter: playback params.

static String

Playback command parameter: track ID.

static String

Playback command parameter: track type.

static String

Playback command parameter: stream volume.

static Int

Playback command stop mode: show a blank screen.

static Int

Playback command stop mode: freeze the video.

static String

Playback command type: select the given track.

static String

Playback command type: set the volume.

static String

Playback command type: stop the playback.

static String

Playback command type: tune to the given channel.

static String

Playback command type: tune to the next channel.

static String

Playback command type: tune to the previous channel.

static String

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

static String

Name under which a TvInteractiveAppService component publishes information about itself.

static String

Time shift command type: pause.

static String

Time shift command type: play.

static String

Time shift command type: resume.

static String

Time shift command type: seek to.

static String

Time shift command type: set time shift mode.

static String

Time shift command type: set playback params.

Inherited constants
Public constructors

Public methods
Unit
notifyStateChanged(type: Int, state: Int, error: Int)

Notifies the system when the state of the interactive app RTE has been changed.

open Unit

Called when app link command is received.

IBinder?
onBind(intent: Intent)

Return the communication channel to the service.

abstract TvInteractiveAppService.Session?
onCreateSession(iAppServiceId: String, type: Int)

Returns a concrete implementation of Session.

open Unit

Called when a request to register an Android application link info record is received.

open Unit

Called when a request to unregister an Android application link info record is received.

Inherited functions

Constants

COMMAND_PARAMETER_KEY_CHANGE_CHANNEL_QUIETLY

Added in API level 33
static val COMMAND_PARAMETER_KEY_CHANGE_CHANNEL_QUIETLY: String

Command to quiet channel change. No channel banner or channel info is shown.

Refer to HbbTV Spec 2.0.4 chapter A.2.4.3.

Value: "command_change_channel_quietly"

COMMAND_PARAMETER_KEY_CHANNEL_URI

Added in API level 33
static val COMMAND_PARAMETER_KEY_CHANNEL_URI: String

Playback command parameter: channel URI.

Type: android.net.Uri

Value: "command_channel_uri"

COMMAND_PARAMETER_KEY_INPUT_ID

Added in API level 33
static val COMMAND_PARAMETER_KEY_INPUT_ID: String

Playback command parameter: TV input ID.

Type: String

Value: "command_input_id"

COMMAND_PARAMETER_KEY_PLAYBACK_PARAMS

Added in API level 34
static val COMMAND_PARAMETER_KEY_PLAYBACK_PARAMS: String

Time shift command parameter: playback params.

Type: android.media.PlaybackParams

Value: "command_playback_params"

COMMAND_PARAMETER_KEY_PROGRAM_URI

Added in API level 34
static val COMMAND_PARAMETER_KEY_PROGRAM_URI: String

Time shift command parameter: program URI.

Type: android.net.Uri

Value: "command_program_uri"

COMMAND_PARAMETER_KEY_STOP_MODE

Added in API level 34
static val COMMAND_PARAMETER_KEY_STOP_MODE: String

Playback command parameter: stop mode.

Type: int

Value: "command_stop_mode"

COMMAND_PARAMETER_KEY_TIME_POSITION

Added in API level 34
static val COMMAND_PARAMETER_KEY_TIME_POSITION: String

Time shift command parameter: time position for time shifting, in milliseconds.

Type: long

Value: "command_time_position"

COMMAND_PARAMETER_KEY_TIME_SHIFT_MODE

Added in API level 34
static val COMMAND_PARAMETER_KEY_TIME_SHIFT_MODE: String

Time shift command parameter: playback params.

Type: Integer. One of TvInputManager#TIME_SHIFT_MODE_OFF, TvInputManager#TIME_SHIFT_MODE_LOCAL, TvInputManager#TIME_SHIFT_MODE_NETWORK, TvInputManager#TIME_SHIFT_MODE_AUTO.

Value: "command_time_shift_mode"

COMMAND_PARAMETER_KEY_TRACK_ID

Added in API level 33
static val COMMAND_PARAMETER_KEY_TRACK_ID: String

Playback command parameter: track ID.

Type: String

Value: "command_track_id"

COMMAND_PARAMETER_KEY_TRACK_TYPE

Added in API level 33
static val COMMAND_PARAMETER_KEY_TRACK_TYPE: String

Playback command parameter: track type.

Type: int

Value: "command_track_type"

COMMAND_PARAMETER_KEY_VOLUME

Added in API level 33
static val COMMAND_PARAMETER_KEY_VOLUME: String

Playback command parameter: stream volume.

Type: float

Value: "command_volume"

COMMAND_PARAMETER_VALUE_STOP_MODE_BLANK

Added in API level 34
static val COMMAND_PARAMETER_VALUE_STOP_MODE_BLANK: Int

Playback command stop mode: show a blank screen.

Value: 1

COMMAND_PARAMETER_VALUE_STOP_MODE_FREEZE

Added in API level 34
static val COMMAND_PARAMETER_VALUE_STOP_MODE_FREEZE: Int

Playback command stop mode: freeze the video.

Value: 2

PLAYBACK_COMMAND_TYPE_SELECT_TRACK

Added in API level 33
static val PLAYBACK_COMMAND_TYPE_SELECT_TRACK: String

Playback command type: select the given track.

Value: "select_track"

PLAYBACK_COMMAND_TYPE_SET_STREAM_VOLUME

Added in API level 33
static val PLAYBACK_COMMAND_TYPE_SET_STREAM_VOLUME: String

Playback command type: set the volume.

Value: "set_stream_volume"

PLAYBACK_COMMAND_TYPE_STOP

Added in API level 33
static val PLAYBACK_COMMAND_TYPE_STOP: String

Playback command type: stop the playback.

Value: "stop"

PLAYBACK_COMMAND_TYPE_TUNE

Added in API level 33
static val PLAYBACK_COMMAND_TYPE_TUNE: String

Playback command type: tune to the given channel.

Value: "tune"

PLAYBACK_COMMAND_TYPE_TUNE_NEXT

Added in API level 33
static val PLAYBACK_COMMAND_TYPE_TUNE_NEXT: String

Playback command type: tune to the next channel.

Value: "tune_next"

PLAYBACK_COMMAND_TYPE_TUNE_PREV

Added in API level 33
static val PLAYBACK_COMMAND_TYPE_TUNE_PREV: String

Playback command type: tune to the previous channel.

Value: "tune_previous"

SERVICE_INTERFACE

Added in API level 33
static val SERVICE_INTERFACE: String

This is the interface name that a service implementing a TV Interactive App 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_INTERACTIVE_APP permission so that other applications cannot abuse it.

Value: "android.media.tv.interactive.TvInteractiveAppService"

SERVICE_META_DATA

Added in API level 33
static val SERVICE_META_DATA: String

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

Value: "android.media.tv.interactive.app"

TIME_SHIFT_COMMAND_TYPE_PAUSE

Added in API level 34
static val TIME_SHIFT_COMMAND_TYPE_PAUSE: String

Time shift command type: pause.

Value: "pause"

TIME_SHIFT_COMMAND_TYPE_PLAY

Added in API level 34
static val TIME_SHIFT_COMMAND_TYPE_PLAY: String

Time shift command type: play.

Value: "play"

TIME_SHIFT_COMMAND_TYPE_RESUME

Added in API level 34
static val TIME_SHIFT_COMMAND_TYPE_RESUME: String

Time shift command type: resume.

Value: "resume"

TIME_SHIFT_COMMAND_TYPE_SEEK_TO

Added in API level 34
static val TIME_SHIFT_COMMAND_TYPE_SEEK_TO: String

Time shift command type: seek to.

Value: "seek_to"

TIME_SHIFT_COMMAND_TYPE_SET_MODE

Added in API level 34
static val TIME_SHIFT_COMMAND_TYPE_SET_MODE: String

Time shift command type: set time shift mode.

Value: "set_mode"

TIME_SHIFT_COMMAND_TYPE_SET_PLAYBACK_PARAMS

Added in API level 34
static val TIME_SHIFT_COMMAND_TYPE_SET_PLAYBACK_PARAMS: String

Time shift command type: set playback params.

Value: "set_playback_params"

Public constructors

TvInteractiveAppService

TvInteractiveAppService()

Public methods

notifyStateChanged

Added in API level 33
fun notifyStateChanged(
    type: Int,
    state: Int,
    error: Int
): Unit

Notifies the system when the state of the interactive app RTE has been changed.

Parameters
type Int: the interactive app type Value is android.media.tv.interactive.TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_HBBTV, android.media.tv.interactive.TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_ATSC, android.media.tv.interactive.TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_GINGA, android.media.tv.interactive.TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_TARGETED_AD, or android.media.tv.interactive.TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_OTHER
state Int: the current state of the service of the given type Value is android.media.tv.interactive.TvInteractiveAppManager#SERVICE_STATE_UNREALIZED, android.media.tv.interactive.TvInteractiveAppManager#SERVICE_STATE_PREPARING, android.media.tv.interactive.TvInteractiveAppManager#SERVICE_STATE_READY, or android.media.tv.interactive.TvInteractiveAppManager#SERVICE_STATE_ERROR
error Int: the error code for error state. TvInteractiveAppManager#ERROR_NONE is used when the state is not TvInteractiveAppManager#SERVICE_STATE_ERROR. Value is android.media.tv.interactive.TvInteractiveAppManager#ERROR_NONE, android.media.tv.interactive.TvInteractiveAppManager#ERROR_UNKNOWN, android.media.tv.interactive.TvInteractiveAppManager#ERROR_NOT_SUPPORTED, android.media.tv.interactive.TvInteractiveAppManager#ERROR_WEAK_SIGNAL, android.media.tv.interactive.TvInteractiveAppManager#ERROR_RESOURCE_UNAVAILABLE, android.media.tv.interactive.TvInteractiveAppManager#ERROR_BLOCKED, android.media.tv.interactive.TvInteractiveAppManager#ERROR_ENCRYPTED, or android.media.tv.interactive.TvInteractiveAppManager#ERROR_UNKNOWN_CHANNEL

onAppLinkCommand

Added in API level 33
open fun onAppLinkCommand(command: Bundle): Unit

Called when app link command is received.

Parameters
command Bundle: This value cannot be null.

onBind

Added in API level 33
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 cannot be null.
Return
IBinder? This value may be null.

onCreateSession

Added in API level 33
abstract fun onCreateSession(
    iAppServiceId: String,
    type: Int
): TvInteractiveAppService.Session?

Returns a concrete implementation of Session.

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

Parameters
iAppServiceId String: The ID of the TV Interactive App associated with the session. This value cannot be null.
type Int: The type of the TV Interactive App associated with the session. Value is android.media.tv.interactive.TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_HBBTV, android.media.tv.interactive.TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_ATSC, android.media.tv.interactive.TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_GINGA, android.media.tv.interactive.TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_TARGETED_AD, or android.media.tv.interactive.TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_OTHER

onRegisterAppLinkInfo

Added in API level 33
open fun onRegisterAppLinkInfo(appLinkInfo: AppLinkInfo): Unit

Called when a request to register an Android application link info record is received.

Parameters
appLinkInfo AppLinkInfo: This value cannot be null.

onUnregisterAppLinkInfo

Added in API level 33
open fun onUnregisterAppLinkInfo(appLinkInfo: AppLinkInfo): Unit

Called when a request to unregister an Android application link info record is received.

Parameters
appLinkInfo AppLinkInfo: This value cannot be null.