未验证 提交 f36039d4 编写于 作者: O openharmony_ci 提交者: Gitee

!16010 翻译完成 15738:【锁屏】一致性修改

Merge pull request !16010 from ester.zhou/TR-15731
# @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
## EventType<sup>9+</sup>
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
## SystemEvent<sup>9+</sup>
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.isLocked<sup>9+</sup>
......@@ -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.sendScreenLockEvent<sup>9+</sup>
sendScreenLockEvent(event: string, parameter: number, callback: AsyncCallback&lt;boolean&gt;): void
sendScreenLockEvent(event: String, parameter: number, callback: AsyncCallback&lt;boolean&gt;): 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.<br>- **"unlockScreenResult"**: Screen unlock result.<br>- **"lockScreenResult"**: Screen lock result.<br>- **"screenDrawDone"**: Screen drawing is complete.|
| event | String | Yes | Event type.<br>- **"unlockScreenResult"**: Screen unlock result.<br>- **"lockScreenResult"**: Screen lock result.<br>- **"screenDrawDone"**: Screen drawing is complete.|
| 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. |
......@@ -304,7 +308,7 @@ screenlock.sendScreenLockEvent('unlockScreenResult', 0, (err, result) => {
## screenlock.sendScreenLockEvent<sup>9+</sup>
sendScreenLockEvent(event: string, parameter: number): Promise&lt;boolean&gt;
sendScreenLockEvent(event: String, parameter: number): Promise&lt;boolean&gt;
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.<br>- **"unlockScreenResult"**: Screen unlock result.<br>- **"lockScreenResult"**: Screen lock result.<br>- **"screenDrawDone"**: Screen drawing is complete.|
| event | String | Yes | Event type.<br>- **"unlockScreenResult"**: Screen unlock result.<br>- **"lockScreenResult"**: Screen lock result.<br>- **"screenDrawDone"**: Screen drawing is complete.|
| 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.|
**Return value**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册