TvInteractiveAppService


public abstract class TvInteractiveAppService
extends Service

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

class TvInteractiveAppService.Session

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

Constants

String COMMAND_PARAMETER_KEY_CHANGE_CHANNEL_QUIETLY

Command to quiet channel change.

String COMMAND_PARAMETER_KEY_CHANNEL_URI

Playback command parameter: channel URI.

String COMMAND_PARAMETER_KEY_INPUT_ID

Playback command parameter: TV input ID.

String COMMAND_PARAMETER_KEY_PLAYBACK_PARAMS

Time shift command parameter: playback params.

String COMMAND_PARAMETER_KEY_PROGRAM_URI

Time shift command parameter: program URI.

String COMMAND_PARAMETER_KEY_STOP_MODE

Playback command parameter: stop mode.

String COMMAND_PARAMETER_KEY_TIME_POSITION

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

String COMMAND_PARAMETER_KEY_TIME_SHIFT_MODE

Time shift command parameter: playback params.

String COMMAND_PARAMETER_KEY_TRACK_ID

Playback command parameter: track ID.

String COMMAND_PARAMETER_KEY_TRACK_TYPE

Playback command parameter: track type.

String COMMAND_PARAMETER_KEY_VOLUME

Playback command parameter: stream volume.

int COMMAND_PARAMETER_VALUE_STOP_MODE_BLANK

Playback command stop mode: show a blank screen.

int COMMAND_PARAMETER_VALUE_STOP_MODE_FREEZE

Playback command stop mode: freeze the video.

String PLAYBACK_COMMAND_TYPE_SELECT_TRACK

Playback command type: select the given track.

String PLAYBACK_COMMAND_TYPE_SET_STREAM_VOLUME

Playback command type: set the volume.

String PLAYBACK_COMMAND_TYPE_STOP

Playback command type: stop the playback.

String PLAYBACK_COMMAND_TYPE_TUNE

Playback command type: tune to the given channel.

String PLAYBACK_COMMAND_TYPE_TUNE_NEXT

Playback command type: tune to the next channel.

String PLAYBACK_COMMAND_TYPE_TUNE_PREV

Playback command type: tune to the previous channel.

String SERVICE_INTERFACE

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.

String SERVICE_META_DATA

Name under which a TvInteractiveAppService component publishes information about itself.

String TIME_SHIFT_COMMAND_TYPE_PAUSE

Time shift command type: pause.

String TIME_SHIFT_COMMAND_TYPE_PLAY

Time shift command type: play.

String TIME_SHIFT_COMMAND_TYPE_RESUME

Time shift command type: resume.

String TIME_SHIFT_COMMAND_TYPE_SEEK_TO

Time shift command type: seek to.

String TIME_SHIFT_COMMAND_TYPE_SET_MODE

Time shift command type: set time shift mode.

String TIME_SHIFT_COMMAND_TYPE_SET_PLAYBACK_PARAMS

Time shift command type: set playback params.

Inherited constants

Public constructors

TvInteractiveAppService()

Public methods

final void notifyStateChanged(int type, int state, int error)

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

void onAppLinkCommand(Bundle command)

Called when app link command is received.

final IBinder onBind(Intent intent)

Return the communication channel to the service.

abstract TvInteractiveAppService.Session onCreateSession(String iAppServiceId, int type)

Returns a concrete implementation of Session.

void onRegisterAppLinkInfo(AppLinkInfo appLinkInfo)

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

void onUnregisterAppLinkInfo(AppLinkInfo appLinkInfo)

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

Inherited methods

Constants

COMMAND_PARAMETER_KEY_CHANGE_CHANNEL_QUIETLY

Added in API level 33
public static final String COMMAND_PARAMETER_KEY_CHANGE_CHANNEL_QUIETLY

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.

Constant Value: "command_change_channel_quietly"

COMMAND_PARAMETER_KEY_CHANNEL_URI

Added in API level 33
public static final String COMMAND_PARAMETER_KEY_CHANNEL_URI

Playback command parameter: channel URI.

Type: android.net.Uri

Constant Value: "command_channel_uri"

COMMAND_PARAMETER_KEY_INPUT_ID

Added in API level 33
public static final String COMMAND_PARAMETER_KEY_INPUT_ID

Playback command parameter: TV input ID.

