Note
This API has been available since API level 11.
This API has been available since API level 11.
Handles the UX, animations of windows. It manages all system and application input handling.
Provides information about applications surfaces and a limited set of controls for them.
Takes a screenshot of the content that the compositor generates. The content can be either a frame that contains the graphics composition result or an application surface that is being composited.
Note:
Name | Required | Type | Description |
---|---|---|---|
output | Required | String | Indicates the absolute path of the output image file. |
appId | Optional | String | Indicates the id of the application. Note: If not specified, then the entire composited frame will be captured. |
format | Optional | String | Indicates the output image format. Possible values are:
|
displayId | Optional | Number | Indicates the id of display to be captured. |
Name | Required | Type | Description |
---|---|---|---|
output | Optional | String | Indicates the absolute path of output image file. |
resolution | Optional | String | Indicates the resolution of the output image in the form of <width>x<height>. Example: 1920x1080 |
format | Optional | String | Indicates the output image format. Possible values are:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
101 | ERR_MISSING_OUTPUT | The input parameter named "output" is required but it is not passed. |
102 | ERR_INVALID_PATH | Unable to write a file with a given path due to filesystem related errors. (Non-existent base directory or access denied.) |
103 | ERR_NO_SURFACE | No surface exists associated with a given appId. |
104 | ERR_INVALID_FORMAT | No matching format found. Format must be "BMP", "JPG", or "PNG" (Case sensitive). |
105 | ERR_UNABLE_TO_SAVE | Fail to save a file. |
106 | ERR_INVALID_DISPLAY | Invalid display id. |
107 | ERR_HAS_SECURED_CONTENT | Surface to be captured has secure content. |
Example : Without displayId
# luna-send -n 1 luna://com.webos.surfacemanager/captureCompositorOutput '{
"output":"/tmp/test.bmp",
"appId":"com.webos.app.test",
"format":"BMP"
}'
Response:
{
"format":"BMP",
"output":"/tmp/test.bmp",
"resolution":"1920x1080",
"returnValue":true
}
# luna-send -n 1 luna://com.webos.surfacemanager/captureCompositorOutput '{
"output":"/tmp/test.jpg",
"appId":"com.webos.app.test",
"format":"JPG"
}'
Response:
{
"format":"JPG",
"output":"/tmp/test.jpg",
"resolution":"1920x1080",
"returnValue":true
}
# luna-send -n 1 luna://com.webos.surfacemanager/captureCompositorOutput '{
"output":"/tmp/test.png",
"appId":"com.webos.app.test",
"format":"PNG"
}'
Response:
{
"format":"PNG",
"output":"/tmp/test.png",
"resolution":"1920x1080",
"returnValue":true
}
# luna-send -n 1 luna://com.webos.surfacemanager/captureCompositorOutput '{
"output":"/tmp/test.jpg",
"appId":"",
"format":"JPG"
}'
Response:
{
"format":"JPG",
"output":"/tmp/test.jpg",
"resolution":"1920x1080",
"returnValue":true
}
# luna-send -n 1 luna://com.webos.surfacemanager/captureCompositorOutput '{
"output":"/tmp/test.jpg",
"format":"JPG"
}'
Response:
{
"format":"JPG",
"output":"/tmp/test.jpg",
"resolution":"1920x1080",
"returnValue":true
}
# luna-send -n 1 luna://com.webos.surfacemanager/captureCompositorOutput '{
"output":"/tmp/test.bmp",
"appId":"com.webos.app.test"
}'
Response:
{
"format":"BMP",
"output":"/tmp/test.bmp",
"resolution":"1920x1080",
"returnValue":true
}
# luna-send -n 1 luna://com.webos.surfacemanager/captureCompositorOutput '{
"output":"/tmp/test.bmp"
}'
Response:
{
"format":"BMP",
"output":"/tmp/test.bmp",
"resolution":"1920x1080",
"returnValue":true
}
Example : With displayId specified
# luna-send -n 1 luna://com.webos.surfacemanager/captureCompositorOutput '{
"output":"/tmp/test.bmp",
"appId":"com.webos.app.test",
"format":"BMP",
"displayId":0
}'
Response:
{
"format":"BMP",
"output":"/tmp/test.bmp",
"resolution":"1920x1080",
"returnValue":true
}
# luna-send -n 1 luna://com.webos.surfacemanager/captureCompositorOutput '{
"output":"/tmp/test.jpg",
"format":"JPG",
"displayId":1
}'
Response:
{
"format":"JPG",
"output":"/tmp/test.jpg",
"resolution":"1920x1080",
"returnValue":true
}
Close an application's surface with given appId.
In most cases, closing the surface leads the application to quit. But with this method, the compositor doesn't discard its surface item (a container of the surface). It is useful when the compositor wants to keep the application's context from the compositor side even when the application is not running anymore. A typical use case of this method is to reclaim the memory by Memory Manager.
Name | Required | Type | Description |
---|---|---|---|
id | Required | String | Application ID |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean |
|
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details |
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. See the Error Codes Reference of this method for more details. |
Error Code | Error Text | Error Description |
---|---|---|
1 | "APP_ID" is not running | There is no surface item associated with the given appId. |
Example code
# luna-send -n 1 luna://com.webos.surfacemanager/closeByAppId '{"id":"com.webos.app.test"}'
Response:
{
"returnValue": true
}
Gets the status of the app mirroring.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
Name | Required | Type | Description |
---|---|---|---|
mirroringInfo | Required | Object array: mirroringInfo | Indicates the mirroring status of each display. |
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
Note: returnValue is always true. |
Name | Required | Type | Description |
---|---|---|---|
mirroringInfo | Required | Object array: mirroringInfo | Indicates mirroring status of each display. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: returnValue is always true. |
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
Example: Without subscription
# luna-send -n 1 -f luna://com.webos.surfacemanager/getAppMirroring '{}'
Response:
{
"mirroringInfo":[
{
"mirroringStatus":"inactive",
"displayId":0
},
{
"mirroringStatus":"inactive",
"displayId":1
}
],
"returnValue":true
}
Example: With subscription
# luna-send -i -f luna://com.webos.surfacemanager/getAppMirroring '{"subscribe":true}'
Response:
{
"mirroringInfo":[
{
"mirroringStatus":"sender",
"displayId":0
},
{
"mirroringStatus":"receiver",
"displayId":1
}
],
"returnValue":true,
"subscribed":true
}
Provides the list of applications that are currently visible in the foreground.
Note:
Name | Required | Type | Description |
---|---|---|---|
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
Name | Required | Type | Description |
---|---|---|---|
foregroundAppInfo | Required | Object array: foregroundAppInfo | Information about a surface that is shown in the foreground. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: returnValue will always contain true. |
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
Name | Required | Type | Description |
---|---|---|---|
foregroundAppInfo | Required | Object array: foregroundAppInfo | Information about a surface that is shown in the foreground. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: returnValue will always contain true. |
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
Default: false |
Example: Without subscription
# luna-send -n 1 luna://com.webos.surfacemanager/getForegroundAppInfo '{}'
Response:
{
"foregroundAppInfo":[
{
"appId":"com.webos.app.test",
"processId":"6983",
"windowGroup":true,
"windowGroupOwner":true,
"windowGroupOwnerId":"",
"windowId":"",
"windowType":"_WEBOS_WINDOW_TYPE_CARD"
}
],
"returnValue":true
}
Example: With subscription
# luna-send -f -i luna://com.webos.surfacemanager/getForegroundAppInfo '{"subscribe":true}'
Response:
{
"subscribed":true,
"foregroundAppInfo":[
{
"appId":"com.webos.app.test",
"processId":"6983",
"windowGroup":true,
"windowGroupOwner":true,
"windowGroupOwnerId":"",
"windowId":"",
"windowType":"_WEBOS_WINDOW_TYPE_CARD"
}
],
"returnValue":true
}
Example: Window-group response
# luna-send -n 1 -f luna://com.webos.applicationManager/launch '{"id":"com.webos.app.test-windowgroupowner"} '
# luna-send -n 1 -f luna://com.webos.applicationManager/launch '{"id":"com.webos.app.test-windowgroupclient"} '
# luna-send -n 1 -f luna://com.webos.surfacemanager/getForegroundAppInfo '{}'
Response:
{
"foregroundAppInfo":[
{
"windowGroupOwner":true,
"windowId":"",
"appId":"com.webos.app.test-windowgroupowner",
"windowGroupOwnerId":"",
"windowType":"_WEBOS_WINDOW_TYPE_CARD",
"processId":"4668",
"windowGroup":true
},
{
"windowGroupOwner":false,
"windowId":"",
"appId":"com.webos.app.test-windowgroupclient",
"windowGroupOwnerId":"com.webos.app.test-windowgroupowner",
"windowType":"_WEBOS_WINDOW_TYPE_CARD",
"processId":"4750",
"windowGroup":true
}
],
"returnValue":true
}
Starts or stops app mirroring for a given display pair.
Name | Required | Type | Description |
---|---|---|---|
mirror | Required | Boolean | Indicates whether to mirror the app. Possible values are:
|
from | Required | Number | Indicates id of the display from which the app is mirrored. |
to | Required | Number | Indicates id of the display mirrored by the app. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
1 | ERR_INVALID_COMMAND | Missing or invalid parameters |
2 | ERR_NO_APP | No app to mirror |
3 | ERR_INVALID_DISPLAY | Invalid display ID |
4 | ERR_NO_MIRRORING | No mirroring matched to given display IDs |
5 | ERR_ALREADY_MIRRORING | Mirroring is already set for given display ID pair |
6 | ERR_SAME_DISPLAY | Same display IDs are used for pairing |
7 | ERR_MIRRORING_DISABLED | Mirroring disabled for given display ID |
10 | INTERNAL_ERROR | Internal error |
Example code
# luna-send -n 1 -f luna://com.webos.surfacemanager/setAppMirroring '{
"mirror":true,
"from":0,
"to":1
}'
Response:
{
"returnValue":true
}
Example code
# luna-send -n 1 -f luna://com.webos.surfacemanager/setAppMirroring '{
"mirror":false,
"from":0,
"to":1
}'
Response:
{
"returnValue":true
}
Provides information about a surface that is shown in the foreground.
Name | Required | Type | Description |
---|---|---|---|
appId | Required | String | Indicates id of the application associated with the surface. |
windowType | Required | String | Indicates window type associated with the surface. Example: _WEBOS_WINDOW_TYPE_CARD |
processId | Required | String | Indicates process id (PID) of the surface. |
windowId | Required | String | Indicates windowId associated with the surface. Note: windowId will always contain " " (empty string). |
windowGroup | Optional | Boolean | Indicates windowGroup associated with the surface. Note:
|
windowGroupOwner | Optional | Boolean | Indicates if the application is owner/client of a window-group (surface-group). Possible values are:
Note:
|
windowGroupOwnerId | Optional | String | Indicates id of the window-group ( surface-group ) for surface-group-client applications. Note: If the application is surface-group-owner, it will return " " (empty string). |
primary | Optional | Boolean | Whether it is a “main” app as determined by UX policy |
Indicates mirroring status of each display.
Name | Required | Type | Description |
---|---|---|---|
mirroringStatus | Required | String | Indicates status of mirroring. Possible values are:
|
displayId | Required | Number | Indicates the id of the display from which the app is mirrored to/from. |
Contents