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