Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
ae57dd00
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看板
未验证
提交
ae57dd00
编写于
10月 20, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 20, 2022
浏览文件
操作
浏览文件
下载
差异文件
!10854 翻译完成:10097 Fix the problem of sensitive words
Merge pull request !10854 from wusongqing/TR10097
上级
61061e28
60b18ab2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
101 addition
and
33 deletion
+101
-33
en/application-dev/reference/apis/js-apis-appmanager.md
en/application-dev/reference/apis/js-apis-appmanager.md
+66
-0
en/application-dev/reference/apis/js-apis-missionManager.md
en/application-dev/reference/apis/js-apis-missionManager.md
+35
-33
未找到文件。
en/application-dev/reference/apis/js-apis-appmanager.md
浏览文件 @
ae57dd00
...
...
@@ -294,6 +294,9 @@ Registers an observer to listen for the state changes of all applications.
},
onProcessDied
(
processData
)
{
console
.
log
(
'
------------ onProcessDied -----------
'
,
processData
);
},
onProcessStateChanged
(
processData
)
{
console
.
log
(
'
------------ onProcessStateChanged -----------
'
,
processData
);
}
}
const
observerCode
=
app
.
registerApplicationStateObserver
(
applicationStateObserver
);
...
...
@@ -335,6 +338,9 @@ Registers an observer to listen for the state changes of a specified application
},
onProcessDied
(
processData
)
{
console
.
log
(
'
------------ onProcessDied -----------
'
,
processData
);
},
onProcessStateChanged
(
processData
)
{
console
.
log
(
'
------------ onProcessStateChanged -----------
'
,
processData
);
}
}
var
bundleNameList
=
[
'
bundleName1
'
,
'
bundleName2
'
];
...
...
@@ -707,6 +713,18 @@ Called when the application state changes.
var
applicationStateObserver
=
{
onForegroundApplicationChanged
(
appStateData
)
{
console
.
log
(
'
------------ onForegroundApplicationChanged -----------
'
,
appStateData
);
},
onAbilityStateChanged
(
abilityStateData
)
{
console
.
log
(
'
------------ onAbilityStateChanged -----------
'
,
abilityStateData
);
},
onProcessCreated
(
processData
)
{
console
.
log
(
'
------------ onProcessCreated -----------
'
,
processData
);
},
onProcessDied
(
processData
)
{
console
.
log
(
'
------------ onProcessDied -----------
'
,
processData
);
},
onProcessStateChanged
(
processData
)
{
console
.
log
(
'
------------ onProcessStateChanged -----------
'
,
processData
);
}
}
const
observerCode
=
app
.
registerApplicationStateObserver
(
applicationStateObserver
);
...
...
@@ -734,8 +752,20 @@ Called when the ability state changes.
```
js
var
applicationStateObserver
=
{
onForegroundApplicationChanged
(
appStateData
)
{
console
.
log
(
'
------------ onForegroundApplicationChanged -----------
'
,
appStateData
);
},
onAbilityStateChanged
(
abilityStateData
)
{
console
.
log
(
'
------------ onAbilityStateChanged -----------
'
,
abilityStateData
);
},
onProcessCreated
(
processData
)
{
console
.
log
(
'
------------ onProcessCreated -----------
'
,
processData
);
},
onProcessDied
(
processData
)
{
console
.
log
(
'
------------ onProcessDied -----------
'
,
processData
);
},
onProcessStateChanged
(
processData
)
{
console
.
log
(
'
------------ onProcessStateChanged -----------
'
,
processData
);
}
}
const
observerCode
=
app
.
registerApplicationStateObserver
(
applicationStateObserver
);
...
...
@@ -762,8 +792,20 @@ Called when a process is created.
```
js
var
applicationStateObserver
=
{
onForegroundApplicationChanged
(
appStateData
)
{
console
.
log
(
'
------------ onForegroundApplicationChanged -----------
'
,
appStateData
);
},
onAbilityStateChanged
(
abilityStateData
)
{
console
.
log
(
'
------------ onAbilityStateChanged -----------
'
,
abilityStateData
);
},
onProcessCreated
(
processData
)
{
console
.
log
(
'
------------ onProcessCreated -----------
'
,
processData
);
},
onProcessDied
(
processData
)
{
console
.
log
(
'
------------ onProcessDied -----------
'
,
processData
);
},
onProcessStateChanged
(
processData
)
{
console
.
log
(
'
------------ onProcessStateChanged -----------
'
,
processData
);
}
}
const
observerCode
=
app
.
registerApplicationStateObserver
(
applicationStateObserver
);
...
...
@@ -790,8 +832,20 @@ Called when a process is terminated.
```
js
var
applicationStateObserver
=
{
onForegroundApplicationChanged
(
appStateData
)
{
console
.
log
(
'
------------ onForegroundApplicationChanged -----------
'
,
appStateData
);
},
onAbilityStateChanged
(
abilityStateData
)
{
console
.
log
(
'
------------ onAbilityStateChanged -----------
'
,
abilityStateData
);
},
onProcessCreated
(
processData
)
{
console
.
log
(
'
------------ onProcessCreated -----------
'
,
processData
);
},
onProcessDied
(
processData
)
{
console
.
log
(
'
------------ onProcessDied -----------
'
,
processData
);
},
onProcessStateChanged
(
processData
)
{
console
.
log
(
'
------------ onProcessStateChanged -----------
'
,
processData
);
}
}
const
observerCode
=
app
.
registerApplicationStateObserver
(
applicationStateObserver
);
...
...
@@ -818,6 +872,18 @@ Called when the process state changes.
```
js
var
applicationStateObserver
=
{
onForegroundApplicationChanged
(
appStateData
)
{
console
.
log
(
'
------------ onForegroundApplicationChanged -----------
'
,
appStateData
);
},
onAbilityStateChanged
(
abilityStateData
)
{
console
.
log
(
'
------------ onAbilityStateChanged -----------
'
,
abilityStateData
);
},
onProcessCreated
(
processData
)
{
console
.
log
(
'
------------ onProcessCreated -----------
'
,
processData
);
},
onProcessDied
(
processData
)
{
console
.
log
(
'
------------ onProcessDied -----------
'
,
processData
);
},
onProcessStateChanged
(
processData
)
{
console
.
log
(
'
------------ onProcessStateChanged -----------
'
,
processData
);
}
...
...
en/application-dev/reference/apis/js-apis-missionManager.md
浏览文件 @
ae57dd00
...
...
@@ -42,18 +42,18 @@ Registers a listener to observe the mission status.
**Example**
```
js
var
listener
=
{
onMissionCreated
:
function
(
mission
){
"
--------onMissionCreated-------
"
},
onMissionDestroyed
:
function
(
mission
){
"
--------onMissionDestroyed-------
"
},
onMissionSnapshotChanged
:
function
(
mission
){
"
--------onMissionSnapshotChanged-------
"
},
onMissionMovedToFront
:
function
(
mission
){
"
--------onMissionMovedToFront-------
"
},
onMissionIconUpdated
:
function
(
mission
,
icon
){
"
--------onMissionIconUpdated-------
"
}
```
js
var
listener
=
{
onMissionCreated
:
function
(
mission
)
{
console
.
log
(
"
--------onMissionCreated-------
"
)},
onMissionDestroyed
:
function
(
mission
)
{
console
.
log
(
"
--------onMissionDestroyed-------
"
)},
onMissionSnapshotChanged
:
function
(
mission
)
{
console
.
log
(
"
--------onMissionSnapshotChanged-------
"
)},
onMissionMovedToFront
:
function
(
mission
)
{
console
.
log
(
"
--------onMissionMovedToFront-------
"
)},
onMissionIconUpdated
:
function
(
mission
,
icon
)
{
console
.
log
(
"
--------onMissionIconUpdated-------
"
)},
onMissionClosed
:
function
(
mission
)
{
console
.
log
(
"
--------onMissionClosed-------
"
)}
};
console
.
log
(
"
registerMissionListener
"
)
var
listenerid
=
missionManager
.
registerMissionListener
(
listener
);
```
```
## missionManager.unregisterMissionListener
...
...
@@ -77,21 +77,22 @@ Deregisters a mission status listener. This API uses an asynchronous callback to
**Example**
```
js
var
listener
=
{
onMissionCreated
:
function
(
mission
){
"
--------onMissionCreated-------
"
},
onMissionDestroyed
:
function
(
mission
){
"
--------onMissionDestroyed-------
"
},
onMissionSnapshotChanged
:
function
(
mission
){
"
--------onMissionSnapshotChanged-------
"
},
onMissionMovedToFront
:
function
(
mission
){
"
--------onMissionMovedToFront-------
"
},
onMissionIconUpdated
:
function
(
mission
,
icon
){
"
--------onMissionIconUpdated-------
"
}
```
js
var
listener
=
{
onMissionCreated
:
function
(
mission
)
{
console
.
log
(
"
--------onMissionCreated-------
"
)},
onMissionDestroyed
:
function
(
mission
)
{
console
.
log
(
"
--------onMissionDestroyed-------
"
)},
onMissionSnapshotChanged
:
function
(
mission
)
{
console
.
log
(
"
--------onMissionSnapshotChanged-------
"
)},
onMissionMovedToFront
:
function
(
mission
)
{
console
.
log
(
"
--------onMissionMovedToFront-------
"
)},
onMissionIconUpdated
:
function
(
mission
,
icon
)
{
console
.
log
(
"
--------onMissionIconUpdated-------
"
)},
onMissionClosed
:
function
(
mission
)
{
console
.
log
(
"
--------onMissionClosed-------
"
)}
};
console
.
log
(
"
registerMissionListener
"
)
var
listenerid
=
missionManager
.
registerMissionListener
(
listener
);
missionManager
.
unregisterMissionListener
(
listenerid
,
(
error
)
=>
{
console
.
log
(
"
unregisterMissionListener
"
);
console
.
log
(
"
unregisterMissionListener
"
);
})
```
```
## missionManager.unregisterMissionListener
...
...
@@ -120,21 +121,22 @@ Deregisters a mission status listener. This API uses a promise to return the res
**Example**
```
js
var
listener
=
{
onMissionCreated
:
function
(
mission
){
"
--------onMissionCreated-------
"
},
onMissionDestroyed
:
function
(
mission
){
"
--------onMissionDestroyed-------
"
},
onMissionSnapshotChanged
:
function
(
mission
){
"
--------onMissionSnapshotChanged-------
"
},
onMissionMovedToFront
:
function
(
mission
){
"
--------onMissionMovedToFront-------
"
},
onMissionIconUpdated
:
function
(
mission
,
icon
){
"
--------onMissionIconUpdated-------
"
}
};
console
.
log
(
"
registerMissionListener
"
)
var
listenerid
=
missionManager
.
registerMissionListener
(
listener
);
missionManager
.
unregisterMissionListener
(
listenerid
).
catch
(
function
(
err
){
console
.
log
(
err
);
});
```
```
js
var
listener
=
{
onMissionCreated
:
function
(
mission
)
{
console
.
log
(
"
--------onMissionCreated-------
"
)},
onMissionDestroyed
:
function
(
mission
)
{
console
.
log
(
"
--------onMissionDestroyed-------
"
)},
onMissionSnapshotChanged
:
function
(
mission
)
{
console
.
log
(
"
--------onMissionSnapshotChanged-------
"
)},
onMissionMovedToFront
:
function
(
mission
)
{
console
.
log
(
"
--------onMissionMovedToFront-------
"
)},
onMissionIconUpdated
:
function
(
mission
,
icon
)
{
console
.
log
(
"
--------onMissionIconUpdated-------
"
)},
onMissionClosed
:
function
(
mission
)
{
console
.
log
(
"
--------onMissionClosed-------
"
)}
};
console
.
log
(
"
registerMissionListener
"
)
var
listenerid
=
missionManager
.
registerMissionListener
(
listener
);
missionManager
.
unregisterMissionListener
(
listenerid
).
catch
(
function
(
err
)
{
console
.
log
(
err
);
});
```
## missionManager.getMissionInfo
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录