Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
84b2276d
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
84b2276d
编写于
5月 04, 2023
作者:
X
xinking129
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change code number
Signed-off-by:
N
xinking129
<
xinxin13@huawei.com
>
上级
07ca4882
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
24 deletion
+24
-24
ability/ability_runtime/actscrosscall/actscrosscallerrely/entry/src/main/ets/entryability/EntryAbility.ts
...allerrely/entry/src/main/ets/entryability/EntryAbility.ts
+2
-2
ability/ability_runtime/actscrosscall/actscrosscallerrely/entry/src/main/ets/serviceability/ServiceAbility.ts
...rrely/entry/src/main/ets/serviceability/ServiceAbility.ts
+2
-2
ability/ability_runtime/actscrosscall/actscrosscalltest/entry/src/main/ets/test/Ability.test.ets
...ctscrosscalltest/entry/src/main/ets/test/Ability.test.ets
+20
-20
未找到文件。
ability/ability_runtime/actscrosscall/actscrosscallerrely/entry/src/main/ets/entryability/EntryAbility.ts
浏览文件 @
84b2276d
...
...
@@ -97,7 +97,7 @@ export default class EntryAbility extends Ability {
})
}
if
(
actionStr
===
'
Acts_CrossUserCall_
31
00
'
)
{
if
(
actionStr
===
'
Acts_CrossUserCall_
29
00
'
)
{
var
caller
;
function
releaseCallback
(
data
)
{
console
.
info
(
'
====>
'
+
actionStr
+
'
releaseCallBack:
'
+
data
);
...
...
@@ -112,7 +112,7 @@ export default class EntryAbility extends Ability {
},
accountId
).
then
((
data
)
=>
{
caller
=
data
;
caller
.
onRelease
(
releaseCallback
);
let
param
=
new
MyParcelAble
(
3100
,
'
Acts_CrossUserCall_31
00
'
,
false
);
let
param
=
new
MyParcelAble
(
2900
,
'
Acts_CrossUserCall_29
00
'
,
false
);
caller
.
callWithResult
(
'
call
'
,
param
).
then
((
data
)
=>
{
var
result
=
new
MyParcelAble
(
0
,
''
,
false
);
data
.
readParcelable
(
result
);
...
...
ability/ability_runtime/actscrosscall/actscrosscallerrely/entry/src/main/ets/serviceability/ServiceAbility.ts
浏览文件 @
84b2276d
...
...
@@ -207,7 +207,7 @@ export default class ServiceAbility extends ServiceExtensionAbility {
})
}
if
(
actionStr
==
'
Acts_CrossUserCall_3
2
00
'
)
{
if
(
actionStr
==
'
Acts_CrossUserCall_3
0
00
'
)
{
var
caller
;
function
releaseCallback
(
data
)
{
console
.
info
(
'
====>
'
+
actionStr
+
'
releaseCallBack:
'
+
data
);
...
...
@@ -222,7 +222,7 @@ export default class ServiceAbility extends ServiceExtensionAbility {
},
accountId
).
then
((
data
)
=>
{
caller
=
data
;
caller
.
onRelease
(
releaseCallback
);
let
param
=
new
MyParcelAble
(
3
200
,
'
Acts_CrossUserCall_32
00
'
,
false
);
let
param
=
new
MyParcelAble
(
3
000
,
'
Acts_CrossUserCall_30
00
'
,
false
);
caller
.
callWithResult
(
'
call
'
,
param
).
then
((
data
)
=>
{
var
result
=
new
MyParcelAble
(
0
,
''
,
false
);
data
.
readParcelable
(
result
);
...
...
ability/ability_runtime/actscrosscall/actscrosscalltest/entry/src/main/ets/test/Ability.test.ets
浏览文件 @
84b2276d
...
...
@@ -823,37 +823,37 @@ export default function abilityTest() {
})
/*
* @tc.number: Acts_CrossUserCall_
31
00
* @tc.number: Acts_CrossUserCall_
29
00
* @tc.name: Support for cross-UserID background call calls
* @tc.desc: The Caller.release interface of UIAbility under the same account executes normally.
*/
it('Acts_CrossUserCall_
31
00',0, async function (done) {
it('Acts_CrossUserCall_
29
00',0, async function (done) {
var subscriber;
var eventCount = 0;
console.info('====>Acts_CrossUserCall_
31
00 start');
console.info('====>Acts_CrossUserCall_
29
00 start');
commonEvent.createSubscriber(ACTS_CrossCallFunction).then(async (data) => {
console.info('====>Acts_CrossUserCall_
31
00 Create Subscribe');
console.info('====>Acts_CrossUserCall_
29
00 Create Subscribe');
subscriber = data;
commonEvent.subscribe(subscriber, subscribeCallBack);
globalThis.abilityContext.startAbility({
bundleName: 'com.acts.actscallability',
abilityName: 'EntryAbility',
parameters: {
action: 'Acts_CrossUserCall_
31
00',
action: 'Acts_CrossUserCall_
29
00',
accountId: -1
}
},(err) => {
console.info('====>Acts_CrossUserCall_
31
00 startAbility err:' + JSON.stringify(err));
console.info('====>Acts_CrossUserCall_
29
00 startAbility err:' + JSON.stringify(err));
expect(err.code).assertEqual(0);
})
})
function subscribeCallBack(err, data) {
console.info('====>Acts_CrossUserCall_
31
00 subscribeCallBack data:' + JSON.stringify(data));
console.info('====>Acts_CrossUserCall_
29
00 subscribeCallBack data:' + JSON.stringify(data));
if (data.event === 'ACTS_CROSS_CALL_EVENT') {
eventCount++;
expect(data.parameters.message.num).assertEqual(
31
00);
expect(data.parameters.message.str).assertEqual('Acts_CrossUserCall_
31
00 processed');
expect(data.parameters.message.num).assertEqual(
29
00);
expect(data.parameters.message.str).assertEqual('Acts_CrossUserCall_
29
00 processed');
expect(data.parameters.message.result).assertTrue();
}
if (data.event === 'ACTS_CROSS_RELEASE_EVENT') {
...
...
@@ -866,7 +866,7 @@ export default function abilityTest() {
}
function unSubscribeCallback() {
console.info('====>Acts_CrossUserCall_
31
00 unSubscribeCallback');
console.info('====>Acts_CrossUserCall_
29
00 unSubscribeCallback');
done();
}
...
...
@@ -879,37 +879,37 @@ export default function abilityTest() {
})
/*
* @tc.number: Acts_CrossUserCall_3
2
00
* @tc.number: Acts_CrossUserCall_3
0
00
* @tc.name: Support for cross-UserID background call calls
* @tc.desc: The Caller.release interface of ServiceExtension under the same account executes normally.
*/
it('Acts_CrossUserCall_3
2
00',0, async function (done) {
it('Acts_CrossUserCall_3
0
00',0, async function (done) {
var subscriber;
var eventCount = 0;
console.info('====>Acts_CrossUserCall_3
2
00 start');
console.info('====>Acts_CrossUserCall_3
0
00 start');
commonEvent.createSubscriber(ACTS_CrossCallFunction).then(async (data) => {
console.info('====>Acts_CrossUserCall_3
2
00 Create Subscribe');
console.info('====>Acts_CrossUserCall_3
0
00 Create Subscribe');
subscriber = data;
commonEvent.subscribe(subscriber, subscribeCallBack);
globalThis.abilityContext.startAbility({
bundleName: 'com.acts.actscallability',
abilityName: 'ServiceAbility',
parameters: {
action: 'Acts_CrossUserCall_3
2
00',
action: 'Acts_CrossUserCall_3
0
00',
accountId: -1
}
},(err) => {
console.info('====>Acts_CrossUserCall_3
2
00 startAbility err:' + JSON.stringify(err));
console.info('====>Acts_CrossUserCall_3
0
00 startAbility err:' + JSON.stringify(err));
expect(err.code).assertEqual(0);
})
})
function subscribeCallBack(err, data) {
console.info('====>Acts_CrossUserCall_3
2
00 subscribeCallBack data:' + JSON.stringify(data));
console.info('====>Acts_CrossUserCall_3
0
00 subscribeCallBack data:' + JSON.stringify(data));
if (data.event === 'ACTS_CROSS_CALL_EVENT') {
eventCount++;
expect(data.parameters.message.num).assertEqual(3
2
00);
expect(data.parameters.message.str).assertEqual('Acts_CrossUserCall_3
2
00 processed');
expect(data.parameters.message.num).assertEqual(3
0
00);
expect(data.parameters.message.str).assertEqual('Acts_CrossUserCall_3
0
00 processed');
expect(data.parameters.message.result).assertTrue();
}
if (data.event === 'ACTS_CROSS_RELEASE_EVENT') {
...
...
@@ -922,7 +922,7 @@ export default function abilityTest() {
}
function unSubscribeCallback() {
console.info('====>Acts_CrossUserCall_3
2
00 unSubscribeCallback');
console.info('====>Acts_CrossUserCall_3
0
00 unSubscribeCallback');
done();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录