diff --git a/zh-cn/application-dev/reference/apis/js-apis-runninglock.md b/zh-cn/application-dev/reference/apis/js-apis-runninglock.md index f26db121c4b48c58ef520d88fc25a3eae726c123..df65e342c82b8c2d8a31229a7f92ce88134b207d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-runninglock.md +++ b/zh-cn/application-dev/reference/apis/js-apis-runninglock.md @@ -9,19 +9,16 @@ ## 导入模块 ``` -import runninglock from '@ohos.runningLock'; +import runningLock from '@ohos.runningLock'; ``` -## 系统能力 - -SystemCapability.PowerManager.PowerManager.Core - - ## RunningLockType RunningLock锁的类型。 +**系统能力:** 以下各项对应的系统能力均为SystemCapability.PowerManager.PowerManager.Core + | 名称 | 默认值 | 描述 | | ------------------------ | ---- | ------------------- | | BACKGROUND | 1 | 阻止系统休眠的锁。 | @@ -34,6 +31,8 @@ isRunningLockTypeSupported(type: RunningLockType, callback: AsyncCallback<boo 查询系统是否支持该类型的锁。 +**系统能力:** SystemCapability.PowerManager.PowerManager.Core + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -60,6 +59,8 @@ isRunningLockTypeSupported(type: RunningLockType): Promise<boolean> 查询系统是否支持该类型的锁。 +**系统能力:** SystemCapability.PowerManager.PowerManager.Core + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -91,7 +92,9 @@ createRunningLock(name: string, type: RunningLockType, callback: AsyncCallback&l 创建RunningLock锁。 -**需要权限:**ohos.permission.RUNNING_LOCK +**系统能力:** SystemCapability.PowerManager.PowerManager.Core + +**需要权限:** ohos.permission.RUNNING_LOCK **参数:** @@ -124,7 +127,9 @@ createRunningLock(name: string, type: RunningLockType): Promise<RunningLock&g 创建Runninglock锁。 -**需要权限:**ohos.permission.RUNNING_LOCK +**系统能力:** SystemCapability.PowerManager.PowerManager.Core + +**需要权限:** ohos.permission.RUNNING_LOCK **参数:** @@ -163,6 +168,8 @@ lock(timeout: number): void 锁定和持有RunningLock。 +**系统能力:** SystemCapability.PowerManager.PowerManager.Core + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -189,6 +196,8 @@ unlock(): void 释放Runninglock锁。 +**系统能力:** SystemCapability.PowerManager.PowerManager.Core + **示例:** ``` @@ -209,6 +218,8 @@ isUsed(): boolean 查询当前Runninglock是持有状态还是释放状态。 +**系统能力:** SystemCapability.PowerManager.PowerManager.Core + **返回值:** | 类型 | 说明 | | ------- | ------------------------------------- |