TvInteractiveAppManager


public final class TvInteractiveAppManager
extends Object

java.lang.Object
   ↳ android.media.tv.interactive.TvInteractiveAppManager


Central system API to the overall TV interactive application framework (TIAF) architecture, which arbitrates interaction between Android applications and TV interactive apps.

Summary

Nested classes

class TvInteractiveAppManager.TvInteractiveAppCallback

Callback used to monitor status of the TV Interactive App. 

Constants

String ACTION_APP_LINK_COMMAND

Broadcast intent action to send app command to TV app.

String APP_LINK_KEY_BACK_URI

Key for back URI in app link command.

String APP_LINK_KEY_CLASS_NAME

Key for class name in app link.

String APP_LINK_KEY_COMMAND_TYPE

Key for command type in app link command.

String APP_LINK_KEY_PACKAGE_NAME

Key for package name in app link.

String APP_LINK_KEY_SERVICE_ID

Key for service ID in app link command.

int ERROR_BLOCKED

Error code for blocked contents.

int ERROR_ENCRYPTED

Error code when the key or module is missing for the encrypted channel.

int ERROR_NONE

No error.

int ERROR_NOT_SUPPORTED

Error code for an unsupported channel.

int ERROR_RESOURCE_UNAVAILABLE

Error code when resource (e.g. tuner) is unavailable.

int ERROR_UNKNOWN

Unknown error code.

int ERROR_UNKNOWN_CHANNEL

Error code when the current channel is an unknown channel.

int ERROR_WEAK_SIGNAL

Error code for weak signal.

String INTENT_KEY_BI_INTERACTIVE_APP_TYPE

Intent key for broadcast-independent(BI) interactive app type.

String INTENT_KEY_BI_INTERACTIVE_APP_URI

Intent key for broadcast-independent(BI) interactive app URI.

String INTENT_KEY_CHANNEL_URI

Intent key for TV channel URI.

String INTENT_KEY_COMMAND_TYPE

Intent key for command type.

String INTENT_KEY_INTERACTIVE_APP_SERVICE_ID

Intent key for TV interactive app ID.

String INTENT_KEY_TV_INPUT_ID

Intent key for TV input ID.

int INTERACTIVE_APP_STATE_ERROR

Error state of interactive application.

int INTERACTIVE_APP_STATE_RUNNING

Running state of interactive application.

int INTERACTIVE_APP_STATE_STOPPED

Stopped (or not started) state of interactive application.

int SERVICE_STATE_ERROR

Error state of interactive app service.

int SERVICE_STATE_PREPARING

Preparing state of interactive app service.

int SERVICE_STATE_READY

Ready state of interactive app service.

int SERVICE_STATE_UNREALIZED

Unrealized state of interactive app service.

int TELETEXT_APP_STATE_ERROR

State of Teletext app: error

int TELETEXT_APP_STATE_HIDE

State of Teletext app: hide

int TELETEXT_APP_STATE_SHOW

State of Teletext app: show

Public methods

List<AppLinkInfo> getAppLinkInfoList()

Returns a list of available app link information.

List<TvInteractiveAppServiceInfo> getTvInteractiveAppServiceList()

Returns the complete list of TV Interactive App service on the system.

void registerAppLinkInfo(String tvIAppServiceId, AppLinkInfo appLinkInfo)

Registers an Android application link info record which can be used to launch the specific Android application by TV interactive App RTE.

void registerCallback(Executor executor, TvInteractiveAppManager.TvInteractiveAppCallback callback)

Registers a TvInteractiveAppCallback.

void sendAppLinkCommand(String tvIAppServiceId, Bundle command)

Sends app link command.

void unregisterAppLinkInfo(String tvIAppServiceId, AppLinkInfo appLinkInfo)

Unregisters an Android application link info record which can be used to launch the specific Android application by TV interactive App RTE.

void unregisterCallback(TvInteractiveAppManager.TvInteractiveAppCallback callback)

Unregisters the existing TvInteractiveAppCallback.

Inherited methods

Constants

Added in API level 33
public static final String ACTION_APP_LINK_COMMAND

Broadcast intent action to send app command to TV app.

Constant Value: "android.media.tv.interactive.action.APP_LINK_COMMAND"

Added in API level 33
public static final String APP_LINK_KEY_BACK_URI

Key for back URI in app link command.

Type: String

Constant Value: "back_uri"

