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

Application Service Overview

The Application Service is responsible for handling applications in the system. An application is a software module which, in contrast to a service in the platform, is designed to interact with the user. The basic functionality of the Application Service is to facilitate concurrent execution of multiple applications.

Overview

To manage the behaviours of different types of applications, each application is designated as one of the three following types:

  • primary: The main STB UI. This may be KreaTV UI or a JS-driven portal developed by a customer.
  • secondary: An application with which the user can interact directly, a typical example being YouTube leanback. It has a state that is separated from the portal, which means that user interaction with a secondary application does not disrupt the state of the portal. Some limitations due to resource constraints may apply. A secondary application may be its own process or several of them may live together in one process, but each secondary application is its own IIP that needs to be explicitly included in a build configuration.
  • noninteractive: These applications are typically not possible for the user to interact with directly, but they may render graphics to the screen. The subtitle renderer is a typical example.

The Application Service can retrieve all secondary applications for use by the user interface. It manages the state and life cycle of secondary applications through the use of an internal database. The information in this database is referred to as the application properties.

The process of deciding which application should be visible and receive user input is the responsibility of the user interface, which is implemented in the primary application. The Application Service supplies the interface to implement this functionality but avoids making autonomous decisions whenever possible, except in cases such as resource constraints or crashes. This means that the user interface needs to actively decide which secondary applications to make visible and when they should receive input.

The primary application is always visible on top of any running secondary applications. This enables functionality in the primary application such as rendering popups or menus on top of other applications. It also means that the primary application needs to make itself transparent in order for any secondary applications to actually become visible to the end user.

Application States

The main responsibility of the Application Service is to manage the states of the secondary applications. The secondary applications can be in four different states: STOPPED, LOADING, VISIBLE, HIDDEN.

secondary Application state diagram.

  • In the STOPPED state, the application is installed on the system but is not being executed or process (or processes) does no longer exist in the system. The application starts in this state by default and may return to it by exiting in an orderly fashion, crashing or being stopped due to lack of system resources. When the platform has released all resources and the application should be restarted to running state it will leave the STOPPED state and enter LOADING state.
  • During the LOADING state, the application start procedure will be performed and it will initialize itself to become fully operational. The application will leave this state autonomously and enter HIDDEN once it is ready to be interacted with.
  • In the HIDDEN state, the application is running but is not visible to the user.
  • In the VISIBLE state, the application is running and is visible to the user when the primary application makes itself transparent. The application may have input focus in this state.

Setting input focus

Only one primary or secondary application can have input focus. As a consequence, setting input focus to a secondary application will remove input focus from whatever application had it previously.

Setting input focus to the primary application is done by resetting input focus via the Application Service.

Input handling

Making input focus exclusive to one application is intended to simplify input handling. In order to enable the primary application to retain control when it has lost input focus, it can eavesdrop on predefined inputs via subscribeKey().

Subscribing via subscribeKey() is done for each secondary application and may be done at any time. This relieves the primary application from the need to keep explicit track of which, if any, secondary application currently has input focus.

A secondary application cannot have input focus if it is not VISIBLE. A secondary application that has input focus and leaves the VISIBLE state for any reason will automatically relinquish input focus back to the primary application.

See also:TOI Application Service Interface

See also: TOI secondary Application Interface

5.0.1

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