|
| 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 | + |
0 commit comments