| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. The value **true** means that the screen is unlocked successfully, and **false** means the opposite.|
| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. The value **true** means that the screen is unlocked successfully, and **false** means the opposite.|
**Error codes**
For details about the error codes, see [Screen Lock Management Error Codes](../errorcodes/errorcode-screenlock.md).
| Promise<boolean> | Promise used to return the result. The value **true** means that the screen is unlocked successfully, and **false** means the opposite.|
| Promise<boolean> | Promise used to return the result. The value **true** means that the screen is unlocked successfully, and **false** means the opposite.|
**Error codes**
For details about the error codes, see [Screen Lock Management Error Codes](../errorcodes/errorcode-screenlock.md).
| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. The value **true** means that the screen is locked successfully, and **false** means the opposite.|
| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. The value **true** means that the screen is locked successfully, and **false** means the opposite.|
**Error codes**
For details about the error codes, see [Screen Lock Management Error Codes](../errorcodes/errorcode-screenlock.md).
| Promise<boolean> | Promise used to return the result. The value **true** means that the screen is locked successfully, and **false** means the opposite.|
| Promise<boolean> | Promise used to return the result. The value **true** means that the screen is locked successfully, and **false** means the opposite.|
**Error codes**
For details about the error codes, see [Screen Lock Management Error Codes](../errorcodes/errorcode-screenlock.md).
| 13200002 | the screenlock management service is abnormal. |
**Example**
**Example**
...
@@ -234,6 +272,13 @@ Sends an event to the screen lock service. This API uses an asynchronous callbac
...
@@ -234,6 +272,13 @@ Sends an event to the screen lock service. This API uses an asynchronous callbac
| parameter | number | Yes | Result.<br>- **0**: The operation is successful. For example, the screen is locked or unlocked successfully.<br>- **1**, the operation fails. For example, screen locking or unlocking fails.<br>- **2**: The operation is canceled. For example, screen locking or unlocking is canceled.|
| parameter | number | Yes | Result.<br>- **0**: The operation is successful. For example, the screen is locked or unlocked successfully.<br>- **1**, the operation fails. For example, screen locking or unlocking fails.<br>- **2**: The operation is canceled. For example, screen locking or unlocking is canceled.|
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. The **value** true means that the event is sent successfully, and **false** means the opposite. |
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. The **value** true means that the event is sent successfully, and **false** means the opposite. |
**Error codes**
For details about the error codes, see [Screen Lock Management Error Codes](../errorcodes/errorcode-screenlock.md).
| Promise\<boolean> | Promise used to return the result. The **value** true means that the event is sent successfully, and **false** means the opposite.|
| Promise\<boolean> | Promise used to return the result. The **value** true means that the event is sent successfully, and **false** means the opposite.|
**Error codes**
For details about the error codes, see [Screen Lock Management Error Codes](../errorcodes/errorcode-screenlock.md).