From 92be0190fef3405ff0e0c141e01d50e60684b944 Mon Sep 17 00:00:00 2001 From: "ester.zhou" Date: Tue, 14 Mar 2023 16:25:17 +0800 Subject: [PATCH] Update doc (15738) Signed-off-by: ester.zhou --- .../reference/apis/js-apis-screen-lock.md | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-screen-lock.md b/en/application-dev/reference/apis/js-apis-screen-lock.md index f7f2a55164..925d53a00a 100644 --- a/en/application-dev/reference/apis/js-apis-screen-lock.md +++ b/en/application-dev/reference/apis/js-apis-screen-lock.md @@ -1,4 +1,4 @@ -# @ohos.screenLock (Screenlock) +# @ohos.screenLock (Screen Lock) The **screenlock** module is a system module in OpenHarmony. It provides APIs for screen lock applications to subscribe to screen lock status changes as well as callbacks for them to receive the results. It also provides APIs for third-party applications to unlock the screen, obtain the screen locked status, and check whether a lock screen password has been set. @@ -12,12 +12,14 @@ The **screenlock** module is a system module in OpenHarmony. It provides APIs fo import screenlock from '@ohos.screenLock'; ``` -## EventType +## EventType9+ Defines the system event type. **System capability**: SystemCapability.MiscServices.ScreenLock +**System API**: This is a system API. + | Event Type | Description | | ------------------ | ------------------------ | | beginWakeUp | Wakeup starts.| @@ -35,15 +37,17 @@ Defines the system event type. | screenlockEnabled | Screen lock is enabled. | | serviceRestart | The screen lock service is restarted. | -## SystemEvent +## SystemEvent9+ Defines the structure of the system event callback. **System capability**: SystemCapability.MiscServices.ScreenLock +**System API**: This is a system API. + | Name | Type | Mandatory| Description | | --------- | ------ | ---- | ------------- | -| eventType | [EventType](#eventtype) | Yes | System event type.| +| eventType | [EventType](#eventtype9) | Yes | System event type.| | params | string | Yes | System event parameters.| ## screenlock.isLocked9+ @@ -236,7 +240,7 @@ Registers a callback for system events related to screen locking. This API can b | Name | Type | Mandatory| Description | | -------- | ------------------------- | ---- | ----------------- | -| callback | Callback\<[SystemEvent](#systemevent)> | Yes | Callback for system events related to screen locking.| +| callback | Callback\<[SystemEvent](#systemevent9)> | Yes | Callback for system events related to screen locking.| **Return value** @@ -266,7 +270,7 @@ try { ## screenlock.sendScreenLockEvent9+ -sendScreenLockEvent(event: string, parameter: number, callback: AsyncCallback<boolean>): void +sendScreenLockEvent(event: String, parameter: number, callback: AsyncCallback<boolean>): void Sends an event to the screen lock service. This API uses an asynchronous callback to return the result. @@ -278,7 +282,7 @@ Sends an event to the screen lock service. This API uses an asynchronous callbac | Name | Type | Mandatory| Description | | --------- | ------------------------ | ---- | -------------------- | -| event | string | Yes | Event type.
- **"unlockScreenResult"**: Screen unlock result.
- **"lockScreenResult"**: Screen lock result.
- **"screenDrawDone"**: Screen drawing is complete.| +| event | String | Yes | Event type.
- **"unlockScreenResult"**: Screen unlock result.
- **"lockScreenResult"**: Screen lock result.
- **"screenDrawDone"**: Screen drawing is complete.| | parameter | number | Yes | Result.
- **0**: The operation is successful. For example, the screen is locked or unlocked successfully.
- **1**, the operation fails. For example, screen locking or unlocking fails.
- **2**: The operation is canceled. For example, screen locking or unlocking is canceled.| | callback | AsyncCallback\ | Yes | Callback used to return the result. The **value** true means that the event is sent successfully, and **false** means the opposite. | @@ -304,7 +308,7 @@ screenlock.sendScreenLockEvent('unlockScreenResult', 0, (err, result) => { ## screenlock.sendScreenLockEvent9+ -sendScreenLockEvent(event: string, parameter: number): Promise<boolean> +sendScreenLockEvent(event: String, parameter: number): Promise<boolean> Sends an event to the screen lock service. This API uses a promise to return the result. @@ -316,7 +320,7 @@ Sends an event to the screen lock service. This API uses a promise to return the | Name | Type | Mandatory| Description | | --------- | ------ | ---- | --------------------------------------- | -| event | string | Yes | Event type.
- **"unlockScreenResult"**: Screen unlock result.
- **"lockScreenResult"**: Screen lock result.
- **"screenDrawDone"**: Screen drawing is complete.| +| event | String | Yes | Event type.
- **"unlockScreenResult"**: Screen unlock result.
- **"lockScreenResult"**: Screen lock result.
- **"screenDrawDone"**: Screen drawing is complete.| | parameter | number | Yes | Result.
- **0**: The operation is successful. For example, the screen is locked or unlocked successfully.
- **1**, the operation fails. For example, screen locking or unlocking fails.
- **2**: The operation is canceled. For example, screen locking or unlocking is canceled.| **Return value** -- GitLab