Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
6528a310
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看板
未验证
提交
6528a310
编写于
5月 28, 2022
作者:
O
openharmony_ci
提交者:
Gitee
5月 28, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4543 Fix code error of ability
Merge pull request !4543 from yuyaozhi/master
上级
a76cc6ff
9e01c802
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
75 addition
and
68 deletion
+75
-68
zh-cn/application-dev/reference/apis/js-apis-ability-context.md
...application-dev/reference/apis/js-apis-ability-context.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-appmanager.md
zh-cn/application-dev/reference/apis/js-apis-appmanager.md
+4
-4
zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md
...plication-dev/reference/apis/js-apis-dataAbilityHelper.md
+11
-10
zh-cn/application-dev/reference/apis/js-apis-formextension.md
...n/application-dev/reference/apis/js-apis-formextension.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-particleAbility.md
...application-dev/reference/apis/js-apis-particleAbility.md
+16
-9
zh-cn/application-dev/reference/apis/js-apis-service-extension-ability.md
...n-dev/reference/apis/js-apis-service-extension-ability.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-wantAgent.md
zh-cn/application-dev/reference/apis/js-apis-wantAgent.md
+40
-41
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-ability-context.md
浏览文件 @
6528a310
...
@@ -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
'
+
call
er
);
}).
catch
((
e
)
=>
{
}).
catch
((
e
)
=>
{
console
.
log
(
'
Caller GetCaller error
'
+
e
);
console
.
log
(
'
Caller GetCaller error
'
+
e
);
});
});
...
...
zh-cn/application-dev/reference/apis/js-apis-appmanager.md
浏览文件 @
6528a310
...
@@ -82,7 +82,7 @@ isRamConstrainedDevice(): Promise\<boolean>;
...
@@ -82,7 +82,7 @@ isRamConstrainedDevice(): Promise\<boolean>;
**示例:**
**示例:**
```
js
```
js
app
.
isRamConstrainedDevice
Promise
().
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
.
isRamConstrainedDevice
Promise
((
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
.
G
etProcessRunningInfos
().
then
((
data
)
=>
{
app
.
g
etProcessRunningInfos
().
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
.
G
etProcessRunningInfos
((
err
,
data
)
=>
{
app
.
g
etProcessRunningInfos
((
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
));
})
})
...
...
zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md
浏览文件 @
6528a310
...
@@ -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
(
...
...
zh-cn/application-dev/reference/apis/js-apis-formextension.md
浏览文件 @
6528a310
...
@@ -213,7 +213,7 @@ onConfigurationUpdated(config: Configuration): void;
...
@@ -213,7 +213,7 @@ onConfigurationUpdated(config: Configuration): void;
**示例:**
**示例:**
```
js
```
js
class
MyFormExtension
extends
My
FormExtension
{
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
My
FormExtension
{
class
MyFormExtension
extends
FormExtension
{
onAcquireFormState
(
want
)
{
onAcquireFormState
(
want
)
{
console
.
log
(
'
FormExtension onAcquireFormState, want:
'
+
want
);
console
.
log
(
'
FormExtension onAcquireFormState, want:
'
+
want
);
}
}
...
...
zh-cn/application-dev/reference/apis/js-apis-particleAbility.md
浏览文件 @
6528a310
...
@@ -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
)
});
});
```
```
...
...
zh-cn/application-dev/reference/apis/js-apis-service-extension-ability.md
浏览文件 @
6528a310
...
@@ -126,7 +126,7 @@ Extension生命周期回调,如果是connectAbility拉起的服务,会在onC
...
@@ -126,7 +126,7 @@ Extension生命周期回调,如果是connectAbility拉起的服务,会在onC
constructor
(
des
)
{
constructor
(
des
)
{
super
(
des
);
super
(
des
);
}
}
on
RemoteReques
t
(
code
,
data
,
reply
,
option
)
{
on
Connec
t
(
code
,
data
,
reply
,
option
)
{
}
}
}
}
class
ServiceExt
extends
ServiceExtension
{
class
ServiceExt
extends
ServiceExtension
{
...
...
zh-cn/application-dev/reference/apis/js-apis-wantAgent.md
浏览文件 @
6528a310
...
@@ -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
.
WantAgent
Flags
.
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
.
WantAgent
Flags
.
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
.
WantAgent
Flags
.
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
.
WantAgent
Flags
.
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
.
WantAgent
Flags
.
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
.
WantAgent
Flags
.
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
.
WantAgent
Flags
.
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
.
WantAgent
Flags
.
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
.
WantAgent
Flags
.
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
.
WantAgent
Flags
.
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
.
WantAgent
Flags
.
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
.
WantAgent
Flags
.
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
.
WantAgent
Flags
.
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录