diff --git a/api/@ohos.power.d.ts b/api/@ohos.power.d.ts index 5f59da72f5ad0406eb6b09f4d603f6dee2447a9b..3b7db0d372d0086ee9a1aaafdb2ad92fc3cb5b55 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 @@ -25,9 +25,10 @@ declare namespace power { /** * Shuts down the system. * - *

This method requires the ohos.permission.SHUTDOWN permission. + *

This method requires the ohos.permission.REBOOT permission. * * @param reason Indicates the shutdown reason. + * @permission ohos.permission.REBOOT * @systemapi * @since 7 */ @@ -40,6 +41,7 @@ declare namespace power { * * @param reason Indicates the restart reason. For example, "updater" indicates entering the updater mode * after the restart. If the parameter is not specified, the system enters the normal mode after the restart. + * @permission ohos.permission.REBOOT * @since 7 */ function rebootDevice(reason: string): 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;