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

!4543 Fix code error of ability

Merge pull request !4543 from yuyaozhi/master
...@@ -378,7 +378,7 @@ startAbilityByCall(want: Want): Promise<Caller>; ...@@ -378,7 +378,7 @@ startAbilityByCall(want: Want): Promise<Caller>;
deviceId: "" deviceId: ""
}).then((obj) => { }).then((obj) => {
caller = obj; caller = obj;
console.log('Caller GetCaller Get ' + call); console.log('Caller GetCaller Get ' + caller);
}).catch((e) => { }).catch((e) => {
console.log('Caller GetCaller error ' + e); console.log('Caller GetCaller error ' + e);
}); });
......
...@@ -82,7 +82,7 @@ isRamConstrainedDevice(): Promise\<boolean>; ...@@ -82,7 +82,7 @@ isRamConstrainedDevice(): Promise\<boolean>;
**示例:** **示例:**
```js ```js
app.isRamConstrainedDevicePromise().then((data) => { app.isRamConstrainedDevice().then((data) => {
console.log('success:' + JSON.stringify(data)); console.log('success:' + JSON.stringify(data));
}).catch((error) => { }).catch((error) => {
console.log('failed:' + JSON.stringify(error)); console.log('failed:' + JSON.stringify(error));
...@@ -106,7 +106,7 @@ isRamConstrainedDevice(callback: AsyncCallback\<boolean>): void; ...@@ -106,7 +106,7 @@ isRamConstrainedDevice(callback: AsyncCallback\<boolean>): void;
**示例:** **示例:**
```js ```js
app.isRamConstrainedDevicePromise((err, data) => { app.isRamConstrainedDevice((err, data) => {
console.log('startAbility result failed:' + JSON.stringify(err)); console.log('startAbility result failed:' + JSON.stringify(err));
console.log('startAbility result success:' + JSON.stringify(data)); console.log('startAbility result success:' + JSON.stringify(data));
}) })
...@@ -175,7 +175,7 @@ getProcessRunningInfos(): Promise<Array\<ProcessRunningInfo>>; ...@@ -175,7 +175,7 @@ getProcessRunningInfos(): Promise<Array\<ProcessRunningInfo>>;
**示例:** **示例:**
```js ```js
app.GetProcessRunningInfos().then((data) => { app.getProcessRunningInfos().then((data) => {
console.log('success:' + JSON.stringify(data)); console.log('success:' + JSON.stringify(data));
}).catch((error) => { }).catch((error) => {
console.log('failed:' + JSON.stringify(error)); console.log('failed:' + JSON.stringify(error));
...@@ -199,7 +199,7 @@ getProcessRunningInfos(callback: AsyncCallback<Array\<ProcessRunningInfo>>): voi ...@@ -199,7 +199,7 @@ getProcessRunningInfos(callback: AsyncCallback<Array\<ProcessRunningInfo>>): voi
**示例:** **示例:**
```js ```js
app.GetProcessRunningInfos((err, data) => { app.getProcessRunningInfos((err, data) => {
console.log('startAbility result failed :' + JSON.stringify(err)); console.log('startAbility result failed :' + JSON.stringify(err));
console.log('startAbility result success:' + JSON.stringify(data)); console.log('startAbility result success:' + JSON.stringify(data));
}) })
......
...@@ -506,7 +506,7 @@ const valueBucket = { ...@@ -506,7 +506,7 @@ const valueBucket = {
"name": "rose", "name": "rose",
"age": 22, "age": 22,
"salary": 200.5, "salary": 200.5,
"blobType": u8, "blobType": "u8",
} }
DAHelper.insert( DAHelper.insert(
"dataability:///com.example.DataAbility", "dataability:///com.example.DataAbility",
...@@ -548,7 +548,7 @@ const valueBucket = { ...@@ -548,7 +548,7 @@ const valueBucket = {
"name": "rose1", "name": "rose1",
"age": 221, "age": 221,
"salary": 20.5, "salary": 20.5,
"blobType": u8, "blobType": "u8",
} }
DAHelper.insert( DAHelper.insert(
"dataability:///com.example.DataAbility", "dataability:///com.example.DataAbility",
...@@ -581,9 +581,9 @@ import featureAbility from '@ohos.ability.featureAbility' ...@@ -581,9 +581,9 @@ import featureAbility from '@ohos.ability.featureAbility'
var DAHelper = featureAbility.acquireDataAbilityHelper( var DAHelper = featureAbility.acquireDataAbilityHelper(
"dataability:///com.example.DataAbility" "dataability:///com.example.DataAbility"
); );
var cars = new Array({"name": "roe11", "age": 21, "salary": 20.5, "blobType": u8,}, var cars = new Array({"name": "roe11", "age": 21, "salary": 20.5, "blobType": "u8",},
{"name": "roe12", "age": 21, "salary": 20.5, "blobType": u8,}, {"name": "roe12", "age": 21, "salary": 20.5, "blobType": "u8",},
{"name": "roe13", "age": 21, "salary": 20.5, "blobType": u8,}) {"name": "roe13", "age": 21, "salary": 20.5, "blobType": "u8",})
DAHelper.batchInsert( DAHelper.batchInsert(
"dataability:///com.example.DataAbility", "dataability:///com.example.DataAbility",
cars, cars,
...@@ -620,9 +620,9 @@ import featureAbility from '@ohos.ability.featureAbility' ...@@ -620,9 +620,9 @@ import featureAbility from '@ohos.ability.featureAbility'
var DAHelper = featureAbility.acquireDataAbilityHelper( var DAHelper = featureAbility.acquireDataAbilityHelper(
"dataability:///com.example.DataAbility" "dataability:///com.example.DataAbility"
); );
var cars = new Array({"name": "roe11", "age": 21, "salary": 20.5, "blobType": u8,}, var cars = new Array({"name": "roe11", "age": 21, "salary": 20.5, "blobType": "u8",},
{"name": "roe12", "age": 21, "salary": 20.5, "blobType": u8,}, {"name": "roe12", "age": 21, "salary": 20.5, "blobType": "u8",},
{"name": "roe13", "age": 21, "salary": 20.5, "blobType": u8,}) {"name": "roe13", "age": 21, "salary": 20.5, "blobType": "u8",})
DAHelper.batchInsert( DAHelper.batchInsert(
"dataability:///com.example.DataAbility", "dataability:///com.example.DataAbility",
cars cars
...@@ -689,6 +689,7 @@ delete(uri: string, predicates: dataAbility.DataAbilityPredicates): Promise\<num ...@@ -689,6 +689,7 @@ delete(uri: string, predicates: dataAbility.DataAbilityPredicates): Promise\<num
```js ```js
import featureAbility from '@ohos.ability.featureAbility' import featureAbility from '@ohos.ability.featureAbility'
import ohos_data_ability from '@ohos.data.dataability'
var DAHelper = featureAbility.acquireDataAbilityHelper( var DAHelper = featureAbility.acquireDataAbilityHelper(
"dataability:///com.example.DataAbility" "dataability:///com.example.DataAbility"
); );
...@@ -730,7 +731,7 @@ const va = { ...@@ -730,7 +731,7 @@ const va = {
"name": "roe1", "name": "roe1",
"age": 21, "age": 21,
"salary": 20.5, "salary": 20.5,
"blobType": u8, "blobType": "u8",
} }
let da = new ohos_data_ability.DataAbilityPredicates() let da = new ohos_data_ability.DataAbilityPredicates()
DAHelper.update( DAHelper.update(
...@@ -776,7 +777,7 @@ const va = { ...@@ -776,7 +777,7 @@ const va = {
"name": "roe1", "name": "roe1",
"age": 21, "age": 21,
"salary": 20.5, "salary": 20.5,
"blobType": u8, "blobType": "u8",
} }
let da = new ohos_data_ability.DataAbilityPredicates() let da = new ohos_data_ability.DataAbilityPredicates()
DAHelper.update( DAHelper.update(
......
...@@ -213,7 +213,7 @@ onConfigurationUpdated(config: Configuration): void; ...@@ -213,7 +213,7 @@ onConfigurationUpdated(config: Configuration): void;
**示例:** **示例:**
```js ```js
class MyFormExtension extends MyFormExtension { class MyFormExtension extends FormExtension {
onConfigurationUpdated(config) { onConfigurationUpdated(config) {
console.log('onConfigurationUpdated, config:' + JSON.stringify(config)); console.log('onConfigurationUpdated, config:' + JSON.stringify(config));
} }
...@@ -237,7 +237,7 @@ onAcquireFormState?(want: Want): formInfo.FormState; ...@@ -237,7 +237,7 @@ onAcquireFormState?(want: Want): formInfo.FormState;
**示例:** **示例:**
```js ```js
class MyFormExtension extends MyFormExtension { class MyFormExtension extends FormExtension {
onAcquireFormState(want) { onAcquireFormState(want) {
console.log('FormExtension onAcquireFormState, want:' + want); console.log('FormExtension onAcquireFormState, want:' + want);
} }
......
...@@ -401,6 +401,7 @@ connectAbility(request: Want, options:ConnectOptions): number ...@@ -401,6 +401,7 @@ connectAbility(request: Want, options:ConnectOptions): number
**示例** **示例**
```js ```js
import rpc from '@ohos.rpc'
function onConnectCallback(element, remote){ function onConnectCallback(element, remote){
console.log('ConnectAbility onConnect remote is proxy:' + (remote instanceof rpc.RemoteProxy)); console.log('ConnectAbility onConnect remote is proxy:' + (remote instanceof rpc.RemoteProxy));
} }
...@@ -422,8 +423,10 @@ connectAbility(request: Want, options:ConnectOptions): number ...@@ -422,8 +423,10 @@ connectAbility(request: Want, options:ConnectOptions): number
}, },
); );
particleAbility.disconnectAbility(connId).then((error,data)=>{ particleAbility.disconnectAbility(connId).then((data)=>{
console.log('particleAbilityTest result errCode : ' + error.code + " data: " + data); console.log( " data: " + data);
}).catch((error)=>{
console.log('particleAbilityTest result errCode : ' + error.code )
}); });
...@@ -447,6 +450,7 @@ disconnectAbility(connection: number, callback:AsyncCallback\<void>): void; ...@@ -447,6 +450,7 @@ disconnectAbility(connection: number, callback:AsyncCallback\<void>): void;
**示例** **示例**
```js ```js
import rpc from '@ohos.rpc'
function onConnectCallback(element, remote){ function onConnectCallback(element, remote){
console.log('ConnectAbility onConnect remote is proxy:' + (remote instanceof rpc.RemoteProxy)); console.log('ConnectAbility onConnect remote is proxy:' + (remote instanceof rpc.RemoteProxy));
} }
...@@ -467,11 +471,11 @@ disconnectAbility(connection: number, callback:AsyncCallback\<void>): void; ...@@ -467,11 +471,11 @@ disconnectAbility(connection: number, callback:AsyncCallback\<void>): void;
onFailed: onFailedCallback, onFailed: onFailedCallback,
}, },
); );
var result = particleAbility.disconnectAbility(connId, var result = particleAbility.disconnectAbility(connId).then((data)=>{
(error,data) => { console.log( " data: " + data);
console.log('particleAbilityTest DisConnectJsSameBundleName result errCode : ' + error.code + " data: " + data) }).catch((error)=>{
}, console.log('particleAbilityTest result errCode : ' + error.code )
); });
``` ```
...@@ -493,6 +497,7 @@ disconnectAbility(connection: number): Promise\<void>; ...@@ -493,6 +497,7 @@ disconnectAbility(connection: number): Promise\<void>;
**示例** **示例**
```js ```js
import rpc from '@ohos.rpc'
function onConnectCallback(element, remote){ function onConnectCallback(element, remote){
console.log('ConnectAbility onConnect remote is proxy:' + (remote instanceof rpc.RemoteProxy)); console.log('ConnectAbility onConnect remote is proxy:' + (remote instanceof rpc.RemoteProxy));
} }
...@@ -514,8 +519,10 @@ function onConnectCallback(element, remote){ ...@@ -514,8 +519,10 @@ function onConnectCallback(element, remote){
}, },
); );
particleAbility.disconnectAbility(connId).then((error,data)=>{ particleAbility.disconnectAbility(connId).then((data)=>{
console.log('particleAbilityTest result errCode : ' + error.code + " data: " + data); console.log( " data: " + data);
}).catch((error)=>{
console.log('particleAbilityTest result errCode : ' + error.code )
}); });
``` ```
......
...@@ -126,7 +126,7 @@ Extension生命周期回调,如果是connectAbility拉起的服务,会在onC ...@@ -126,7 +126,7 @@ Extension生命周期回调,如果是connectAbility拉起的服务,会在onC
constructor(des) { constructor(des) {
super(des); super(des);
} }
onRemoteRequest(code, data, reply, option) { onConnect(code, data, reply, option) {
} }
} }
class ServiceExt extends ServiceExtension { class ServiceExt extends ServiceExtension {
......
...@@ -29,7 +29,6 @@ getWantAgent(info: WantAgentInfo, callback: AsyncCallback\<WantAgent\>): void ...@@ -29,7 +29,6 @@ getWantAgent(info: WantAgentInfo, callback: AsyncCallback\<WantAgent\>): void
```js ```js
import WantAgent from '@ohos.wantAgent'; import WantAgent from '@ohos.wantAgent';
import { OperationType, WantAgentFlags } from '@ohos.wantagent';
//getWantAgent回调 //getWantAgent回调
function getWantAgentCallback(err, data) { function getWantAgentCallback(err, data) {
...@@ -58,9 +57,9 @@ var wantAgentInfo = { ...@@ -58,9 +57,9 @@ var wantAgentInfo = {
} }
} }
], ],
operationType: OperationType.START_ABILITIES, operationType: WantAgent.OperationType.START_ABILITIES,
requestCode: 0, requestCode: 0,
wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG] wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
} }
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback) WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback)
...@@ -92,7 +91,7 @@ getWantAgent(info: WantAgentInfo): Promise\<WantAgent\> ...@@ -92,7 +91,7 @@ getWantAgent(info: WantAgentInfo): Promise\<WantAgent\>
```js ```js
import WantAgent from '@ohos.wantAgent'; import WantAgent from '@ohos.wantAgent';
import { OperationType, WantAgentFlags } from '@ohos.wantagent';
//WantAgentInfo对象 //WantAgentInfo对象
var wantAgentInfo = { var wantAgentInfo = {
...@@ -117,9 +116,9 @@ var wantAgentInfo = { ...@@ -117,9 +116,9 @@ var wantAgentInfo = {
} }
} }
], ],
operationType: OperationType.START_ABILITIES, operationType: WantAgent.OperationType.START_ABILITIES,
requestCode: 0, requestCode: 0,
wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG] wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
} }
WantAgent.getWantAgent(wantAgentInfo).then((data) => { WantAgent.getWantAgent(wantAgentInfo).then((data) => {
...@@ -148,7 +147,7 @@ getBundleName(agent: WantAgent, callback: AsyncCallback\<string\>): void ...@@ -148,7 +147,7 @@ getBundleName(agent: WantAgent, callback: AsyncCallback\<string\>): void
```js ```js
import WantAgent from '@ohos.wantAgent'; import WantAgent from '@ohos.wantAgent';
import { OperationType, WantAgentFlags } from '@ohos.wantagent';
//wantAgent对象 //wantAgent对象
var wantAgent; var wantAgent;
...@@ -185,9 +184,9 @@ var wantAgentInfo = { ...@@ -185,9 +184,9 @@ var wantAgentInfo = {
} }
} }
], ],
operationType: OperationType.START_ABILITIES, operationType: WantAgent.OperationType.START_ABILITIES,
requestCode: 0, requestCode: 0,
wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG] wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
} }
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback) WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback)
...@@ -225,7 +224,7 @@ getBundleName(agent: WantAgent): Promise\<string\> ...@@ -225,7 +224,7 @@ getBundleName(agent: WantAgent): Promise\<string\>
```js ```js
import WantAgent from '@ohos.wantAgent'; import WantAgent from '@ohos.wantAgent';
import { OperationType, WantAgentFlags } from '@ohos.wantagent';
//wantAgent对象 //wantAgent对象
var wantAgent; var wantAgent;
...@@ -253,9 +252,9 @@ var wantAgentInfo = { ...@@ -253,9 +252,9 @@ var wantAgentInfo = {
} }
} }
], ],
operationType: OperationType.START_ABILITIES, operationType: WantAgent.OperationType.START_ABILITIES,
requestCode: 0, requestCode: 0,
wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG] wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
} }
WantAgent.getWantAgent(wantAgentInfo).then((data) => { WantAgent.getWantAgent(wantAgentInfo).then((data) => {
...@@ -289,7 +288,7 @@ getUid(agent: WantAgent, callback: AsyncCallback\<number\>): void ...@@ -289,7 +288,7 @@ getUid(agent: WantAgent, callback: AsyncCallback\<number\>): void
```js ```js
import WantAgent from '@ohos.wantAgent'; import WantAgent from '@ohos.wantAgent';
import { OperationType, WantAgentFlags } from '@ohos.wantagent';
//wantAgent对象 //wantAgent对象
var wantAgent; var wantAgent;
...@@ -326,9 +325,9 @@ var wantAgentInfo = { ...@@ -326,9 +325,9 @@ var wantAgentInfo = {
} }
} }
], ],
operationType: OperationType.START_ABILITIES, operationType: WantAgent.OperationType.START_ABILITIES,
requestCode: 0, requestCode: 0,
wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG] wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
} }
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback) WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback)
...@@ -366,7 +365,7 @@ getUid(agent: WantAgent): Promise\<number\> ...@@ -366,7 +365,7 @@ getUid(agent: WantAgent): Promise\<number\>
```js ```js
import WantAgent from '@ohos.wantAgent'; import WantAgent from '@ohos.wantAgent';
import { OperationType, WantAgentFlags } from '@ohos.wantagent';
//wantAgent对象 //wantAgent对象
var wantAgent; var wantAgent;
...@@ -394,9 +393,9 @@ var wantAgentInfo = { ...@@ -394,9 +393,9 @@ var wantAgentInfo = {
} }
} }
], ],
operationType: OperationType.START_ABILITIES, operationType: WantAgent.OperationType.START_ABILITIES,
requestCode: 0, requestCode: 0,
wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG] wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
} }
WantAgent.getWantAgent(wantAgentInfo).then((data) => { WantAgent.getWantAgent(wantAgentInfo).then((data) => {
...@@ -430,7 +429,7 @@ getWant(agent: WantAgent, callback: AsyncCallback\<Want\>): void ...@@ -430,7 +429,7 @@ getWant(agent: WantAgent, callback: AsyncCallback\<Want\>): void
```js ```js
import WantAgent from '@ohos.wantAgent'; import WantAgent from '@ohos.wantAgent';
import { OperationType, WantAgentFlags } from '@ohos.wantagent';
//wantAgent对象 //wantAgent对象
var wantAgent; var wantAgent;
...@@ -467,9 +466,9 @@ var wantAgentInfo = { ...@@ -467,9 +466,9 @@ var wantAgentInfo = {
} }
} }
], ],
operationType: OperationType.START_ABILITIES, operationType: WantAgent.OperationType.START_ABILITIES,
requestCode: 0, requestCode: 0,
wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG] wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
} }
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback) WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback)
...@@ -507,7 +506,7 @@ getWant(agent: WantAgent): Promise\<Want\> ...@@ -507,7 +506,7 @@ getWant(agent: WantAgent): Promise\<Want\>
```js ```js
import WantAgent from '@ohos.wantAgent'; import WantAgent from '@ohos.wantAgent';
import { OperationType, WantAgentFlags } from '@ohos.wantagent';
//wantAgent对象 //wantAgent对象
var wantAgent; var wantAgent;
...@@ -535,9 +534,9 @@ var wantAgentInfo = { ...@@ -535,9 +534,9 @@ var wantAgentInfo = {
} }
} }
], ],
operationType: OperationType.START_ABILITIES, operationType: WantAgent.OperationType.START_ABILITIES,
requestCode: 0, requestCode: 0,
wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG] wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
} }
WantAgent.getWantAgent(wantAgentInfo).then((data) => { WantAgent.getWantAgent(wantAgentInfo).then((data) => {
...@@ -571,7 +570,7 @@ cancel(agent: WantAgent, callback: AsyncCallback\<void\>): void ...@@ -571,7 +570,7 @@ cancel(agent: WantAgent, callback: AsyncCallback\<void\>): void
```js ```js
import WantAgent from '@ohos.wantAgent'; import WantAgent from '@ohos.wantAgent';
import { OperationType, WantAgentFlags } from '@ohos.wantagent';
//wantAgent对象 //wantAgent对象
var wantAgent; var wantAgent;
...@@ -608,9 +607,9 @@ var wantAgentInfo = { ...@@ -608,9 +607,9 @@ var wantAgentInfo = {
} }
} }
], ],
operationType: OperationType.START_ABILITIES, operationType: WantAgent.OperationType.START_ABILITIES,
requestCode: 0, requestCode: 0,
wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG] wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
} }
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback) WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback)
...@@ -648,7 +647,7 @@ cancel(agent: WantAgent): Promise\<void\> ...@@ -648,7 +647,7 @@ cancel(agent: WantAgent): Promise\<void\>
```js ```js
import WantAgent from '@ohos.wantAgent'; import WantAgent from '@ohos.wantAgent';
import { OperationType, WantAgentFlags } from '@ohos.wantagent';
//wantAgent对象 //wantAgent对象
var wantAgent; var wantAgent;
...@@ -676,9 +675,9 @@ var wantAgentInfo = { ...@@ -676,9 +675,9 @@ var wantAgentInfo = {
} }
} }
], ],
operationType: OperationType.START_ABILITIES, operationType: WantAgent.OperationType.START_ABILITIES,
requestCode: 0, requestCode: 0,
wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG] wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
} }
WantAgent.getWantAgent(wantAgentInfo).then((data) => { WantAgent.getWantAgent(wantAgentInfo).then((data) => {
...@@ -713,7 +712,7 @@ trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback\<Complet ...@@ -713,7 +712,7 @@ trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback\<Complet
```js ```js
import WantAgent from '@ohos.wantAgent'; import WantAgent from '@ohos.wantAgent';
import { OperationType, WantAgentFlags } from '@ohos.wantagent';
//wantAgent对象 //wantAgent对象
var wantAgent; var wantAgent;
...@@ -750,9 +749,9 @@ var wantAgentInfo = { ...@@ -750,9 +749,9 @@ var wantAgentInfo = {
} }
} }
], ],
operationType: OperationType.START_ABILITIES, operationType: WantAgent.OperationType.START_ABILITIES,
requestCode: 0, requestCode: 0,
wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG] wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
} }
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback) WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback)
...@@ -790,7 +789,7 @@ equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback\<boolean\ ...@@ -790,7 +789,7 @@ equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback\<boolean\
```js ```js
import WantAgent from '@ohos.wantAgent'; import WantAgent from '@ohos.wantAgent';
import { OperationType, WantAgentFlags } from '@ohos.wantagent';
//wantAgent对象 //wantAgent对象
var wantAgent1; var wantAgent1;
...@@ -829,9 +828,9 @@ var wantAgentInfo = { ...@@ -829,9 +828,9 @@ var wantAgentInfo = {
} }
} }
], ],
operationType: OperationType.START_ABILITIES, operationType: WantAgent.OperationType.START_ABILITIES,
requestCode: 0, requestCode: 0,
wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG] wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
} }
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback) WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback)
...@@ -870,7 +869,7 @@ equal(agent: WantAgent, otherAgent: WantAgent): Promise\<boolean\> ...@@ -870,7 +869,7 @@ equal(agent: WantAgent, otherAgent: WantAgent): Promise\<boolean\>
```js ```js
import WantAgent from '@ohos.wantAgent'; import WantAgent from '@ohos.wantAgent';
import { OperationType, WantAgentFlags } from '@ohos.wantagent';
//wantAgent对象 //wantAgent对象
var wantAgent1; var wantAgent1;
...@@ -899,9 +898,9 @@ var wantAgentInfo = { ...@@ -899,9 +898,9 @@ var wantAgentInfo = {
} }
} }
], ],
operationType: OperationType.START_ABILITIES, operationType: WantAgent.OperationType.START_ABILITIES,
requestCode: 0, requestCode: 0,
wantAgentFlags:[WantAgentFlags.UPDATE_PRESENT_FLAG] wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
} }
WantAgent.getWantAgent(wantAgentInfo).then((data) => { WantAgent.getWantAgent(wantAgentInfo).then((data) => {
...@@ -961,7 +960,7 @@ var wantAgentInfo = { ...@@ -961,7 +960,7 @@ var wantAgentInfo = {
} }
} }
], ],
operationType: OperationType.START_ABILITIES, operationType: WantAgent.OperationType.START_ABILITIES,
requestCode: 0, requestCode: 0,
wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
} }
...@@ -1027,7 +1026,7 @@ var wantAgentInfo = { ...@@ -1027,7 +1026,7 @@ var wantAgentInfo = {
} }
} }
], ],
operationType: OperationType.START_ABILITIES, operationType: WantAgent.OperationType.START_ABILITIES,
requestCode: 0, requestCode: 0,
wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册