Skip to content

Latest commit

 

History

History
258 lines (191 loc) · 6 KB

File metadata and controls

258 lines (191 loc) · 6 KB

LifecycleManager Plugin

Version: 1.0.0

A LifecycleManager plugin for Thunder framework.

Table of Contents

Abbreviation, Acronyms and Terms

[Refer to this link]

Description

The LifecycleManager plugin provides an interface for LifecycleManager.

The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [Thunder].

Configuration

The table below lists configuration options of the plugin.

Name Type Description
callsign string Plugin instance name (default: org.rdk.LifecycleManager)
classname string Class name: LifecycleManager
locator string Library name: libWPEFrameworkLifecycleManager.so
autostart boolean Determines if the plugin shall be started automatically along with the framework

Methods

The following methods are provided by the LifecycleManager plugin:

LifecycleManager interface methods:

Method Description
appReady Response api call to appInitializing API
closeApp close the app
stateChangeComplete Response api call to appLifecycleStateChanged API

appReady

Response api call to appInitializing API

Events

Event details will be updated soon.

Parameters

Name Type Description
params object
params.appId string

Results

Name Type Description
result null On success null will be returned.

Examples

Request

{
    "jsonrpc": 2.0,
    "id": 0,
    "method": "org.rdk.LifecycleManager.appReady",
    "params": {
        "appId": ""
    }
}

CURL Command

curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 0, "method": "org.rdk.LifecycleManager.appReady", "params": {"appId": ""}}' http://127.0.0.1:9998/jsonrpc

Response

{
    "jsonrpc": 2.0,
    "id": 0,
    "result": null
}

closeApp

close the app

Events

Event details will be updated soon.

Parameters

Name Type Description
params object
params.appId string
params.closeReason string closed reason for application

Results

Name Type Description
result null On success null will be returned.

Examples

Request

{
    "jsonrpc": 2.0,
    "id": 1,
    "method": "org.rdk.LifecycleManager.closeApp",
    "params": {
        "appId": "",
        "closeReason": "USER_EXIT"
    }
}

CURL Command

curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 1, "method": "org.rdk.LifecycleManager.closeApp", "params": {"appId": "", "closeReason": "USER_EXIT"}}' http://127.0.0.1:9998/jsonrpc

Response

{
    "jsonrpc": 2.0,
    "id": 1,
    "result": null
}

stateChangeComplete

Response api call to appLifecycleStateChanged API

Events

Event details will be updated soon.

Parameters

Name Type Description
params object
params.appId string
params.stateChangedId integer state changed identifier
params.success bool

Results

Name Type Description
result null On success null will be returned.

Examples

Request

{
    "jsonrpc": 2.0,
    "id": 2,
    "method": "org.rdk.LifecycleManager.stateChangeComplete",
    "params": {
        "appId": "",
        "stateChangedId": 0,
        "success": true
    }
}

CURL Command

curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 2, "method": "org.rdk.LifecycleManager.stateChangeComplete", "params": {"appId": "", "stateChangedId": 0, "success": true}}' http://127.0.0.1:9998/jsonrpc

Response

{
    "jsonrpc": 2.0,
    "id": 2,
    "result": null
}

Notifications

Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [Thunder] for information on how to register for a notification.

The following events are provided by the LifecycleManager plugin:

LifecycleManager interface events:

Event Description
onAppLifecycleStateChanged Notifies the new state

onAppLifecycleStateChanged

Notifies the new state

Parameters

Name Type Description
params object
params.appId string
params.appInstanceId string
params.oldLifecycleState LifecycleState The previous state of the application instance before the update.
params.newLifecycleState LifecycleState The new state to transition the application.
params.navigationIntent string navigation intent during active state

Examples

{
    "jsonrpc": 2.0,
    "id": 3,
    "method": "org.rdk.LifecycleManager.onAppLifecycleStateChanged",
    "params": {
        "appId": "",
        "appInstanceId": "",
        "oldLifecycleState": "",
        "newLifecycleState": "",
        "navigationIntent": ""
    }
}