提交 60b18ab2 编写于 作者: G Gloria

Update docs against 10097

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 96bd672d
......@@ -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);
}
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册