未验证 提交 acc2687f 编写于 作者: O openharmony_ci 提交者: Gitee

!1825 删除fa模型迁移接口说明

Merge pull request !1825 from wangdongdong/0307
......@@ -596,181 +596,6 @@ var connId = featureAbility.connectAbility(
var result = await featureAbility.disconnectAbility(connId);
```
## featureAbility.continueAbility
continueAbility(options: ContinueAbilityOptions, callback: AsyncCallback\<void>): void
迁移一个ability到目标设备,并返回执行结果(callback形式)。
**参数:**
| 名称 | 类型 | 必填 | 描述 |
| -------- | ---------------------- | ---- | ------------------- |
| options | ContinueAbilityOptions | 是 | 表示被启动的Ability |
| callback | AsyncCallback\<void> | 是 | 被指定的回调方法 |
**ContinueAbilityOptions类型说明:**
| 名称 | 读写属性 | 类型 | 必填 | 描述 |
| ---------- | -------- | ------- | ---- | ------------------------------------------------------------ |
| deviceId | 只读 | string | 是 | 表示需要包含有关目标启动能力的信息。 |
| reversible | 只读 | boolean | 是 | 是否支持回迁的标志,目前不支持该功能,为保留字段,可填false。 |
**示例:**
```javascript
import device from '@system.device'
import ability from '@ohos.ability.featureability'
var DEVICE_LIST_LOCALHOST
export default {
data: {
title: "",
deviceId: '',
deviceList: [],
remoteDeviceModel : new RemoteDeviceModel()
},
onInit() {
DEVICE_LIST_LOCALHOST = {
id: 'localhost',
};
this.deviceList = [DEVICE_LIST_LOCALHOST];
},
onShow() {
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
const reportExtend = new ReportExtend(file)
core.addService('expect', expectExtend)
core.addService('report', reportExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
core.execute()
},
onReady() {
},
GetNetWorkId(){
let self = this;
this.remoteDeviceModel.registerDeviceListCallback(() => {
var list = [];
list[0] = DEVICE_LIST_LOCALHOST;
var deviceList = self.remoteDeviceModel.deviceList;
for (var i = 0; i < deviceList.length; i++) {
list[i] = {
id: deviceList[i].deviceId,
};
}
self.deviceList = list;
});
},
ShowNetWorkId(){
this.deviceId = this.deviceList[0].id;
},
async ContinueAbility(){
function ContinueAbilityCallback(err) {
console.info("=============>ContinueAbilityCallback============>");
}
var continueAbilityOptions = {
reversible: false,
deviceId: this.deviceId,
}
//continueAbility callback
await ability.continueAbility(continueAbilityOptions, ContinueAbilityCallback);
},
}
```
## featureAbility.continueAbility
continueAbility(options: ContinueAbilityOptions): Promise\<void>;
迁移一个ability到目标设备,并返回执行结果(Promise形式)。
**参数:**
| 名称 | 类型 | 必填 | 描述 |
| ------- | ---------------------- | ---- | ------------------- |
| options | ContinueAbilityOptions | 是 | 表示被启动的Ability |
**ContinueAbilityOptions类型说明:**
| 名称 | 读写属性 | 类型 | 必填 | 描述 |
| ---------- | -------- | ------- | ---- | ------------------------------------------------------------ |
| deviceId | 只读 | string | 是 | 表示需要包含有关目标启动能力的信息。 |
| reversible | 只读 | boolean | 是 | 是否支持回迁的标志,目前不支持该功能,为保留字段,可填false。 |
**示例:**
```javascript
import device from '@system.device'
import ability from '@ohos.ability.featureability'
var DEVICE_LIST_LOCALHOST
export default {
data: {
title: "",
deviceId: '',
deviceList: [],
remoteDeviceModel : new RemoteDeviceModel()
},
onInit() {
DEVICE_LIST_LOCALHOST = {
id: 'localhost',
};
this.deviceList = [DEVICE_LIST_LOCALHOST];
},
onShow() {
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
const reportExtend = new ReportExtend(file)
core.addService('expect', expectExtend)
core.addService('report', reportExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
core.execute()
},
onReady() {
},
GetNetWorkId(){
let self = this;
this.remoteDeviceModel.registerDeviceListCallback(() => {
var list = [];
list[0] = DEVICE_LIST_LOCALHOST;
var deviceList = self.remoteDeviceModel.deviceList;
for (var i = 0; i < deviceList.length; i++) {
list[i] = {
id: deviceList[i].deviceId,
};
}
self.deviceList = list;
});
},
ShowNetWorkId(){
this.deviceId = this.deviceList[0].id;
},
async ContinueAbility(){
function ContinueAbilityCallback(err) {
console.info("=============>ContinueAbilityCallback============>");
}
var continueAbilityOptions = {
reversible: false,
deviceId: this.deviceId,
}
//continueAbility promise
await ability.continueAbility(continueAbilityOptions).then(() => {
console.info("=======>continueAbilityCallback=========>");
});
},
}
```
## AbilityResult
| 名称 | 读写属性 | 类型 | 必填 | 描述 |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册