The ApplicationPrivateData class

Support in HbbTV

Available since: HbbTV 1.0 (ETSI TS 102 796 V1.1.1, OIPF DAE V1.1)

The following properties and methods shall be supported:

– keyset
– currentChannel
– getFreeMem()

All other properties and methods are not included.

Properties

readonly Keyset keyset

The object representing the user input events sent to the DAE application.

readonly Channel currentChannel

For a broadcast-related application, the value of the property contains the channel whose AIT is currently controlling the lifecycle of this application. If no channel is being presented, or if the application is not broadcast-related, the value of this property shall be null.

readonly Boolean wakeupApplication

The wakeupApplication property is set if there has been a prepareWakeupApplication() request by that application.

readonly Boolean wakeupOITF

The wakeupOITF property is set if there has been a call to the prepareWakeupOITF() method.

Methods

Integer getFreeMem()

Description

Let application developer query information about the current memory available to the application. This is used to help during application development to find application memory leaks and possibly allow an application to make decisions related to its caching strategy (e.g. for images).

Returns the available memory to the application or -1 if the information is not available.

For example:

var app = appman.getOwnerApplication(window.document);

debug(“[APP] free mem = ” + app.privateData.getFreeMem() + “\n”);

Boolean prepareWakeupApplication( String URI, String token, Date time )

Description

The prepareWakeupApplication() method allows the DAE application to set-up the OITF to wake-up at a specified time. The wake-up is limited to the OITF being in the PASSIVE_STANDBY state at the specified time. If the timer expires while the DAE application is in a different state it is silently ignored.

Only one wake-up is to be supported for a DAE application. If a previous wake-up request had been registered it SHALL be overwritten.

If the wake-up fails to be set-up this operation SHALL return false. Failure may be due to OITF expecting to change to an OFF power state which would not allow the wake-up request to survive.

Arguments

URI

The URI from which the content can be fetched.

token

The token is a string which the application may retrieve with clearWakeupToken().

time

The time when the wake-up is to occur.

Boolean prepareWakeupOITF( Date time )

Description

The prepareWakeupOITF() method allows the DAE application to set-up the OITF to wake-up at a specified time. The wake-up is limited to the OITF being in the PASSIVE_STANDBY or PASSIVE_STANDBY_HIBERNATE state at the specified time. If the timer expires while the DAE application is in a different state it is silently ignored.

Unlike prepareWakeupApplication() this method applies to all the DAE applications and not limited to a single DAE application

If the wake-up fails to be set-up this operation SHALL return false. Failure may be due to OITF expecting to change to an OFF power state which would not allow the wake-up request to survive.

Arguments

time

The time when the wake-up is to occur.

String clearWakeupToken( )

Description

The clearWakeupToken() method shall return the token set in prepareWakeupApplication() method. The wake-up token should be cleared once it is read in order to limit usage to only when the DAE application starts up.