@@ -34,7 +34,14 @@ Deletes a widget. After this API is called, the application can no longer use th
...
@@ -34,7 +34,14 @@ Deletes a widget. After this API is called, the application can no longer use th
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 202 | The application is not a system application. |
| 16501000 | An internal functional error occurred. |
| 16501001 | The ID of the form to be operated does not exist. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -83,7 +90,14 @@ Deletes a widget. After this API is called, the application can no longer use th
...
@@ -83,7 +90,14 @@ Deletes a widget. After this API is called, the application can no longer use th
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
| 16501001 | The ID of the form to be operated does not exist. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Parameters**
**Parameters**
...
@@ -124,7 +138,14 @@ Releases a widget. After this API is called, the application can no longer use t
...
@@ -124,7 +138,14 @@ Releases a widget. After this API is called, the application can no longer use t
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
| 16501001 | The ID of the form to be operated does not exist. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -166,7 +187,14 @@ Releases a widget. After this API is called, the application can no longer use t
...
@@ -166,7 +187,14 @@ Releases a widget. After this API is called, the application can no longer use t
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
| 16501001 | The ID of the form to be operated does not exist. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -201,7 +229,7 @@ Releases a widget. After this API is called, the application can no longer use t
...
@@ -201,7 +229,7 @@ Releases a widget. After this API is called, the application can no longer use t
| Name | Type | Mandatory| Description |
| Name | Type | Mandatory| Description |
| -------------- | ------ | ---- | ----------- |
| -------------- | ------ | ---- | ----------- |
| formId | string | Yes | Widget ID. |
| formId | string | Yes | Widget ID. |
| isReleaseCache | boolean | No | Whether to release the cache.|
| isReleaseCache | boolean | No | Whether to release the cache. The default value is **false**. |
**Return value**
**Return value**
...
@@ -213,7 +241,14 @@ Releases a widget. After this API is called, the application can no longer use t
...
@@ -213,7 +241,14 @@ Releases a widget. After this API is called, the application can no longer use t
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
| 16501001 | The ID of the form to be operated does not exist. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -254,7 +289,14 @@ Requests a widget update. This API uses an asynchronous callback to return the r
...
@@ -254,7 +289,14 @@ Requests a widget update. This API uses an asynchronous callback to return the r
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
| 16501001 | The ID of the form to be operated does not exist. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -300,7 +342,14 @@ Requests a widget update. This API uses a promise to return the result.
...
@@ -300,7 +342,14 @@ Requests a widget update. This API uses a promise to return the result.
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
| 16501001 | The ID of the form to be operated does not exist. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -342,7 +391,14 @@ Converts a temporary widget to a normal one. This API uses an asynchronous callb
...
@@ -342,7 +391,14 @@ Converts a temporary widget to a normal one. This API uses an asynchronous callb
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16501000 | An internal functional error occurred. |
| 16501001 | The ID of the form to be operated does not exist. |
| 16501002 | The number of forms exceeds upper bound. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -388,7 +444,14 @@ Converts a temporary widget to a normal one. This API uses a promise to return t
...
@@ -388,7 +444,14 @@ Converts a temporary widget to a normal one. This API uses a promise to return t
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16501000 | An internal functional error occurred. |
| 16501001 | The ID of the form to be operated does not exist. |
| 16501002 | The number of forms exceeds upper bound. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -429,7 +492,12 @@ Instructs the widget framework to make a widget visible. After this API is calle
...
@@ -429,7 +492,12 @@ Instructs the widget framework to make a widget visible. After this API is calle
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -475,7 +543,12 @@ Instructs the widget framework to make a widget visible. After this API is calle
...
@@ -475,7 +543,12 @@ Instructs the widget framework to make a widget visible. After this API is calle
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -516,7 +589,12 @@ Instructs the widget framework to make a widget invisible. After this API is cal
...
@@ -516,7 +589,12 @@ Instructs the widget framework to make a widget invisible. After this API is cal
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -562,7 +640,12 @@ Instructs the widget framework to make a widget invisible. After this API is cal
...
@@ -562,7 +640,12 @@ Instructs the widget framework to make a widget invisible. After this API is cal
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -603,7 +686,13 @@ Instructs the widget framework to make a widget updatable. After this API is cal
...
@@ -603,7 +686,13 @@ Instructs the widget framework to make a widget updatable. After this API is cal
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -649,7 +738,13 @@ Instructs the widget framework to make a widget updatable. After this API is cal
...
@@ -649,7 +738,13 @@ Instructs the widget framework to make a widget updatable. After this API is cal
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -690,7 +785,14 @@ Instructs the widget framework to make a widget not updatable. After this API is
...
@@ -690,7 +785,14 @@ Instructs the widget framework to make a widget not updatable. After this API is
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
| 16501001 | The ID of the form to be operated does not exist. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -736,7 +838,14 @@ Instructs the widget framework to make a widget not updatable. After this API is
...
@@ -736,7 +838,14 @@ Instructs the widget framework to make a widget not updatable. After this API is
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
| 16501001 | The ID of the form to be operated does not exist. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -770,6 +879,14 @@ Checks whether the system is ready. This API uses an asynchronous callback to re
...
@@ -770,6 +879,14 @@ Checks whether the system is ready. This API uses an asynchronous callback to re
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| callback | AsyncCallback<void> | Yes| Callback used to return the result. If the check is successful, **error** is undefined; otherwise, **error** is an error object.|
| callback | AsyncCallback<void> | Yes| Callback used to return the result. If the check is successful, **error** is undefined; otherwise, **error** is an error object.|
**Error codes**
| Error Code ID| Error Message|
| -------- | -------- |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
```ts
```ts
...
@@ -800,6 +917,13 @@ Checks whether the system is ready. This API uses a promise to return the result
...
@@ -800,6 +917,13 @@ Checks whether the system is ready. This API uses a promise to return the result
| -------- | -------- |
| -------- | -------- |
| Promise<void> | Promise that returns no value.|
| Promise<void> | Promise that returns no value.|
**Error codes**
| Error Code ID| Error Message|
| -------- | -------- |
| 202 | The application is not a system application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
```ts
```ts
...
@@ -826,6 +950,18 @@ Obtains the widget information provided by all applications on the device. This
...
@@ -826,6 +950,18 @@ Obtains the widget information provided by all applications on the device. This
| 202 | The application is not a system application. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Return value**
**Return value**
| Type | Description |
| Type | Description |
...
@@ -903,7 +1050,13 @@ Obtains the widget information provided by a given application on the device. Th
...
@@ -903,7 +1050,13 @@ Obtains the widget information provided by a given application on the device. Th
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -946,7 +1099,13 @@ Obtains the widget information provided by a given application on the device. Th
...
@@ -946,7 +1099,13 @@ Obtains the widget information provided by a given application on the device. Th
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -982,7 +1141,7 @@ Obtains the widget information provided by a given application on the device. Th
...
@@ -982,7 +1141,7 @@ Obtains the widget information provided by a given application on the device. Th
| Name| Type | Mandatory| Description |
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| bundleName | string | Yes| Bundle name of the application.|
| bundleName | string | Yes| Bundle name of the application.|
| moduleName | string | No| Module name.|
| moduleName | string | No| Module name. By default, no value is passed.|
**Return value**
**Return value**
...
@@ -994,7 +1153,13 @@ Obtains the widget information provided by a given application on the device. Th
...
@@ -994,7 +1153,13 @@ Obtains the widget information provided by a given application on the device. Th
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -1030,6 +1195,18 @@ Deletes invalid widgets from the list. This API uses an asynchronous callback to
...
@@ -1030,6 +1195,18 @@ Deletes invalid widgets from the list. This API uses an asynchronous callback to
| formIds | Array<string> | Yes | List of valid widget IDs.|
| formIds | Array<string> | Yes | List of valid widget IDs.|
| callback | AsyncCallback<number> | Yes| Callback used to return the result. If the invalid widgets are deleted, **error** is undefined and **data** is the number of widgets deleted; otherwise, **error** is an error object.|
| callback | AsyncCallback<number> | Yes| Callback used to return the result. If the invalid widgets are deleted, **error** is undefined and **data** is the number of widgets deleted; otherwise, **error** is an error object.|
**Error codes**
| Error Code ID| Error Message|
| -------- | -------- |
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
```ts
```ts
...
@@ -1071,6 +1248,18 @@ Deletes invalid widgets from the list. This API uses a promise to return the res
...
@@ -1071,6 +1248,18 @@ Deletes invalid widgets from the list. This API uses a promise to return the res
| Promise<number> | Promise used to return the number of widgets deleted.|
| Promise<number> | Promise used to return the number of widgets deleted.|
**Error codes**
| Error Code ID| Error Message|
| -------- | -------- |
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
```ts
```ts
...
@@ -1109,7 +1298,13 @@ Obtains the widget state. This API uses an asynchronous callback to return the r
...
@@ -1109,7 +1298,13 @@ Obtains the widget state. This API uses an asynchronous callback to return the r
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -1166,7 +1361,13 @@ Obtains the widget state. This API uses a promise to return the result.
...
@@ -1166,7 +1361,13 @@ Obtains the widget state. This API uses a promise to return the result.
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -1210,6 +1411,14 @@ Subscribes to widget uninstall events. This API uses an asynchronous callback to
...
@@ -1210,6 +1411,14 @@ Subscribes to widget uninstall events. This API uses an asynchronous callback to
| type | string | Yes | Event type. The value **'formUninstall'** indicates a widget uninstallation event.|
| type | string | Yes | Event type. The value **'formUninstall'** indicates a widget uninstallation event.|
| callback | Callback<string> | Yes| Callback used to return the widget ID.|
| callback | Callback<string> | Yes| Callback used to return the widget ID.|
**Error codes**
| Error Code ID| Error Message|
| -------- | -------- |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
```ts
```ts
...
@@ -1236,6 +1445,14 @@ Unsubscribes from widget uninstall events. This API uses an asynchronous callbac
...
@@ -1236,6 +1445,14 @@ Unsubscribes from widget uninstall events. This API uses an asynchronous callbac
| type | string | Yes | Event type. The value **'formUninstall'** indicates a widget uninstallation event.|
| type | string | Yes | Event type. The value **'formUninstall'** indicates a widget uninstallation event.|
| callback | Callback<string> | No| Callback used to return the widget ID. If it is left unspecified, it indicates the callback for all the events that have been subscribed.<br> The value must be the same as that in **on('formUninstall')**.|
| callback | Callback<string> | No| Callback used to return the widget ID. If it is left unspecified, it indicates the callback for all the events that have been subscribed.<br> The value must be the same as that in **on('formUninstall')**.|
**Error codes**
| Error Code ID| Error Message|
| -------- | -------- |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
```ts
```ts
...
@@ -1269,7 +1486,13 @@ Instructs the widgets to make themselves visible. This API uses an asynchronous
...
@@ -1269,7 +1486,13 @@ Instructs the widgets to make themselves visible. This API uses an asynchronous
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -1316,7 +1539,13 @@ Instructs the widgets to make themselves visible. This API uses a promise to ret
...
@@ -1316,7 +1539,13 @@ Instructs the widgets to make themselves visible. This API uses a promise to ret
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -1358,7 +1587,13 @@ Instructs the widgets to enable or disable updates. This API uses an asynchronou
...
@@ -1358,7 +1587,13 @@ Instructs the widgets to enable or disable updates. This API uses an asynchronou
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -1405,7 +1640,13 @@ Instructs the widgets to enable or disable updates. This API uses a promise to r
...
@@ -1405,7 +1640,13 @@ Instructs the widgets to enable or disable updates. This API uses a promise to r
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16501000 | An internal functional error occurred. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -1446,7 +1687,13 @@ Shares a specified widget with a remote device. This API uses an asynchronous ca
...
@@ -1446,7 +1687,13 @@ Shares a specified widget with a remote device. This API uses an asynchronous ca
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16501000 | An internal functional error occurred. |
| 16501001 | The ID of the form to be operated does not exist. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -1494,7 +1741,13 @@ Shares a specified widget with a remote device. This API uses a promise to retur
...
@@ -1494,7 +1741,13 @@ Shares a specified widget with a remote device. This API uses a promise to retur
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16501000 | An internal functional error occurred. |
| 16501001 | The ID of the form to be operated does not exist. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -1535,9 +1788,14 @@ Notifies that the privacy protection status of the specified widgets changes. Th
...
@@ -1535,9 +1788,14 @@ Notifies that the privacy protection status of the specified widgets changes. Th
@@ -167,7 +187,13 @@ Updates a widget. This API uses a promise to return the result.
...
@@ -167,7 +187,13 @@ Updates a widget. This API uses a promise to return the result.
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. |
| 16501001 | The ID of the form to be operated does not exist. |
| 16501003 | The form can not be operated by the current application. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -204,10 +230,12 @@ Obtains the application's widget information on the device. This API uses an asy
...
@@ -204,10 +230,12 @@ Obtains the application's widget information on the device. This API uses an asy
| callback | AsyncCallback<Array<[formInfo.FormInfo](js-apis-app-form-formInfo.md)>> | Yes| Callback used to return the information obtained.|
| callback | AsyncCallback<Array<[formInfo.FormInfo](js-apis-app-form-formInfo.md)>> | Yes| Callback used to return the information obtained.|
**Error codes**
**Error codes**
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
| filter | [formInfo.FormInfoFilter](js-apis-app-form-formInfo.md#forminfofilter) | No| Filter criterion. By default, no value is passed, indicating that no filtering is performed.|
**Return value**
**Return value**
...
@@ -297,7 +328,10 @@ Obtains the application's widget information on the device. This API uses a prom
...
@@ -297,7 +328,10 @@ Obtains the application's widget information on the device. This API uses a prom
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -343,7 +377,11 @@ Requests to publish a widget carrying data to the widget host. This API uses an
...
@@ -343,7 +377,11 @@ Requests to publish a widget carrying data to the widget host. This API uses an
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
| want | [Want](js-apis-application-want.md) | Yes | Request used for publishing. The following fields must be included:<br>Information about the target widget.<br>**abilityName**: ability of the target widget.<br>**parameters**:<br>'ohos.extra.param.key.form_dimension'<br>'ohos.extra.param.key.form_name'<br>'ohos.extra.param.key.module_name' |
| want | [Want](js-apis-application-want.md) | Yes | Request used for publishing. The following fields must be included:<br>Information about the target widget.<br>**abilityName**: ability of the target widget.<br>**parameters**:<br>'ohos.extra.param.key.form_dimension'<br>'ohos.extra.param.key.form_name'<br>'ohos.extra.param.key.module_name' |
| formBindingData | [formBindingData.FormBindingData](js-apis-app-form-formBindingData.md#formbindingdata) | No | Data used for creating the widget. |
| formBindingData | [formBindingData.FormBindingData](js-apis-app-form-formBindingData.md#formbindingdata) | No | Data used for creating the widget. By default, no value is passed, indicating that no data is provided. |
**Return value**
**Return value**
...
@@ -451,7 +493,11 @@ Requests to publish a widget to the widget host. This API uses a promise to retu
...
@@ -451,7 +493,11 @@ Requests to publish a widget to the widget host. This API uses a promise to retu
| Error Code ID| Error Message|
| Error Code ID| Error Message|
| -------- | -------- |
| -------- | -------- |
| 401 | Incorrect input parameter.|
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
**Example**
**Example**
...
@@ -494,6 +540,16 @@ Checks whether a widget can be published to the widget host. This API uses an as
...
@@ -494,6 +540,16 @@ Checks whether a widget can be published to the widget host. This API uses an as
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| callback | AsyncCallback<boolean> | Yes| Callback used to return whether the widget can be published to the widget host.|
| callback | AsyncCallback<boolean> | Yes| Callback used to return whether the widget can be published to the widget host.|
**Error codes**
| Error Code ID| Error Message|
| -------- | -------- |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16501000 | An internal functional error occurred. |
|For details about the error codes, see [Form Error Codes](../errorcodes/errorcode-form.md).|
| labelId | string | Yes | No | ID of the application label. |
| labelId | string | Yes | No | ID of the application label. |
| icon | string | Yes | No | Application icon. |
| icon | string | Yes | No | Application icon. |
| iconId | string | Yes | No | ID of the application icon. |
| iconId | string | Yes | No | ID of the application icon. |
| process | string | Yes | No | Process in which the application runs. If this parameter is not set, the bundle name is used. |
| process | string | Yes | No | Process in which the application runs. If this parameter is not set, the bundle name is used. |
| supportedModes | number | Yes | No | Modes supported by the application. Currently, only the **drive** mode is defined. This attribute applies only to telematics devices. |
| supportedModes | number | Yes | No | Modes supported by the application. Currently, only the **drive** mode is defined. This attribute applies only to telematics devices.|
| moduleSourceDirs | Array\<string> | Yes | No | Relative paths for storing application resources. |
| moduleSourceDirs | Array\<string> | Yes | No | Relative paths for storing application resources. Do not access resource files by concatenating paths. Use the [resourceManager API](js-apis-resource-manager.md) instead. |
| permissions | Array\<string> | Yes | No | Permissions required for accessing the application.<br>The value is obtained by passing in GET_APPLICATION_INFO_WITH_PERMISSION to [bundle.getApplicationInfo](js-apis-Bundle.md#bundlegetapplicationinfodeprecated). |
| permissions | Array\<string> | Yes | No | Permissions required for accessing the application.<br>The value is obtained by passing in GET_APPLICATION_INFO_WITH_PERMISSION to [bundle.getApplicationInfo](js-apis-Bundle.md#bundlegetapplicationinfodeprecated).|
| entryDir | string | Yes | No | Path for storing application files. |
| entryDir | string | Yes | No | Path for storing application files. Do not access resource files by concatenating paths. Use the [resourceManager API](js-apis-resource-manager.md) instead. |
| codePath<sup>8+</sup> | string | Yes | No | Installation directory of the application. |
| codePath<sup>8+</sup> | string | Yes | No | Installation directory of the application. Do not access resource files by concatenating paths. Use the [resourceManager API](js-apis-resource-manager.md) instead. |
| metaData<sup>8+</sup> | Map\<string, Array\<[CustomizeData](js-apis-bundle-CustomizeData.md)>> | Yes | No | Custom metadata of the application.<br>The value is obtained by passing in GET_APPLICATION_INFO_WITH_METADATA to [bundle.getApplicationInfo](js-apis-Bundle.md#bundlegetapplicationinfodeprecated). |
| metaData<sup>8+</sup> | Map\<string, Array\<[CustomizeData](js-apis-bundle-CustomizeData.md)>> | Yes | No | Custom metadata of the application.<br>The value is obtained by passing in GET_APPLICATION_INFO_WITH_METADATA to [bundle.getApplicationInfo](js-apis-Bundle.md#bundlegetapplicationinfodeprecated).|
| removable<sup>8+</sup> | boolean | Yes | No | Whether the application is removable. |
| removable<sup>8+</sup> | boolean | Yes | No | Whether the application is removable. |
| accessTokenId<sup>8+</sup> | number | Yes | No | Access token ID of the application. |
| accessTokenId<sup>8+</sup> | number | Yes | No | Access token ID of the application. |
| uid<sup>8+</sup> | number | Yes | No | UID of the application. |
| uid<sup>8+</sup> | number | Yes | No | UID of the application. |
| entityType<sup>8+</sup> | string | Yes | No | Category of the application, which can be **game**, **media**, **communication**, **news**, **travel**, **utility**, **shopping**, **education**, **kids**, **business**, and **photography**.|
| moduleSourceDir | string | Yes | No | Installation directory. Do not access resource files by concatenating paths. Use the [resourceManager API](js-apis-resource-manager.md) instead.|
@@ -9,6 +9,12 @@ You can use the APIs of this module to start FormExtensionAbilities.
...
@@ -9,6 +9,12 @@ You can use the APIs of this module to start FormExtensionAbilities.
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> The APIs of this module can be used only in the stage model.
> The APIs of this module can be used only in the stage model.
## Modules to Import
```ts
importcommonfrom'@ohos.app.ability.common';
```
## Usage
## Usage
Before using the **ServiceExtensionContext** module, you must first obtain a **FormExtensionAbility** instance.
Before using the **ServiceExtensionContext** module, you must first obtain a **FormExtensionAbility** instance.
...
@@ -41,6 +47,18 @@ Starts an ability. This API uses an asynchronous callback to return the result.
...
@@ -41,6 +47,18 @@ Starts an ability. This API uses an asynchronous callback to return the result.