未验证 提交 5e296eb1 编写于 作者: Z zengyawen 提交者: Gitee

update zh-cn/application-dev/reference/apis/js-apis-runninglock.md.

Signed-off-by: Nzengyawen <zengyawen1@huawei.com>
上级 02b1cc54
...@@ -9,19 +9,16 @@ ...@@ -9,19 +9,16 @@
## 导入模块 ## 导入模块
``` ```
import runninglock from '@ohos.runningLock'; import runningLock from '@ohos.runningLock';
``` ```
## 系统能力
SystemCapability.PowerManager.PowerManager.Core
## RunningLockType ## RunningLockType
RunningLock锁的类型。 RunningLock锁的类型。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.PowerManager.PowerManager.Core
| 名称 | 默认值 | 描述 | | 名称 | 默认值 | 描述 |
| ------------------------ | ---- | ------------------- | | ------------------------ | ---- | ------------------- |
| BACKGROUND | 1 | 阻止系统休眠的锁。 | | BACKGROUND | 1 | 阻止系统休眠的锁。 |
...@@ -34,6 +31,8 @@ isRunningLockTypeSupported(type: RunningLockType, callback: AsyncCallback&lt;boo ...@@ -34,6 +31,8 @@ isRunningLockTypeSupported(type: RunningLockType, callback: AsyncCallback&lt;boo
查询系统是否支持该类型的锁。 查询系统是否支持该类型的锁。
**系统能力:** SystemCapability.PowerManager.PowerManager.Core
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
...@@ -60,6 +59,8 @@ isRunningLockTypeSupported(type: RunningLockType): Promise&lt;boolean&gt; ...@@ -60,6 +59,8 @@ isRunningLockTypeSupported(type: RunningLockType): Promise&lt;boolean&gt;
查询系统是否支持该类型的锁。 查询系统是否支持该类型的锁。
**系统能力:** SystemCapability.PowerManager.PowerManager.Core
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
...@@ -91,7 +92,9 @@ createRunningLock(name: string, type: RunningLockType, callback: AsyncCallback&l ...@@ -91,7 +92,9 @@ createRunningLock(name: string, type: RunningLockType, callback: AsyncCallback&l
创建RunningLock锁。 创建RunningLock锁。
**需要权限:**ohos.permission.RUNNING_LOCK **系统能力:** SystemCapability.PowerManager.PowerManager.Core
**需要权限:** ohos.permission.RUNNING_LOCK
**参数:** **参数:**
...@@ -124,7 +127,9 @@ createRunningLock(name: string, type: RunningLockType): Promise&lt;RunningLock&g ...@@ -124,7 +127,9 @@ createRunningLock(name: string, type: RunningLockType): Promise&lt;RunningLock&g
创建Runninglock锁。 创建Runninglock锁。
**需要权限:**ohos.permission.RUNNING_LOCK **系统能力:** SystemCapability.PowerManager.PowerManager.Core
**需要权限:** ohos.permission.RUNNING_LOCK
**参数:** **参数:**
...@@ -163,6 +168,8 @@ lock(timeout: number): void ...@@ -163,6 +168,8 @@ lock(timeout: number): void
锁定和持有RunningLock。 锁定和持有RunningLock。
**系统能力:** SystemCapability.PowerManager.PowerManager.Core
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
...@@ -189,6 +196,8 @@ unlock(): void ...@@ -189,6 +196,8 @@ unlock(): void
释放Runninglock锁。 释放Runninglock锁。
**系统能力:** SystemCapability.PowerManager.PowerManager.Core
**示例:** **示例:**
``` ```
...@@ -209,6 +218,8 @@ isUsed(): boolean ...@@ -209,6 +218,8 @@ isUsed(): boolean
查询当前Runninglock是持有状态还是释放状态。 查询当前Runninglock是持有状态还是释放状态。
**系统能力:** SystemCapability.PowerManager.PowerManager.Core
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| ------- | ------------------------------------- | | ------- | ------------------------------------- |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册