Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
6be7a7c2
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
6be7a7c2
编写于
4月 12, 2023
作者:
O
openharmony_ci
提交者:
Gitee
4月 12, 2023
浏览文件
操作
浏览文件
下载
差异文件
!17211 update err
Merge pull request !17211 from xieqiongyang/master
上级
811299e1
dd589186
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
39 addition
and
39 deletion
+39
-39
zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityDelegatorRegistry.md
...ence/apis/js-apis-app-ability-abilityDelegatorRegistry.md
+3
-3
zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityManager.md
...-dev/reference/apis/js-apis-app-ability-abilityManager.md
+6
-6
zh-cn/application-dev/reference/apis/js-apis-app-ability-appManager.md
...tion-dev/reference/apis/js-apis-app-ability-appManager.md
+9
-9
zh-cn/application-dev/reference/apis/js-apis-app-ability-startOptions.md
...on-dev/reference/apis/js-apis-app-ability-startOptions.md
+5
-5
zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityDelegator.md
...erence/apis/js-apis-inner-application-abilityDelegator.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityMonitor.md
...eference/apis/js-apis-inner-application-abilityMonitor.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityRunningInfo.md
...ence/apis/js-apis-inner-application-abilityRunningInfo.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityStageMonitor.md
...nce/apis/js-apis-inner-application-abilityStageMonitor.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-inner-application-appStateData.md
.../reference/apis/js-apis-inner-application-appStateData.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-inner-application-applicationContext.md
...ence/apis/js-apis-inner-application-applicationContext.md
+4
-4
zh-cn/application-dev/reference/apis/js-apis-inner-application-extensionRunningInfo.md
...ce/apis/js-apis-inner-application-extensionRunningInfo.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-inner-application-missionInfo.md
...v/reference/apis/js-apis-inner-application-missionInfo.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-inner-application-missionSnapshot.md
...ference/apis/js-apis-inner-application-missionSnapshot.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-inner-application-processInformation.md
...ence/apis/js-apis-inner-application-processInformation.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-inner-application-shellCmdResult.md
...eference/apis/js-apis-inner-application-shellCmdResult.md
+1
-1
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityDelegatorRegistry.md
浏览文件 @
6be7a7c2
...
...
@@ -53,10 +53,10 @@ let want = {
abilityName
:
'
EntryAbility
'
};
abilityDelegator
.
startAbility
(
want
,
(
err
)
=>
{
if
(
!
err
||
err
.
code
===
0
)
{
console
.
log
(
'
Success start ability.
'
);
}
else
{
if
(
err
)
{
console
.
error
(
'
Failed start ability, error: ${JSON.stringify(err)}
'
);
}
else
{
console
.
log
(
'
Success start ability.
'
);
}
});
```
...
...
zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityManager.md
浏览文件 @
6be7a7c2
...
...
@@ -72,7 +72,7 @@ const config = {
try
{
abilityManager
.
updateConfiguration
(
config
,
(
err
)
=>
{
if
(
err
&&
err
.
code
!==
0
)
{
if
(
err
)
{
console
.
error
(
'
updateConfiguration fail, err: ${JSON.stringify(err)}
'
);
}
else
{
console
.
log
(
'
updateConfiguration success.
'
);
...
...
@@ -170,7 +170,7 @@ import abilityManager from '@ohos.app.ability.abilityManager';
try
{
abilityManager
.
getAbilityRunningInfos
((
err
,
data
)
=>
{
if
(
err
&&
err
.
code
!==
0
)
{
if
(
err
)
{
console
.
error
(
'
getAbilityRunningInfos fail, error: ${JSON.stringify(err)}
'
);
}
else
{
console
.
log
(
'
getAbilityRunningInfos success, data: ${JSON.stringify(data)}
'
);
...
...
@@ -254,8 +254,8 @@ import abilityManager from '@ohos.app.ability.abilityManager';
let
upperLimit
=
10
;
try
{
abilityManager
.
getExtensionRunningInfos
(
upperLimit
,
(
err
,
data
)
=>
{
if
(
err
&&
err
.
code
!==
0
)
{
abilityManager
.
getExtensionRunningInfos
(
upperLimit
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
'
getExtensionRunningInfos fail, err: ${JSON.stringify(err)}
'
);
}
else
{
console
.
log
(
'
getExtensionRunningInfos success, data: ${JSON.stringify(data)}
'
);
...
...
@@ -342,7 +342,7 @@ getTopAbility(callback: AsyncCallback\<ElementName>): void;
import
abilityManager
from
'
@ohos.app.ability.abilityManager
'
;
abilityManager
.
getTopAbility
((
err
,
data
)
=>
{
if
(
err
&&
err
.
code
!==
0
)
{
if
(
err
)
{
console
.
error
(
'
getTopAbility fail, err: ${JSON.stringify(err)}
'
);
}
else
{
console
.
log
(
'
getTopAbility success, data: ${JSON.stringify(data)}
'
);
...
...
@@ -413,7 +413,7 @@ acquireShareData(missionId: number, callback: AsyncCallback<{[key: string]: Obje
import
abilityManager
from
'
@ohos.app.ability.abilityManager
'
;
abilityManager
.
acquireShareData
(
1
,
(
err
,
wantParam
)
=>
{
if
(
err
&&
err
.
code
!==
0
)
{
if
(
err
)
{
console
.
error
(
'
acquireShareData fail, err: ${JSON.stringify(err)}
'
);
}
else
{
console
.
log
(
'
acquireShareData success, data: ${JSON.stringify(data)}
'
);
...
...
zh-cn/application-dev/reference/apis/js-apis-app-ability-appManager.md
浏览文件 @
6be7a7c2
...
...
@@ -40,7 +40,7 @@ static isRunningInStabilityTest(callback: AsyncCallback<boolean>): void
import
appManager
from
'
@ohos.app.ability.appManager
'
;
appManager
.
isRunningInStabilityTest
((
err
,
flag
)
=>
{
if
(
err
&&
err
.
code
!==
0
)
{
if
(
err
)
{
console
.
error
(
'
isRunningInStabilityTest fail, err: ${JSON.stringify(err)}
'
);
}
else
{
console
.
log
(
'
The result of isRunningInStabilityTest is: ${JSON.stringify(flag)}
'
);
...
...
@@ -146,7 +146,7 @@ isRamConstrainedDevice(callback: AsyncCallback\<boolean>): void;
import
appManager
from
'
@ohos.app.ability.appManager
'
;
appManager
.
isRamConstrainedDevice
((
err
,
data
)
=>
{
if
(
err
&&
err
.
code
!==
0
)
{
if
(
err
)
{
console
.
error
(
'
isRamConstrainedDevice fail, err: ${JSON.stringify(err)}
'
);
}
else
{
console
.
log
(
'
The result of isRamConstrainedDevice is: ${JSON.stringify(data)}
'
);
...
...
@@ -216,7 +216,7 @@ getAppMemorySize(callback: AsyncCallback\<number>): void;
import
appManager
from
'
@ohos.app.ability.appManager
'
;
appManager
.
getAppMemorySize
((
err
,
data
)
=>
{
if
(
err
&&
err
.
code
!==
0
)
{
if
(
err
)
{
console
.
error
(
'
getAppMemorySize fail, err: ${JSON.stringify(err)}
'
);
}
else
{
console
.
log
(
'
The size of app memory is: ${JSON.stringify(data)}
'
);
...
...
@@ -290,7 +290,7 @@ getRunningProcessInformation(callback: AsyncCallback\<Array\<ProcessInformation>
import
appManager
from
'
@ohos.app.ability.appManager
'
;
appManager
.
getRunningProcessInformation
((
err
,
data
)
=>
{
if
(
err
&&
err
.
code
!==
0
)
{
if
(
err
)
{
console
.
error
(
'
getRunningProcessInformation fail, err: ${JSON.stringify(err)}
'
);
}
else
{
console
.
log
(
'
The process running information is: ${JSON.stringify(data)}
'
);
...
...
@@ -489,7 +489,7 @@ try {
// 2.注销应用状态监听器
function
unregisterApplicationStateObserverCallback
(
err
)
{
if
(
err
&&
err
.
code
!==
0
)
{
if
(
err
)
{
console
.
error
(
'
unregisterApplicationStateObserverCallback fail, err: ${JSON.stringify(err)}
'
);
}
else
{
console
.
log
(
'
unregisterApplicationStateObserverCallback success.
'
);
...
...
@@ -612,7 +612,7 @@ getForegroundApplications(callback: AsyncCallback\<Array\<AppStateData>>): void;
import
appManager
from
'
@ohos.app.ability.appManager
'
;
function
getForegroundApplicationsCallback
(
err
,
data
)
{
if
(
err
&&
err
.
code
!==
0
)
{
if
(
err
)
{
console
.
error
(
'
getForegroundApplicationsCallback fail, err: ${JSON.stringify(err)}
'
);
}
else
{
console
.
log
(
'
getForegroundApplicationsCallback success, data: ${JSON.stringify(data)}
'
);
...
...
@@ -745,7 +745,7 @@ import appManager from '@ohos.app.ability.appManager';
let
bundleName
=
'
bundleName
'
;
let
accountId
=
0
;
function
killProcessWithAccountCallback
(
err
,
data
)
{
if
(
err
&&
err
.
code
!==
0
)
{
if
(
err
)
{
console
.
error
(
'
killProcessWithAccountCallback fail, err: ${JSON.stringify(err)}
'
);
}
else
{
console
.
log
(
'
killProcessWithAccountCallback success.
'
);
...
...
@@ -788,7 +788,7 @@ import appManager from '@ohos.app.ability.appManager';
let
bundleName
=
'
bundleName
'
;
function
killProcessesByBundleNameCallback
(
err
,
data
)
{
if
(
err
&&
err
.
code
!==
0
)
{
if
(
err
)
{
console
.
error
(
'
killProcessesByBundleNameCallback fail, err: ${JSON.stringify(err)}
'
);
}
else
{
console
.
log
(
'
killProcessesByBundleNameCallback success.
'
);
...
...
@@ -884,7 +884,7 @@ import appManager from '@ohos.app.ability.appManager';
let
bundleName
=
'
bundleName
'
;
function
clearUpApplicationDataCallback
(
err
,
data
)
{
if
(
err
&&
err
.
code
!==
0
)
{
if
(
err
)
{
console
.
error
(
'
clearUpApplicationDataCallback fail, err: ${JSON.stringify(err)}
'
);
}
else
{
console
.
log
(
'
clearUpApplicationDataCallback success.
'
);
...
...
zh-cn/application-dev/reference/apis/js-apis-app-ability-startOptions.md
浏览文件 @
6be7a7c2
...
...
@@ -32,12 +32,12 @@ import StartOptions from '@ohos.app.ability.StartOptions';
try
{
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
if
(
error
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${error.code}, error.message: ${error.message}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
console
.
log
(
'
missions = ${JSON.stringify(missions)}
'
);
console
.
log
(
`size =
${
missions
.
length
}
`
);
console
.
log
(
`missions =
${
JSON
.
stringify
(
missions
)}
`
);
let
id
=
missions
[
0
].
missionId
;
let
startOptions
=
{
...
...
@@ -45,10 +45,10 @@ import StartOptions from '@ohos.app.ability.StartOptions';
displayId
:
0
};
missionManager
.
moveMissionToFront
(
id
,
startOptions
).
then
(()
=>
{
console
.
log
(
'
moveMissionToFront is called
'
);
console
.
log
(
'
moveMissionToFront is called
'
);
});
});
}
catch
(
paramError
)
{
console
.
error
(
'
error: ${paramError.code}, ${paramError.message}
'
);
console
.
error
(
`error:
${
paramError
.
code
}
,
${
paramError
.
message
}
`
);
}
```
zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityDelegator.md
浏览文件 @
6be7a7c2
...
...
@@ -196,7 +196,7 @@ let monitor = {
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
waitAbilityMonitor
(
monitor
,
(
error
:
any
,
data
:
any
)
=>
{
if
(
error
&&
error
.
code
!==
0
)
{
if
(
error
)
{
console
.
error
(
'
waitAbilityMonitor fail, error: ${JSON.stringify(error)}
'
);
}
else
{
console
.
log
(
'
waitAbilityMonitor success, data: ${JSON.stringify(data)}
'
);
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityMonitor.md
浏览文件 @
6be7a7c2
...
...
@@ -45,7 +45,7 @@ let monitor = {
let
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
addAbilityMonitor
(
monitor
,
(
error
:
any
)
=>
{
if
(
error
&&
error
.
code
!==
0
)
{
if
(
error
)
{
console
.
error
(
'
addAbilityMonitor fail, error: ${JSON.stringify(error)}
'
);
}
});
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityRunningInfo.md
浏览文件 @
6be7a7c2
...
...
@@ -31,7 +31,7 @@ AbilityRunningInfo模块提供对Ability运行的相关信息和状态的定义
import
abilitymanager
from
'
@ohos.app.ability.abilityManager
'
;
abilitymanager
.
getAbilityRunningInfos
((
error
,
data
)
=>
{
if
(
error
&&
error
.
code
!==
0
)
{
if
(
error
)
{
console
.
error
(
'
getAbilityRunningInfos fail, error: ${JSON.stringify(error)}
'
);
}
else
{
console
.
log
(
'
getAbilityRunningInfos success, data: ${JSON.stringify(data)}
'
);
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityStageMonitor.md
浏览文件 @
6be7a7c2
...
...
@@ -20,7 +20,7 @@ let monitor = {
let
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
waitAbilityStageMonitor
(
monitor
,
(
error
,
data
)
=>
{
if
(
error
&&
error
.
code
!==
0
)
{
if
(
error
)
{
console
.
error
(
'
waitAbilityStageMonitor fail, error: ${JSON.stringify(error)}
'
);
}
else
{
console
.
log
(
'
waitAbilityStageMonitor success, data: ${JSON.stringify(data)}
'
);
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-appStateData.md
浏览文件 @
6be7a7c2
# AppStateData
# AppStateData
定义应用状态信息,可以通过
[
getForegroundApplications
](
js-apis-app-ability-appManager.md#appmanagergetforegroundapplications
)
获取当前应用的相关信息。
...
...
@@ -19,7 +19,7 @@ import appManager from '@ohos.app.ability.appManager';
function
getForegroundAppInfos
()
{
appManager
.
getForegroundApplications
((
error
,
data
)
=>
{
if
(
error
&&
error
.
code
)
{
if
(
error
)
{
console
.
log
(
'
getForegroundApplications failed, error.code: ${error.code}, error.message: ${error.message}
'
);
return
;
}
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-applicationContext.md
浏览文件 @
6be7a7c2
...
...
@@ -116,7 +116,7 @@ export default class EntryAbility extends UIAbility {
let
applicationContext
=
this
.
context
.
getApplicationContext
();
console
.
log
(
'
stage applicationContext: ${applicationContext}
'
);
applicationContext
.
off
(
'
abilityLifecycle
'
,
lifecycleId
,
(
error
,
data
)
=>
{
if
(
error
&&
error
.
code
!==
0
)
{
if
(
error
)
{
console
.
error
(
'
unregisterAbilityLifecycleCallback fail, err: ${JSON.stringify(error)}
'
);
}
else
{
console
.
log
(
'
unregisterAbilityLifecycleCallback success, data: ${JSON.stringify(data)}
'
);
...
...
@@ -233,7 +233,7 @@ export default class EntryAbility extends UIAbility {
onDestroy
()
{
let
applicationContext
=
this
.
context
.
getApplicationContext
();
applicationContext
.
off
(
'
environment
'
,
callbackId
,
(
error
,
data
)
=>
{
if
(
error
&&
error
.
code
!==
0
)
{
if
(
error
)
{
console
.
error
(
'
unregisterEnvironmentCallback fail, err: ${JSON.stringify(error)}
'
);
}
else
{
console
.
log
(
'
unregisterEnvironmentCallback success, data: ${JSON.stringify(data)}
'
);
...
...
@@ -325,7 +325,7 @@ getRunningProcessInformation(callback: AsyncCallback\<Array\<ProcessInformation>
```
ts
let
applicationContext
=
this
.
context
.
getApplicationContext
();
applicationContext
.
getRunningProcessInformation
((
err
,
data
)
=>
{
if
(
err
.
code
!==
0
)
{
if
(
err
)
{
console
.
error
(
'
getRunningProcessInformation faile, err: ${JSON.stringify(err)}
'
);
}
else
{
console
.
log
(
'
The process running information is: ${JSON.stringify(data)}
'
);
...
...
@@ -373,7 +373,7 @@ killAllProcesses(callback: AsyncCallback\<void\>);
```
ts
let
applicationContext
=
this
.
context
.
getApplicationContext
();
applicationContext
.
killAllProcesses
(
error
=>
{
if
(
error
&&
error
.
code
!==
0
)
{
if
(
error
)
{
console
.
error
(
'
killAllProcesses fail, error: ${JSON.stringify(error)}
'
);
}
});
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-extensionRunningInfo.md
浏览文件 @
6be7a7c2
...
...
@@ -32,7 +32,7 @@ import abilityManager from '@ohos.app.ability.abilityManager';
let
upperLimit
=
1
;
function
getExtensionInfos
()
{
abilityManager
.
getExtensionRunningInfos
(
upperLimit
,
(
error
,
data
)
=>
{
if
(
error
&&
error
.
code
)
{
if
(
error
)
{
console
.
error
(
'
getForegroundApplications failed, error.code: ${error.code}, error.message: ${error.message}
'
);
return
;
}
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-missionInfo.md
浏览文件 @
6be7a7c2
...
...
@@ -23,7 +23,7 @@ import missionManager from '@ohos.app.ability.missionManager';
try
{
missionManager
.
getMissionInfo
(
''
,
1
,
(
error
,
data
)
=>
{
if
(
error
.
code
)
{
if
(
error
)
{
// 处理业务逻辑错误
console
.
error
(
'
getMissionInfo failed, error.code: ${error.code}, error.message: ${error.message}
'
);
return
;
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-missionSnapshot.md
浏览文件 @
6be7a7c2
...
...
@@ -26,7 +26,7 @@
try
{
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
if
(
error
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${error.code}, error.message: ${error.message}
'
);
return
;
}
...
...
@@ -35,7 +35,7 @@
let
id
=
missions
[
0
].
missionId
;
missionManager
.
getMissionSnapShot
(
''
,
id
,
(
err
,
snapshot
)
=>
{
if
(
err
.
code
)
{
if
(
err
)
{
console
.
error
(
'
getMissionInfos failed, err.code: ${err.code}, err.message: ${err.message}
'
);
return
;
}
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-processInformation.md
浏览文件 @
6be7a7c2
...
...
@@ -14,7 +14,7 @@ ProcessInformation模块提供对进程运行信息进行查询的能力。
import
appManager
from
'
@ohos.app.ability.appManager
'
;
appManager
.
getRunningProcessInformation
((
error
,
data
)
=>
{
if
(
error
&&
error
.
code
!==
0
)
{
if
(
error
)
{
console
.
error
(
'
getRunningProcessInformation fail, error: ${JSON.stringify(error)}
'
);
}
else
{
console
.
log
(
'
getRunningProcessInformation success, data: ${JSON.stringify(data)}
'
);
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-shellCmdResult.md
浏览文件 @
6be7a7c2
...
...
@@ -25,7 +25,7 @@ let cmd = 'cmd';
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
executeShellCommand
(
cmd
,
(
error
:
any
,
data
:
any
)
=>
{
if
(
error
&&
error
.
code
!==
0
)
{
if
(
error
)
{
console
.
error
(
'
executeShellCommand fail, error: ${JSON.stringify(error)}
'
);
}
else
{
console
.
log
(
'
executeShellCommand success, data: ${JSON.stringify(data)}
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录