Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
5a4af8c7
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看板
未验证
提交
5a4af8c7
编写于
7月 20, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 20, 2023
浏览文件
操作
浏览文件
下载
差异文件
!21047 接口资料文档日志打印标点符号错误
Merge pull request !21047 from 李科/master
上级
57d30f4d
836310d3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
53 addition
and
53 deletion
+53
-53
zh-cn/application-dev/reference/apis/js-apis-app-ability-appManager.md
...tion-dev/reference/apis/js-apis-app-ability-appManager.md
+53
-53
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-app-ability-appManager.md
浏览文件 @
5a4af8c7
...
...
@@ -41,9 +41,9 @@ import appManager from '@ohos.app.ability.appManager';
appManager
.
isRunningInStabilityTest
((
err
,
flag
)
=>
{
if
(
err
)
{
console
.
error
(
'
isRunningInStabilityTest fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`isRunningInStabilityTest fail, err:
${
JSON
.
stringify
(
err
)}
`
);
}
else
{
console
.
log
(
'
The result of isRunningInStabilityTest is: ${JSON.stringify(flag)}
'
);
console
.
log
(
`The result of isRunningInStabilityTest is:
${
JSON
.
stringify
(
flag
)}
`
);
}
});
```
...
...
@@ -77,9 +77,9 @@ static isRunningInStabilityTest(): Promise<boolean>
import
appManager
from
'
@ohos.app.ability.appManager
'
;
appManager
.
isRunningInStabilityTest
().
then
((
flag
)
=>
{
console
.
log
(
'
The result of isRunningInStabilityTest is: ${JSON.stringify(flag)}
'
);
console
.
log
(
`The result of isRunningInStabilityTest is:
${
JSON
.
stringify
(
flag
)}
`
);
}).
catch
((
error
)
=>
{
console
.
error
(
'
error: ${JSON.stringify(error)}
'
);
console
.
error
(
`error:
${
JSON
.
stringify
(
error
)}
`
);
});
```
...
...
@@ -112,9 +112,9 @@ isRamConstrainedDevice(): Promise\<boolean>;
import
appManager
from
'
@ohos.app.ability.appManager
'
;
appManager
.
isRamConstrainedDevice
().
then
((
data
)
=>
{
console
.
log
(
'
The result of isRamConstrainedDevice is: ${JSON.stringify(data)}
'
);
console
.
log
(
`The result of isRamConstrainedDevice is:
${
JSON
.
stringify
(
data
)}
`
);
}).
catch
((
error
)
=>
{
console
.
error
(
'
error: ${JSON.stringify(error)}
'
);
console
.
error
(
`error:
${
JSON
.
stringify
(
error
)}
`
);
});
```
...
...
@@ -147,9 +147,9 @@ import appManager from '@ohos.app.ability.appManager';
appManager
.
isRamConstrainedDevice
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
'
isRamConstrainedDevice fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`isRamConstrainedDevice fail, err:
${
JSON
.
stringify
(
err
)}
`
);
}
else
{
console
.
log
(
'
The result of isRamConstrainedDevice is: ${JSON.stringify(data)}
'
);
console
.
log
(
`The result of isRamConstrainedDevice is:
${
JSON
.
stringify
(
data
)}
`
);
}
});
```
...
...
@@ -182,9 +182,9 @@ getAppMemorySize(): Promise\<number>;
import
appManager
from
'
@ohos.app.ability.appManager
'
;
appManager
.
getAppMemorySize
().
then
((
data
)
=>
{
console
.
log
(
'
The size of app memory is: ${JSON.stringify(data)}
'
);
console
.
log
(
`The size of app memory is:
${
JSON
.
stringify
(
data
)}
`
);
}).
catch
((
error
)
=>
{
console
.
error
(
'
error: ${JSON.stringify(error)}
'
);
console
.
error
(
`error:
${
JSON
.
stringify
(
error
)}
`
);
});
```
...
...
@@ -217,9 +217,9 @@ import appManager from '@ohos.app.ability.appManager';
appManager
.
getAppMemorySize
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
'
getAppMemorySize fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`getAppMemorySize fail, err:
${
JSON
.
stringify
(
err
)}
`
);
}
else
{
console
.
log
(
'
The size of app memory is: ${JSON.stringify(data)}
'
);
console
.
log
(
`The size of app memory is:
${
JSON
.
stringify
(
data
)}
`
);
}
});
```
...
...
@@ -254,9 +254,9 @@ getRunningProcessInformation(): Promise\<Array\<ProcessInformation>>;
import
appManager
from
'
@ohos.app.ability.appManager
'
;
appManager
.
getRunningProcessInformation
().
then
((
data
)
=>
{
console
.
log
(
'
The running process information is: ${JSON.stringify(data)}
'
);
console
.
log
(
`The running process information is:
${
JSON
.
stringify
(
data
)}
`
);
}).
catch
((
error
)
=>
{
console
.
error
(
'
error: ${JSON.stringify(error)}
'
);
console
.
error
(
`error:
${
JSON
.
stringify
(
error
)}
`
);
});
```
...
...
@@ -291,9 +291,9 @@ import appManager from '@ohos.app.ability.appManager';
appManager
.
getRunningProcessInformation
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
'
getRunningProcessInformation fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`getRunningProcessInformation fail, err:
${
JSON
.
stringify
(
err
)}
`
);
}
else
{
console
.
log
(
'
The process running information is: ${JSON.stringify(data)}
'
);
console
.
log
(
`The process running information is:
${
JSON
.
stringify
(
data
)}
`
);
}
});
```
...
...
@@ -339,9 +339,9 @@ import appManager from '@ohos.app.ability.appManager';
const
bundleName
=
"
this is a bundleName
"
;
const
versionCode
=
1
;
appManager
.
isSharedBundleRunning
(
bundleName
,
versionCode
).
then
((
data
)
=>
{
console
.
log
(
'
The shared bundle running is: ${JSON.stringify(data)}
'
);
console
.
log
(
`The shared bundle running is:
${
JSON
.
stringify
(
data
)}
`
);
}).
catch
((
error
)
=>
{
console
.
error
(
'
error: ${JSON.stringify(error)}
'
);
console
.
error
(
`error:
${
JSON
.
stringify
(
error
)}
`
);
});
```
...
...
@@ -382,9 +382,9 @@ const bundleName = "this is a bundleName";
const
versionCode
=
1
;
appManager
.
isSharedBundleRunning
(
bundleName
,
versionCode
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
'
err: ${JSON.stringify(err)}
'
);
console
.
error
(
`err:
${
JSON
.
stringify
(
err
)}
`
);
}
else
{
console
.
log
(
'
The shared bundle running is: ${JSON.stringify(data)}
'
);
console
.
log
(
`The shared bundle running is:
${
JSON
.
stringify
(
data
)}
`
);
}
});
```
...
...
@@ -581,7 +581,7 @@ try {
// 2.注销应用状态监听器
function
unregisterApplicationStateObserverCallback
(
err
)
{
if
(
err
)
{
console
.
error
(
'
unregisterApplicationStateObserverCallback fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`unregisterApplicationStateObserverCallback fail, err:
${
JSON
.
stringify
(
err
)}
`
);
}
else
{
console
.
log
(
'
unregisterApplicationStateObserverCallback success.
'
);
}
...
...
@@ -589,7 +589,7 @@ function unregisterApplicationStateObserverCallback(err) {
try
{
appManager
.
off
(
'
applicationState
'
,
observerId
,
unregisterApplicationStateObserverCallback
);
}
catch
(
paramError
)
{
console
.
error
(
'
error: ${paramError.code}, ${paramError.message}
'
);
console
.
error
(
`error:
${
paramError
.
code
}
,
${
paramError
.
message
}
`
);
}
```
...
...
@@ -662,12 +662,12 @@ try {
// 2.注销应用状态监听器
try
{
appManager
.
off
(
'
applicationState
'
,
observerId
).
then
((
data
)
=>
{
console
.
log
(
'
unregisterApplicationStateObserver success, data: ${JSON.stringify(data)}
'
);
console
.
log
(
`unregisterApplicationStateObserver success, data:
${
JSON
.
stringify
(
data
)}
`
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
unregisterApplicationStateObserver fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`unregisterApplicationStateObserver fail, err:
${
JSON
.
stringify
(
err
)}
`
);
});
}
catch
(
paramError
)
{
console
.
error
(
'
error: ${paramError.code}, ${paramError.message}
'
);
console
.
error
(
`error:
${
paramError
.
code
}
,
${
paramError
.
message
}
`
);
}
```
...
...
@@ -704,15 +704,15 @@ import appManager from '@ohos.app.ability.appManager';
function
getForegroundApplicationsCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
getForegroundApplicationsCallback fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`getForegroundApplicationsCallback fail, err:
${
JSON
.
stringify
(
err
)}
`
);
}
else
{
console
.
log
(
'
getForegroundApplicationsCallback success, data: ${JSON.stringify(data)}
'
);
console
.
log
(
`getForegroundApplicationsCallback success, data:
${
JSON
.
stringify
(
data
)}
`
);
}
}
try
{
appManager
.
getForegroundApplications
(
getForegroundApplicationsCallback
);
}
catch
(
paramError
)
{
console
.
error
(
'
error: ${paramError.code}, ${paramError.message}
'
);
console
.
error
(
`error:
${
paramError
.
code
}
,
${
paramError
.
message
}
`
);
}
```
...
...
@@ -748,9 +748,9 @@ getForegroundApplications(): Promise\<Array\<AppStateData>>;
import
appManager
from
'
@ohos.app.ability.appManager
'
;
appManager
.
getForegroundApplications
().
then
((
data
)
=>
{
console
.
log
(
'
getForegroundApplications success, data: ${JSON.stringify(data)}
'
);
console
.
log
(
`getForegroundApplications success, data:
${
JSON
.
stringify
(
data
)}
`
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
getForegroundApplications fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`getForegroundApplications fail, err:
${
JSON
.
stringify
(
err
)}
`
);
});
```
...
...
@@ -796,10 +796,10 @@ try {
appManager
.
killProcessWithAccount
(
bundleName
,
accountId
).
then
(()
=>
{
console
.
log
(
'
killProcessWithAccount success
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
killProcessWithAccount fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`killProcessWithAccount fail, err:
${
JSON
.
stringify
(
err
)}
`
);
});
}
catch
(
paramError
)
{
console
.
error
(
'
error: ${paramError.code}, ${paramError.message}
'
);
console
.
error
(
`error:
${
paramError
.
code
}
,
${
paramError
.
message
}
`
);
}
```
...
...
@@ -845,7 +845,7 @@ let bundleName = 'bundleName';
let
accountId
=
0
;
function
killProcessWithAccountCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
killProcessWithAccountCallback fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`killProcessWithAccountCallback fail, err:
${
JSON
.
stringify
(
err
)}
`
);
}
else
{
console
.
log
(
'
killProcessWithAccountCallback success.
'
);
}
...
...
@@ -888,7 +888,7 @@ import appManager from '@ohos.app.ability.appManager';
let
bundleName
=
'
bundleName
'
;
function
killProcessesByBundleNameCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
killProcessesByBundleNameCallback fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`killProcessesByBundleNameCallback fail, err:
${
JSON
.
stringify
(
err
)}
`
);
}
else
{
console
.
log
(
'
killProcessesByBundleNameCallback success.
'
);
}
...
...
@@ -896,7 +896,7 @@ function killProcessesByBundleNameCallback(err, data) {
try
{
appManager
.
killProcessesByBundleName
(
bundleName
,
killProcessesByBundleNameCallback
);
}
catch
(
paramError
)
{
console
.
error
(
'
error: ${paramError.code}, ${paramError.message}
'
);
console
.
error
(
`error:
${
paramError
.
code
}
,
${
paramError
.
message
}
`
);
}
```
...
...
@@ -942,10 +942,10 @@ try {
appManager
.
killProcessesByBundleName
(
bundleName
).
then
((
data
)
=>
{
console
.
log
(
'
killProcessesByBundleName success.
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
killProcessesByBundleName fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`killProcessesByBundleName fail, err:
${
JSON
.
stringify
(
err
)}
`
);
});
}
catch
(
paramError
)
{
console
.
error
(
'
error: ${paramError.code}, ${paramError.message}
'
);
console
.
error
(
`error:
${
paramError
.
code
}
,
${
paramError
.
message
}
`
);
}
```
...
...
@@ -984,7 +984,7 @@ import appManager from '@ohos.app.ability.appManager';
let
bundleName
=
'
bundleName
'
;
function
clearUpApplicationDataCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
clearUpApplicationDataCallback fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`clearUpApplicationDataCallback fail, err:
${
JSON
.
stringify
(
err
)}
`
);
}
else
{
console
.
log
(
'
clearUpApplicationDataCallback success.
'
);
}
...
...
@@ -992,7 +992,7 @@ function clearUpApplicationDataCallback(err, data) {
try
{
appManager
.
clearUpApplicationData
(
bundleName
,
clearUpApplicationDataCallback
);
}
catch
(
paramError
)
{
console
.
error
(
'
error: ${paramError.code}, ${paramError.message}
'
);
console
.
error
(
`error:
${
paramError
.
code
}
,
${
paramError
.
message
}
`
);
}
```
...
...
@@ -1038,10 +1038,10 @@ try {
appManager
.
clearUpApplicationData
(
bundleName
).
then
((
data
)
=>
{
console
.
log
(
'
clearUpApplicationData success.
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
clearUpApplicationData fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`clearUpApplicationData fail, err:
${
JSON
.
stringify
(
err
)}
`
);
});
}
catch
(
paramError
)
{
console
.
error
(
'
error: ${paramError.code}, ${paramError.message}
'
);
console
.
error
(
`error:
${
paramError
.
code
}
,
${
paramError
.
message
}
`
);
}
```
...
...
@@ -1078,7 +1078,7 @@ import appManager from '@ohos.app.ability.appManager';
let
pid
=
0
;
function
getProcessMemoryByPidCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
getProcessMemoryByPidCallback fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`getProcessMemoryByPidCallback fail, err:
${
JSON
.
stringify
(
err
)}
`
);
}
else
{
console
.
log
(
'
getProcessMemoryByPidCallback success.
'
);
}
...
...
@@ -1086,7 +1086,7 @@ function getProcessMemoryByPidCallback(err, data) {
try
{
appManager
.
getProcessMemoryByPid
(
pid
,
getProcessMemoryByPidCallback
);
}
catch
(
paramError
)
{
console
.
error
(
'
error: ${paramError.code}, ${paramError.message}
'
);
console
.
error
(
`error:
${
paramError
.
code
}
,
${
paramError
.
message
}
`
);
}
```
...
...
@@ -1130,10 +1130,10 @@ try {
appManager
.
getProcessMemoryByPid
(
pid
).
then
((
data
)
=>
{
console
.
log
(
'
getProcessMemoryByPid success.
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
getProcessMemoryByPid fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`getProcessMemoryByPid fail, err:
${
JSON
.
stringify
(
err
)}
`
);
});
}
catch
(
paramError
)
{
console
.
error
(
'
error: ${paramError.code}, ${paramError.message}
'
);
console
.
error
(
`error:
${
paramError
.
code
}
,
${
paramError
.
message
}
`
);
}
```
...
...
@@ -1170,7 +1170,7 @@ import appManager from '@ohos.app.ability.appManager';
let
bundleName
=
"
bundleName
"
;
function
getRunningProcessInfoByBundleNameCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
getRunningProcessInfoByBundleNameCallback fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`getRunningProcessInfoByBundleNameCallback fail, err:
${
JSON
.
stringify
(
err
)}
`
);
}
else
{
console
.
log
(
'
getRunningProcessInfoByBundleNameCallback success.
'
);
}
...
...
@@ -1178,7 +1178,7 @@ function getRunningProcessInfoByBundleNameCallback(err, data) {
try
{
appManager
.
getRunningProcessInfoByBundleName
(
bundleName
,
getRunningProcessInfoByBundleNameCallback
);
}
catch
(
paramError
)
{
console
.
error
(
'
error: ${paramError.code}, ${paramError.message}
'
);
console
.
error
(
`error:
${
paramError
.
code
}
,
${
paramError
.
message
}
`
);
}
```
...
...
@@ -1222,10 +1222,10 @@ try {
appManager
.
getRunningProcessInfoByBundleName
(
bundleName
).
then
((
data
)
=>
{
console
.
log
(
'
getRunningProcessInfoByBundleName success.
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
getRunningProcessInfoByBundleName fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`getRunningProcessInfoByBundleName fail, err:
${
JSON
.
stringify
(
err
)}
`
);
});
}
catch
(
paramError
)
{
console
.
error
(
'
error: ${paramError.code}, ${paramError.message}
'
);
console
.
error
(
`error:
${
paramError
.
code
}
,
${
paramError
.
message
}
`
);
}
```
...
...
@@ -1264,7 +1264,7 @@ let bundleName = "bundleName";
let
userId
=
0
;
function
getRunningProcessInfoByBundleNameCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
getRunningProcessInfoByBundleNameCallback fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`getRunningProcessInfoByBundleNameCallback fail, err:
${
JSON
.
stringify
(
err
)}
`
);
}
else
{
console
.
log
(
'
getRunningProcessInfoByBundleNameCallback success.
'
);
}
...
...
@@ -1272,7 +1272,7 @@ function getRunningProcessInfoByBundleNameCallback(err, data) {
try
{
appManager
.
getRunningProcessInfoByBundleName
(
bundleName
,
userId
,
getRunningProcessInfoByBundleNameCallback
);
}
catch
(
paramError
)
{
console
.
error
(
'
error: ${paramError.code}, ${paramError.message}
'
);
console
.
error
(
`error:
${
paramError
.
code
}
,
${
paramError
.
message
}
`
);
}
```
...
...
@@ -1318,10 +1318,10 @@ try {
appManager
.
getRunningProcessInfoByBundleName
(
bundleName
,
userId
).
then
((
data
)
=>
{
console
.
log
(
'
getRunningProcessInfoByBundleName success.
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
getRunningProcessInfoByBundleName fail, err: ${JSON.stringify(err)}
'
);
console
.
error
(
`getRunningProcessInfoByBundleName fail, err:
${
JSON
.
stringify
(
err
)}
`
);
});
}
catch
(
paramError
)
{
console
.
error
(
'
error: ${paramError.code}, ${paramError.message}
'
);
console
.
error
(
`error:
${
paramError
.
code
}
,
${
paramError
.
message
}
`
);
}
```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录