• Quick Start
  • Booting
  • Platform
  • Portals
  • References
    • API Reference TOI3
    • IIP Reference
  • Resources
ARRIS Enterprises, Inc. Confidential Information

ToiApplicationService

Class Summary

Extends:
  • ToiEventTarget

The Application Service is responsible for maintaining the lifecycles of every application registered in the system.

Service:

This is a service and can be accessed through toi.applicationService
  • Methods
  • Members
  • Types

Method Summary

getGenericOpenSourceLicensesInfo ( )  → Array.<ToiApplicationService.ToiOpenSourceLicenseInfo>

Returns information about generic open source licenses used by KreaTV.

getOpenSourceComponentsInfo ( )  → Array.<ToiApplicationService.ToiOpenSourceComponentInfo>

Returns information about open source components used by KreaTV.

getOpenSourceLicenseText ( id )  → text

Returns open source license text for a given identifier.

getSecondaryApplications ( )  → Array.<ToiSecondaryApplication>

Returns a sequence of all installed secondary applications.

resetInputFocus ( )

Reset input focus to the primary application after it has been set to another application via ToiSecondaryApplication#setInputFocus.

signData ( keyName , userData )  → signature

This method is used to RSA sign user data. The method signs a hash of the supplied user data as specified in PKCS #1 2.0. The current limit for the data to sign is 4 KiB.

verifySignature ( keyName , userData , signature )  → isVerified

This method is used to RSA verify signatures for user data. The current limit for the data to verify is 4 KiB.

Inherited Methods

addEventListener ( type , listener )

This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners.

removeEventListener ( type , listener )

This method removes an event listener for a specific event.

Type Definitions

ToiOpenSourceLicenseId (Type: number)

An identifier of an open source license text. See ToiApplicationService#getOpenSourceLicenseText.

ToiStateChangeReason (Type: enum)

The possible reasons for application to change state.

  • STATE_CHANGE_REASON_SYSTEM_COMMAND
  • STATE_CHANGE_REASON_UNEXPECTED_EXIT
  • STATE_CHANGE_REASON_USER_COMMAND

Methods

addEventListener ( type , listener )

This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners.

Inherited From:

  • ToiEventTarget#addEventListener

Parameters:

Name Type Description
type number

The event type of the event to subscribe to.

listener ToiEventListener

The JavaScript function that will receive events.

Throws:

ToiInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the application calls addEventListener with the same combination of type and listener twice.

getGenericOpenSourceLicensesInfo ( )  → Array.<ToiApplicationService.ToiOpenSourceLicenseInfo>

Returns information about generic open source licenses used by KreaTV.

Returns:

The returned generic open source license info.

Type: Array.<ToiApplicationService.ToiOpenSourceLicenseInfo>
getOpenSourceComponentsInfo ( )  → Array.<ToiApplicationService.ToiOpenSourceComponentInfo>

Returns information about open source components used by KreaTV.

Returns:

The returned open source component info.

Type: Array.<ToiApplicationService.ToiOpenSourceComponentInfo>
getOpenSourceLicenseText ( id )  → text

Returns open source license text for a given identifier.

Parameters:

Name Type Description
id ToiApplicationService.ToiOpenSourceLicenseId

The open source license identifier.

Throws:

ToiInvalidArgumentException

Raised if the specified identifier is invalid.

Returns:

The returned open source license text.

Type: string
getSecondaryApplications ( )  → Array.<ToiSecondaryApplication>

Returns a sequence of all installed secondary applications.

Returns:

The returned sequence of ToiSecondaryApplication instances.

Type: Array.<ToiSecondaryApplication>
removeEventListener ( type , listener )

This method removes an event listener for a specific event.

Inherited From:

  • ToiEventTarget#removeEventListener

Parameters:

Name Type Description
type number

The event type of the event to remove the listener from.

listener ToiEventListener

The JavaScript function that was previously added as an event listener.

Throws:

ToiInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the listener has not previously been added.

resetInputFocus ( )

Reset input focus to the primary application after it has been set to another application via ToiSecondaryApplication#setInputFocus.

signData ( keyName , userData )  → signature

This method is used to RSA sign user data. The method signs a hash of the supplied user data as specified in PKCS #1 2.0. The current limit for the data to sign is 4 KiB.

Technical Preview:

This method is a TECHNICAL PREVIEW, it may change.

Parameters:

Name Type Description
keyName string

The logical name of an installed RSA key to use.

userData string

The base64 encoded data that shall be digested and signed.

Throws:

ToiInvalidArgumentException

Raised if the provided data is invalid or the logical name is unknown.

ToiUnavailableException

Raised if the signing operation fails.

Returns:

The resulting signature in base64 encoding.

Type: string
verifySignature ( keyName , userData , signature )  → isVerified

This method is used to RSA verify signatures for user data. The current limit for the data to verify is 4 KiB.

Technical Preview:

This method is a TECHNICAL PREVIEW, it may change.

Parameters:

Name Type Description
keyName string

The logical name of an certificate to use.

userData string

The base64 encoded data that shall be verified.

signature string

The base64 encoded signature associated with the user data.

Throws:

ToiInvalidArgumentException

Raised if the provided data is invalid. Raised if signature data is invalid Raised if the logical name is unknown.

ToiUnavailableException

Raised if the verification operation fails.

Returns:

Returns true on successful verification, false otherwise.

Type: boolean

Members

KEY_NAME_DEVICE (Type: string) (value = 'device') (static, constant)

This constant represents the logic name of built-in private product key.

This constant can be also be accessed from toi.consts.ToiApplicationService.KEY_NAME_DEVICE.
STATE_CHANGE_REASON_SYSTEM_COMMAND (Type: ToiApplicationService.ToiStateChangeReason) (value = 2) (static, constant)

The state change was initiated by the platform.

This constant can be also be accessed from toi.consts.ToiApplicationService.STATE_CHANGE_REASON_SYSTEM_COMMAND.
STATE_CHANGE_REASON_UNEXPECTED_EXIT (Type: ToiApplicationService.ToiStateChangeReason) (value = 0) (static, constant)

The state change was caused by an unexpected crash or was initiated due to low system resources.

This constant can be also be accessed from toi.consts.ToiApplicationService.STATE_CHANGE_REASON_UNEXPECTED_EXIT.
STATE_CHANGE_REASON_USER_COMMAND (Type: ToiApplicationService.ToiStateChangeReason) (value = 1) (static, constant)

The state change was initiated by the primary application or the user.

This constant can be also be accessed from toi.consts.ToiApplicationService.STATE_CHANGE_REASON_USER_COMMAND.
ToiApplicationProperty (Type: struct) (static)

Represents an application property as a name-value pair.

Struct fields

Name Description
name

The property name.

Type: string
value

The property value.

Type: string

ToiOpenSourceComponentInfo (Type: struct) (static)

Information about an open source component.

Struct fields

Name Description
license

Information about the component.

Type: ToiApplicationService.ToiOpenSourceLicenseInfo
referencedLicenses

Licenses that are referenced by the open source license text identified by the license above.

Type: Array.<ToiApplicationService.ToiOpenSourceLicenseId>

ToiOpenSourceLicenseInfo (Type: struct) (static)

Information about an open source license.

Struct fields

Name Description
id

A unique identifier of a license text.

Type: ToiApplicationService.ToiOpenSourceLicenseId
title

A human-readable title of the license text. For a generic license, this is the name of the license (e.g. "GNU General Public License 2.0 (GPL)"). For a non-generic/component-specific license, this is the name and version of the open source component (e.g. "BusyBox 1.20.2").

Type: string

5.1.p5

Copyright (c) 2017 ARRIS Enterprises, LLC. All Rights Reserved. ARRIS Enterprises, LLC. Confidential Information.