Skip to content

Commit 6f26d85

Browse files
authored
Merge pull request #539 from rdkcentral/topic/RDKEMW-6918
RDKEMW-6918: Create documentation for LifecycleManager
2 parents 8cdc936 + 436a2aa commit 6f26d85

File tree

4 files changed

+404
-0
lines changed

4 files changed

+404
-0
lines changed

docs/_sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
- [HdmiCecSource](apis/HdmiCecSourcePlugin.md)
2121
- [HomeKitTV](apis/HomeKitTVPlugin.md)
2222
- [LEDControl](apis/LEDControlPlugin.md)
23+
- [LifecycleManager](apis/LifecycleManagerPlugin.md)
2324
- [LinearPlaybackControl](apis/LinearPlaybackControlPlugin.md)
2425
- [MaintenanceManager](apis/MaintenanceManagerPlugin.md)
2526
- [MessageControl](apis/MessageControlPlugin.md)
Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
<!-- Generated automatically, DO NOT EDIT! -->
2+
<a name="head.LifecycleManager_Plugin"></a>
3+
# LifecycleManager Plugin
4+
5+
A org.rdk.LifecycleManager plugin for Thunder framework.
6+
7+
### Table of Contents
8+
9+
- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms)
10+
- [Description](#head.Description)
11+
- [Configuration](#head.Configuration)
12+
- [Methods](#head.Methods)
13+
- [Notifications](#head.Notifications)
14+
15+
<a name="head.Abbreviation,_Acronyms_and_Terms"></a>
16+
# Abbreviation, Acronyms and Terms
17+
18+
[[Refer to this link](overview/aat.md)]
19+
20+
<a name="head.Description"></a>
21+
# Description
22+
23+
The `LifecycleManagerState` this is responsible for maintaining the states of Application.
24+
25+
The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)].
26+
27+
<a name="head.Configuration"></a>
28+
# Configuration
29+
30+
The table below lists configuration options of the plugin.
31+
32+
| Name | Type | Description |
33+
| :-------- | :-------- | :-------- |
34+
| callsign | string | Plugin instance name (default: *org.rdk.LifecycleManager*) |
35+
| classname | string | Class name: *org.rdk.LifecycleManager* |
36+
| locator | string | Library name: *libWPEFrameworkLifecycleManager.so* |
37+
| autostart | boolean | Determines if the plugin shall be started automatically along with the framework |
38+
39+
<a name="head.Methods"></a>
40+
# Methods
41+
42+
The following methods are provided by the org.rdk.LifecycleManager plugin:
43+
44+
org.rdk.LifecycleManager interface methods:
45+
46+
| Method | Description |
47+
| :-------- | :-------- |
48+
| [appReady](#method.appReady) | Response API call to appInitializing API |
49+
| [stateChangeComplete](#method.stateChangeComplete) | Response API call to appLifecycleStateChanged API |
50+
| [closeApp](#method.closeApp) | Close the app |
51+
52+
53+
<a name="method.appReady"></a>
54+
## *appReady [<sup>method</sup>](#head.Methods)*
55+
56+
Response API call to appInitializing API.
57+
58+
### Events
59+
60+
No Events
61+
62+
### Parameters
63+
64+
| Name | Type | Description |
65+
| :-------- | :-------- | :-------- |
66+
| params | object | |
67+
| params.appId | string | The unique identifier of the application to check |
68+
69+
### Result
70+
71+
| Name | Type | Description |
72+
| :-------- | :-------- | :-------- |
73+
| result | null | Returns null on success or an error code string on failure |
74+
75+
### Example
76+
77+
#### Request
78+
79+
```json
80+
{
81+
"jsonrpc": "2.0",
82+
"id": 42,
83+
"method": "org.rdk.LifecycleManager.appReady",
84+
"params": {
85+
"appId": "YouTube"
86+
}
87+
}
88+
```
89+
90+
#### Response
91+
92+
```json
93+
{
94+
"jsonrpc": "2.0",
95+
"id": 42,
96+
"result": null
97+
}
98+
```
99+
100+
<a name="method.stateChangeComplete"></a>
101+
## *stateChangeComplete [<sup>method</sup>](#head.Methods)*
102+
103+
Response API call to appLifecycleStateChanged API.
104+
105+
### Events
106+
107+
No Events
108+
109+
### Parameters
110+
111+
| Name | Type | Description |
112+
| :-------- | :-------- | :-------- |
113+
| params | object | |
114+
| params.appId | string | The unique identifier of the application to check |
115+
| params.stateChangedId | integer | State changed identifier |
116+
| params.success | boolean | Indicates whether the state change was successful |
117+
118+
### Result
119+
120+
| Name | Type | Description |
121+
| :-------- | :-------- | :-------- |
122+
| result | null | Returns null on success or an error code string on failure |
123+
124+
### Example
125+
126+
#### Request
127+
128+
```json
129+
{
130+
"jsonrpc": "2.0",
131+
"id": 42,
132+
"method": "org.rdk.LifecycleManager.stateChangeComplete",
133+
"params": {
134+
"appId": "YouTube",
135+
"stateChangedId": 101,
136+
"success": true
137+
}
138+
}
139+
```
140+
141+
#### Response
142+
143+
```json
144+
{
145+
"jsonrpc": "2.0",
146+
"id": 42,
147+
"result": null
148+
}
149+
```
150+
151+
<a name="method.closeApp"></a>
152+
## *closeApp [<sup>method</sup>](#head.Methods)*
153+
154+
Close the app.
155+
156+
### Events
157+
158+
No Events
159+
160+
### Parameters
161+
162+
| Name | Type | Description |
163+
| :-------- | :-------- | :-------- |
164+
| params | object | |
165+
| params.appId | string | The unique identifier of the application to check |
166+
| params.closeReason | string | Possible close reasons of an application (must be one of the following: *USER_EXIT*, *ERROR*, *KILL_AND_RUN*, *KILL_AND_ACTIVATE*) |
167+
168+
### Result
169+
170+
| Name | Type | Description |
171+
| :-------- | :-------- | :-------- |
172+
| result | null | Returns null on success or an error code string on failure |
173+
174+
### Example
175+
176+
#### Request
177+
178+
```json
179+
{
180+
"jsonrpc": "2.0",
181+
"id": 42,
182+
"method": "org.rdk.LifecycleManager.closeApp",
183+
"params": {
184+
"appId": "YouTube",
185+
"closeReason": "USER_EXIT"
186+
}
187+
}
188+
```
189+
190+
#### Response
191+
192+
```json
193+
{
194+
"jsonrpc": "2.0",
195+
"id": 42,
196+
"result": null
197+
}
198+
```
199+
200+
<a name="head.Notifications"></a>
201+
# Notifications
202+
203+
Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification.
204+
205+
The following events are provided by the org.rdk.LifecycleManager plugin:
206+
207+
org.rdk.LifecycleManager interface events:
208+
209+
| Event | Description |
210+
| :-------- | :-------- |
211+
| [onAppLifecycleStateChanged](#event.onAppLifecycleStateChanged) | Triggered when the lifecycle state of an application changes |
212+
213+
214+
<a name="event.onAppLifecycleStateChanged"></a>
215+
## *onAppLifecycleStateChanged [<sup>event</sup>](#head.Notifications)*
216+
217+
Triggered when the lifecycle state of an application changes.
218+
219+
### Parameters
220+
221+
| Name | Type | Description |
222+
| :-------- | :-------- | :-------- |
223+
| params | object | |
224+
| params.appId | string | The unique identifier of the application to check |
225+
| params.appInstanceId | string | Instance identifier of the application |
226+
| params.newState | string | (must be one of the following: *UNLOADED*, *LOADING*, *INITIALIZING*, *PAUSED*, *ACTIVE*, *SUSPENDED*, *HIBERNATED*, *TERMINATING*) |
227+
| params.oldState | string | (must be one of the following: *UNLOADED*, *LOADING*, *INITIALIZING*, *PAUSED*, *ACTIVE*, *SUSPENDED*, *HIBERNATED*, *TERMINATING*) |
228+
| params?.navigationIntent | string | <sup>*(optional)*</sup> Intent string for navigation or state transition |
229+
230+
### Example
231+
232+
```json
233+
{
234+
"jsonrpc": "2.0",
235+
"method": "client.events.onAppLifecycleStateChanged",
236+
"params": {
237+
"appId": "YouTube",
238+
"appInstanceId": "80df148e-b52e-4c0f-8964-0de4c090426f",
239+
"newState": "ACTIVE",
240+
"oldState": "UNLOADED",
241+
"navigationIntent": "launch_home"
242+
}
243+
}
244+
```
245+
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/rdkcentral/entservices-apis/refs/heads/main/tools/md_generator/json2md/schemas/interface.schema.json",
3+
"jsonrpc": "2.0",
4+
"info": {
5+
"title": "LifecycleManagerState API",
6+
"class": "org.rdk.LifecycleManager",
7+
"description": "The `LifecycleManagerState` this is responsible for maintaining the states of Application."
8+
},
9+
"common": {
10+
"$ref": "../common/common.json"
11+
},
12+
"definitions": {
13+
"appId": {
14+
"type": "string",
15+
"description": "The unique identifier of the application to check.",
16+
"example": "YouTube"
17+
},
18+
"appInstanceId": {
19+
"type": "string",
20+
"description": "Instance identifier of the application",
21+
"example": "80df148e-b52e-4c0f-8964-0de4c090426f"
22+
},
23+
"navigationIntent": {
24+
"type": "string",
25+
"description": "Intent string for navigation or state transition.",
26+
"example": "launch_home"
27+
},
28+
"AppCloseReason": {
29+
"summary": "Possible close reasons of an application",
30+
"type": "string",
31+
"enum": [
32+
"USER_EXIT",
33+
"ERROR",
34+
"KILL_AND_RUN",
35+
"KILL_AND_ACTIVATE"
36+
]
37+
}
38+
},
39+
"methods": {
40+
"appReady": {
41+
"summary": "Response API call to appInitializing API",
42+
"params": {
43+
"type": "object",
44+
"properties": {
45+
"appId": {
46+
"$ref": "#/definitions/appId"
47+
}
48+
},
49+
"required": ["appId"]
50+
},
51+
"result": {
52+
"description": "Returns null on success or an error code string on failure.",
53+
"$ref": "#/common/results/void"
54+
}
55+
},
56+
"stateChangeComplete": {
57+
"summary": "Response API call to appLifecycleStateChanged API",
58+
"params": {
59+
"type": "object",
60+
"properties": {
61+
"appId": {
62+
"$ref": "#/definitions/appId"
63+
},
64+
"stateChangedId": {
65+
"type": "integer",
66+
"summary": "State changed identifier",
67+
"example": 101
68+
},
69+
"success": {
70+
"type": "boolean",
71+
"summary": "Indicates whether the state change was successful",
72+
"example": true
73+
}
74+
},
75+
"required": ["appId", "stateChangedId", "success"]
76+
},
77+
"result": {
78+
"description": "Returns null on success or an error code string on failure.",
79+
"$ref": "#/common/results/void"
80+
}
81+
},
82+
"closeApp": {
83+
"summary": "Close the app",
84+
"params": {
85+
"type": "object",
86+
"properties": {
87+
"appId": {
88+
"$ref": "#/definitions/appId"
89+
},
90+
"closeReason": {
91+
"$ref": "#/definitions/AppCloseReason"
92+
}
93+
},
94+
"required": ["appId", "closeReason"]
95+
},
96+
"result": {
97+
"description": "Returns null on success or an error code string on failure.",
98+
"$ref": "#/common/results/void"
99+
}
100+
}
101+
},
102+
"events": {
103+
"onAppLifecycleStateChanged": {
104+
"summary": "Triggered when the lifecycle state of an application changes.",
105+
"params": {
106+
"type": "object",
107+
"properties": {
108+
"appId": { "$ref": "#/definitions/appId" },
109+
"appInstanceId": { "$ref": "#/definitions/appInstanceId" },
110+
"newState": {
111+
"type": "string",
112+
"enum": [
113+
"UNLOADED",
114+
"LOADING",
115+
"INITIALIZING",
116+
"PAUSED",
117+
"ACTIVE",
118+
"SUSPENDED",
119+
"HIBERNATED",
120+
"TERMINATING"
121+
],
122+
"example": "ACTIVE"
123+
},
124+
"oldState": {
125+
"type": "string",
126+
"enum": [
127+
"UNLOADED",
128+
"LOADING",
129+
"INITIALIZING",
130+
"PAUSED",
131+
"ACTIVE",
132+
"SUSPENDED",
133+
"HIBERNATED",
134+
"TERMINATING"
135+
],
136+
"example": "UNLOADED"
137+
},
138+
"navigationIntent": { "$ref": "#/definitions/navigationIntent" }
139+
},
140+
"required": ["appId", "appInstanceId", "oldState", "newState"]
141+
}
142+
}
143+
}
144+
}
145+

0 commit comments

Comments
 (0)