Added in API level 33
public static final String APP_LINK_KEY_CLASS_NAME

Key for class name in app link.

Type: String

Constant Value: "class_name"

Added in API level 33
public static final String APP_LINK_KEY_COMMAND_TYPE

Key for command type in app link command.

Type: String

Constant Value: "command_type"

Added in API level 33
public static final String APP_LINK_KEY_PACKAGE_NAME

Key for package name in app link.

Type: String

Constant Value: "package_name"

Added in API level 33
public static final String APP_LINK_KEY_SERVICE_ID

Key for service ID in app link command.

Type: String

Constant Value: "service_id"

ERROR_BLOCKED

Added in API level 33
public static final int ERROR_BLOCKED

Error code for blocked contents.

Constant Value: 5 (0x00000005)

ERROR_ENCRYPTED

Added in API level 33
public static final int ERROR_ENCRYPTED

Error code when the key or module is missing for the encrypted channel.

Constant Value: 6 (0x00000006)

ERROR_NONE

Added in API level 33
public static final int ERROR_NONE

No error.

Constant Value: 0 (0x00000000)

ERROR_NOT_SUPPORTED

Added in API level 33
public static final int ERROR_NOT_SUPPORTED

Error code for an unsupported channel.

Constant Value: 2 (0x00000002)

ERROR_RESOURCE_UNAVAILABLE

Added in API level 33
public static final int ERROR_RESOURCE_UNAVAILABLE

Error code when resource (e.g. tuner) is unavailable.

Constant Value: 4 (0x00000004)

ERROR_UNKNOWN

Added in API level 33
public static final int ERROR_UNKNOWN

Unknown error code.

Constant Value: 1 (0x00000001)

ERROR_UNKNOWN_CHANNEL

Added in API level 33
public static final int ERROR_UNKNOWN_CHANNEL

Error code when the current channel is an unknown channel.

Constant Value: 7 (0x00000007)

ERROR_WEAK_SIGNAL

Added in API level 33
public static final int ERROR_WEAK_SIGNAL

Error code for weak signal.

Constant Value: 3 (0x00000003)

INTENT_KEY_BI_INTERACTIVE_APP_TYPE

Added in API level 33
public static final String INTENT_KEY_BI_INTERACTIVE_APP_TYPE

Intent key for broadcast-independent(BI) interactive app type. It's used to send app command to TV app.

Type: int

Constant Value: "bi_interactive_app_type"

INTENT_KEY_BI_INTERACTIVE_APP_URI

Added in API level 33
public static final String INTENT_KEY_BI_INTERACTIVE_APP_URI

Intent key for broadcast-independent(BI) interactive app URI. It's used to send app command to TV app.

Type: android.net.Uri

Constant Value: "bi_interactive_app_uri"

INTENT_KEY_CHANNEL_URI

Added in API level 33
public static final String INTENT_KEY_CHANNEL_URI

Intent key for TV channel URI. It's used to send app command to TV app.

Type: android.net.Uri

Constant Value: "channel_uri"

INTENT_KEY_COMMAND_TYPE

Added in API level 33
public static final String INTENT_KEY_COMMAND_TYPE

Intent key for command type. It's used to send app command to TV app. The value of this key could vary according to TV apps.

Type: String

Constant Value: "command_type"

INTENT_KEY_INTERACTIVE_APP_SERVICE_ID

Added in API level 33
public static final String INTENT_KEY_INTERACTIVE_APP_SERVICE_ID

Intent key for TV interactive app ID. It's used to send app command to TV app.

Type: String

Constant Value: "interactive_app_id"

INTENT_KEY_TV_INPUT_ID

Added in API level 33
public static final String INTENT_KEY_TV_INPUT_ID

Intent key for TV input ID. It's used to send app command to TV app.

Type: String

Constant Value: "tv_input_id"

INTERACTIVE_APP_STATE_ERROR

Added in API level 33
public static final int INTERACTIVE_APP_STATE_ERROR

Error state of interactive application.

Constant Value: 3 (0x00000003)

INTERACTIVE_APP_STATE_RUNNING

Added in API level 33
public static final int INTERACTIVE_APP_STATE_RUNNING

Running state of interactive application.

Constant Value: 2 (0x00000002)

INTERACTIVE_APP_STATE_STOPPED

Added in API level 33
public static final int INTERACTIVE_APP_STATE_STOPPED

Stopped (or not started) state of interactive application.