Type: String

Constant Value: "command_input_id"

COMMAND_PARAMETER_KEY_PLAYBACK_PARAMS

Added in API level 34
public static final String COMMAND_PARAMETER_KEY_PLAYBACK_PARAMS

Time shift command parameter: playback params.

Type: android.media.PlaybackParams

Constant Value: "command_playback_params"

COMMAND_PARAMETER_KEY_PROGRAM_URI

Added in API level 34
public static final String COMMAND_PARAMETER_KEY_PROGRAM_URI

Time shift command parameter: program URI.

Type: android.net.Uri

Constant Value: "command_program_uri"

COMMAND_PARAMETER_KEY_STOP_MODE

Added in API level 34
public static final String COMMAND_PARAMETER_KEY_STOP_MODE

Playback command parameter: stop mode.

Type: int

Constant Value: "command_stop_mode"

COMMAND_PARAMETER_KEY_TIME_POSITION

Added in API level 34
public static final String COMMAND_PARAMETER_KEY_TIME_POSITION

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

Type: long

Constant Value: "command_time_position"

COMMAND_PARAMETER_KEY_TIME_SHIFT_MODE

Added in API level 34
public static final String COMMAND_PARAMETER_KEY_TIME_SHIFT_MODE

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.

Constant Value: "command_time_shift_mode"

COMMAND_PARAMETER_KEY_TRACK_ID

Added in API level 33
public static final String COMMAND_PARAMETER_KEY_TRACK_ID

Playback command parameter: track ID.

Type: String

Constant Value: "command_track_id"

COMMAND_PARAMETER_KEY_TRACK_TYPE

Added in API level 33
public static final String COMMAND_PARAMETER_KEY_TRACK_TYPE

Playback command parameter: track type.

Type: int

Constant Value: "command_track_type"

COMMAND_PARAMETER_KEY_VOLUME

Added in API level 33
public static final String COMMAND_PARAMETER_KEY_VOLUME

Playback command parameter: stream volume.

Type: float

Constant Value: "command_volume"

COMMAND_PARAMETER_VALUE_STOP_MODE_BLANK

Added in API level 34
public static final int COMMAND_PARAMETER_VALUE_STOP_MODE_BLANK

Playback command stop mode: show a blank screen.

Constant Value: 1 (0x00000001)

COMMAND_PARAMETER_VALUE_STOP_MODE_FREEZE

Added in API level 34
public static final int COMMAND_PARAMETER_VALUE_STOP_MODE_FREEZE

Playback command stop mode: freeze the video.

Constant Value: 2 (0x00000002)

PLAYBACK_COMMAND_TYPE_SELECT_TRACK

Added in API level 33
public static final String PLAYBACK_COMMAND_TYPE_SELECT_TRACK

Playback command type: select the given track.

Constant Value: "select_track"

PLAYBACK_COMMAND_TYPE_SET_STREAM_VOLUME

Added in API level 33
public static final String PLAYBACK_COMMAND_TYPE_SET_STREAM_VOLUME

Playback command type: set the volume.

Constant Value: "set_stream_volume"

PLAYBACK_COMMAND_TYPE_STOP

Added in API level 33
public static final String PLAYBACK_COMMAND_TYPE_STOP

Playback command type: stop the playback.

Constant Value: "stop"

PLAYBACK_COMMAND_TYPE_TUNE

Added in API level 33
public static final String PLAYBACK_COMMAND_TYPE_TUNE

Playback command type: tune to the given channel.

Constant Value: "tune"

PLAYBACK_COMMAND_TYPE_TUNE_NEXT

Added in API level 33
public static final String PLAYBACK_COMMAND_TYPE_TUNE_NEXT

Playback command type: tune to the next channel.

Constant Value: "tune_next"

PLAYBACK_COMMAND_TYPE_TUNE_PREV

Added in API level 33
public static final String PLAYBACK_COMMAND_TYPE_TUNE_PREV

Playback command type: tune to the previous channel.

Constant Value: "tune_previous"

SERVICE_INTERFACE

Added in API level 33
public static final String SERVICE_INTERFACE

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 Manifest.permission.BIND_TV_INTERACTIVE_APP permission so that other applications cannot abuse it.

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

SERVICE_META_DATA

