From 90540af2b99af3becb865adefa42573ef3e34575 Mon Sep 17 00:00:00 2001 From: ShiJie Date: Thu, 24 Mar 2022 21:56:24 -0700 Subject: [PATCH] fixed edc6869 from https://gitee.com/one_produced_two/interface_sdk-js/pulls/1387 fix: Add permission description Signed-off-by: ShiJie Change-Id: Ib9240e1d9b67bd2e4ae37b8bf7330375fc53a9cb --- api/@ohos.power.d.ts | 6 ++++-- api/@ohos.runninglock.d.ts | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/api/@ohos.power.d.ts b/api/@ohos.power.d.ts index 5f59da72f5..3b7db0d372 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 1fddf45940..9f9c4b4979 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; -- Gitee