diff --git a/api/@ohos.power.d.ts b/api/@ohos.power.d.ts index 544e6873bb91587085fdcfd45cb17bbdb46effdc..b4d62021b5c44333d3a1266b6d20a660341c52b4 100644 --- a/api/@ohos.power.d.ts +++ b/api/@ohos.power.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -28,6 +28,7 @@ declare namespace power { *

This method requires the ohos.permission.REBOOT permission. * * @param reason Indicates the shutdown reason. + * @permission ohos.permission.REBOOT * @systemapi * @since 7 */ @@ -48,6 +49,7 @@ declare namespace power { * Checks whether the screen of a device is on or off. * * @return Returns true if the screen is on; returns false otherwise. + * @permission ohos.permission.REBOOT * @since 7 */ function isScreenOn(callback: AsyncCallback): void; diff --git a/api/@ohos.runninglock.d.ts b/api/@ohos.runninglock.d.ts index 1fddf45940ebfb69c694249e1053b6e22e0b4f97..9f9c4b49790d90158e8bf55ac44cdb792e13b883 100644 --- a/api/@ohos.runninglock.d.ts +++ b/api/@ohos.runninglock.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -31,9 +31,11 @@ declare namespace runningLock { class RunningLock { /** * Prevents the system from hibernating and sets the lock duration. + * This method requires the ohos.permission.RUNNING_LOCK permission. * * @param timeout Indicates the lock duration (ms). After the lock duration times out, the lock is automatically * released and the system hibernates if no other {@link RunningLock} is set. + * @permission ohos.permission.RUNNING_LOCK * @since 7 */ lock(timeout: number): void; @@ -48,8 +50,10 @@ declare namespace runningLock { /** * Release the {@link RunningLock} that prevents the system from hibernating. + * This method requires the ohos.permission.RUNNING_LOCK permission. * * @since 7 + * @permission ohos.permission.RUNNING_LOCK */ unlock(): void; } @@ -98,6 +102,7 @@ declare namespace runningLock { * a suffix. * @param type Indicates the {@link RunningLockType}. * @return Returns the {@link RunningLock} object. + * @permission ohos.permission.RUNNING_LOCK * @since 7 */ function createRunningLock(name: string, type: RunningLockType, callback: AsyncCallback): void;