Added in API level 33
public static final String SERVICE_META_DATA

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

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

TIME_SHIFT_COMMAND_TYPE_PAUSE

Added in API level 34
public static final String TIME_SHIFT_COMMAND_TYPE_PAUSE

Time shift command type: pause.

Constant Value: "pause"

TIME_SHIFT_COMMAND_TYPE_PLAY

Added in API level 34
public static final String TIME_SHIFT_COMMAND_TYPE_PLAY

Time shift command type: play.

Constant Value: "play"

TIME_SHIFT_COMMAND_TYPE_RESUME

Added in API level 34
public static final String TIME_SHIFT_COMMAND_TYPE_RESUME

Time shift command type: resume.

Constant Value: "resume"

TIME_SHIFT_COMMAND_TYPE_SEEK_TO

Added in API level 34
public static final String TIME_SHIFT_COMMAND_TYPE_SEEK_TO

Time shift command type: seek to.

Constant Value: "seek_to"

TIME_SHIFT_COMMAND_TYPE_SET_MODE

Added in API level 34
public static final String TIME_SHIFT_COMMAND_TYPE_SET_MODE

Time shift command type: set time shift mode.

Constant Value: "set_mode"

TIME_SHIFT_COMMAND_TYPE_SET_PLAYBACK_PARAMS

Added in API level 34
public static final String TIME_SHIFT_COMMAND_TYPE_SET_PLAYBACK_PARAMS

Time shift command type: set playback params.

Constant Value: "set_playback_params"

Public constructors

TvInteractiveAppService

public TvInteractiveAppService ()

Public methods

notifyStateChanged

Added in API level 33
public final void notifyStateChanged (int type, 
                int state, 
                int error)

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

Parameters
type int: the interactive app type Value is TvInteractiveAppServiceInfo.INTERACTIVE_APP_TYPE_HBBTV, TvInteractiveAppServiceInfo.INTERACTIVE_APP_TYPE_ATSC, TvInteractiveAppServiceInfo.INTERACTIVE_APP_TYPE_GINGA, TvInteractiveAppServiceInfo.INTERACTIVE_APP_TYPE_TARGETED_AD, or TvInteractiveAppServiceInfo.INTERACTIVE_APP_TYPE_OTHER

state int: the current state of the service of the given type Value is TvInteractiveAppManager.SERVICE_STATE_UNREALIZED, TvInteractiveAppManager.SERVICE_STATE_PREPARING, TvInteractiveAppManager.SERVICE_STATE_READY, or 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 TvInteractiveAppManager.ERROR_NONE, TvInteractiveAppManager.ERROR_UNKNOWN, TvInteractiveAppManager.ERROR_NOT_SUPPORTED, TvInteractiveAppManager.ERROR_WEAK_SIGNAL, TvInteractiveAppManager.ERROR_RESOURCE_UNAVAILABLE, TvInteractiveAppManager.ERROR_BLOCKED, TvInteractiveAppManager.ERROR_ENCRYPTED, or TvInteractiveAppManager.ERROR_UNKNOWN_CHANNEL

onAppLinkCommand

Added in API level 33
public void onAppLinkCommand (Bundle command)

Called when app link command is received.

Parameters
command Bundle: This value cannot be null.

onBind

Added in API level 33
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 cannot be null.

Returns
IBinder This value may be null.

onCreateSession

Added in API level 33
public abstract TvInteractiveAppService.Session onCreateSession (String iAppServiceId, 
                int type)

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 TvInteractiveAppServiceInfo.INTERACTIVE_APP_TYPE_HBBTV, TvInteractiveAppServiceInfo.INTERACTIVE_APP_TYPE_ATSC, TvInteractiveAppServiceInfo.INTERACTIVE_APP_TYPE_GINGA, TvInteractiveAppServiceInfo.INTERACTIVE_APP_TYPE_TARGETED_AD, or TvInteractiveAppServiceInfo.INTERACTIVE_APP_TYPE_OTHER

Returns
TvInteractiveAppService.Session

onRegisterAppLinkInfo

Added in API level 33
public void onRegisterAppLinkInfo (AppLinkInfo appLinkInfo)

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
public void onUnregisterAppLinkInfo (AppLinkInfo appLinkInfo)

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

Parameters
appLinkInfo AppLinkInfo: This value cannot be null.