From 8c6ee1d2a1c3c37260e6f3a4a5064b4a403a1fad Mon Sep 17 00:00:00 2001 From: liangjunhao Date: Mon, 26 Jun 2023 14:30:20 +0000 Subject: [PATCH] docs: add isStandby Signed-off-by: liangjunhao --- .../reference/apis/js-apis-power.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/zh-cn/application-dev/reference/apis/js-apis-power.md b/zh-cn/application-dev/reference/apis/js-apis-power.md index 584df2eb86..176a4548a2 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-power.md +++ b/zh-cn/application-dev/reference/apis/js-apis-power.md @@ -296,6 +296,39 @@ power.setPowerMode(power.DevicePowerMode.MODE_PERFORMANCE) }); ``` +## power.isStandby10+ + +isStandby(): boolean + +检测当前设备是否进入待机低功耗续航模式。 + +**系统能力:** SystemCapability.PowerManager.PowerManager.Core + +**返回值:** + +| 类型 | 说明 | +| ------------------- | -------------------------------------- | +| boolean | 进入待机模式返回true,否则返回false。 | + +**错误码:** + +以下错误码的详细介绍请参见[系统电源管理错误码](../errorcodes/errorcode-power.md)。 + +| 错误码ID | 错误信息 | +|---------|---------| +| 4900101 | If connecting to the service failed. | + +**示例:** + +```js +try { + var isStandby = power.isStandby(); + console.info('device is in standby: ' + isStandby); +} catch(err) { + console.error('check isStandby failed, err: ' + err); +} +``` + ## power.rebootDevice(deprecated) rebootDevice(reason: string): void -- GitLab