From 3ff4e2ee39fc42eeb6a06f707b642a5d6d01ccbd Mon Sep 17 00:00:00 2001 From: Gloria Date: Fri, 25 Nov 2022 09:45:53 +0800 Subject: [PATCH] Update docs against 9969 Signed-off-by: wusongqing --- .../apis/js-apis-application-shellCmdResult.md | 14 +++++++------- .../reference/apis/js-apis-processrunninginfo.md | 8 +++++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-application-shellCmdResult.md b/en/application-dev/reference/apis/js-apis-application-shellCmdResult.md index 9c47b27f11..7f9e03d201 100644 --- a/en/application-dev/reference/apis/js-apis-application-shellCmdResult.md +++ b/en/application-dev/reference/apis/js-apis-application-shellCmdResult.md @@ -8,17 +8,17 @@ The **ShellCmdResult** module provides the shell command execution result. ## Usage -The result is obtained by calling **executeShellCommand** in **abilityDelegator**. +The result is obtained by calling [executeShellCommand](js-apis-application-abilityDelegator.md#executeshellcommand) in **abilityDelegator**. ```js -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -var abilityDelegator; -var cmd = "cmd"; -var timeout = 100; +import AbilityDelegatorRegistry from "@ohos.application.abilityDelegatorRegistry"; +let abilityDelegator; +let cmd = "cmd"; abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.executeShellCommand(cmd, timeout).then((data : any) => { - console.info("executeShellCommand promise"); +abilityDelegator.executeShellCommand(cmd, (err: any, data: any) => { + console.info("executeShellCommand callback, failed: ", err); + console.info("executeShellCommand callback, success: ", data); }); ``` diff --git a/en/application-dev/reference/apis/js-apis-processrunninginfo.md b/en/application-dev/reference/apis/js-apis-processrunninginfo.md index f080324569..dfed42e70b 100644 --- a/en/application-dev/reference/apis/js-apis-processrunninginfo.md +++ b/en/application-dev/reference/apis/js-apis-processrunninginfo.md @@ -8,12 +8,14 @@ The **ProcessRunningInfo** module provides process running information. ## Usage -The process running information is obtained through an **appManager** instance. +The process running information is obtained by using [getProcessRunningInfos](js-apis-appmanager.md#appmanagergetprocessrunninginfosdeprecated) in **appManager**. ```js import appManager from '@ohos.application.appManager'; -appManager.getProcessRunningInfos((error,data) => { - console.log("getProcessRunningInfos error: " + error.code + " data: " + JSON.stringify(data)); +app.getProcessRunningInfos().then((data) => { + console.log('success:' + JSON.stringify(data)); +}).catch((error) => { + console.log('failed:' + JSON.stringify(error)); }); ``` -- GitLab