Constant Value: 1 (0x00000001)

SERVICE_STATE_ERROR

Added in API level 33
public static final int SERVICE_STATE_ERROR

Error state of interactive app service.

Constant Value: 4 (0x00000004)

SERVICE_STATE_PREPARING

Added in API level 33
public static final int SERVICE_STATE_PREPARING

Preparing state of interactive app service.

Constant Value: 2 (0x00000002)

SERVICE_STATE_READY

Added in API level 33
public static final int SERVICE_STATE_READY

Ready state of interactive app service.

In this state, the interactive app service is ready, and interactive apps can be started.

Constant Value: 3 (0x00000003)

SERVICE_STATE_UNREALIZED

Added in API level 33
public static final int SERVICE_STATE_UNREALIZED

Unrealized state of interactive app service.

Constant Value: 1 (0x00000001)

TELETEXT_APP_STATE_ERROR

Added in API level 33
public static final int TELETEXT_APP_STATE_ERROR

State of Teletext app: error

Constant Value: 3 (0x00000003)

TELETEXT_APP_STATE_HIDE

Added in API level 33
public static final int TELETEXT_APP_STATE_HIDE

State of Teletext app: hide

Constant Value: 2 (0x00000002)

TELETEXT_APP_STATE_SHOW

Added in API level 33
public static final int TELETEXT_APP_STATE_SHOW

State of Teletext app: show

Constant Value: 1 (0x00000001)

Public methods

getAppLinkInfoList

Added in API level 34
public List<AppLinkInfo> getAppLinkInfoList ()

Returns a list of available app link information.

A package must declare its app link info in its manifest using meta-data tag, so the info can be detected by the system.

Returns
List<AppLinkInfo> List of AppLinkInfo for each package that deslares its app link information. This value cannot be null.

getTvInteractiveAppServiceList

Added in API level 33
public List<TvInteractiveAppServiceInfo> getTvInteractiveAppServiceList ()

Returns the complete list of TV Interactive App service on the system.

Returns
List<TvInteractiveAppServiceInfo> List of TvInteractiveAppServiceInfo for each TV Interactive App service that describes its meta information. This value cannot be null.

registerAppLinkInfo

Added in API level 33
public void registerAppLinkInfo (String tvIAppServiceId, 
                AppLinkInfo appLinkInfo)

Registers an Android application link info record which can be used to launch the specific Android application by TV interactive App RTE.

Parameters
tvIAppServiceId String: The ID of TV interactive service which the command to be sent to. The ID can be found in TvInteractiveAppServiceInfo.getId(). This value cannot be null.

appLinkInfo AppLinkInfo: The Android application link info record to be registered. This value cannot be null.

registerCallback

Added in API level 33
public void registerCallback (Executor executor, 
                TvInteractiveAppManager.TvInteractiveAppCallback callback)

Registers a TvInteractiveAppCallback.

Parameters
executor Executor: A Executor that the status change will be delivered to. Callback and listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor(). Otherwise, provide an Executor that dispatches to an appropriate thread. This value cannot be null.

callback TvInteractiveAppManager.TvInteractiveAppCallback: A callback used to monitor status of the TV Interactive App services. This value cannot be null.

sendAppLinkCommand

Added in API level 33
public void sendAppLinkCommand (String tvIAppServiceId, 
                Bundle command)

Sends app link command.

Parameters
tvIAppServiceId String: The ID of TV interactive service which the command to be sent to. The ID can be found in TvInteractiveAppServiceInfo.getId(). This value cannot be null.

command Bundle: The command to be sent. This value cannot be null.

unregisterAppLinkInfo

Added in API level 33
public void unregisterAppLinkInfo (String tvIAppServiceId, 
                AppLinkInfo appLinkInfo)

Unregisters an Android application link info record which can be used to launch the specific Android application by TV interactive App RTE.

Parameters
tvIAppServiceId String: The ID of TV interactive service which the command to be sent to. The ID can be found in TvInteractiveAppServiceInfo.getId(). This value cannot be null.

appLinkInfo AppLinkInfo: The Android application link info record to be unregistered. This value cannot be null.

unregisterCallback

Added in API level 33
public void unregisterCallback (TvInteractiveAppManager.TvInteractiveAppCallback callback)

Unregisters the existing TvInteractiveAppCallback.

Parameters
callback TvInteractiveAppManager.TvInteractiveAppCallback: The existing callback to remove. This value cannot be null.