Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
36e0b77c
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看板
提交
36e0b77c
编写于
4月 11, 2023
作者:
Z
zhoujun62
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
solve xts problem
Signed-off-by:
N
zhoujun62
<
zhoujun62@huawei.com
>
上级
f46cc2c3
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
74 addition
and
68 deletion
+74
-68
ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaShowOnLock.test.ets
...unctiontest/entry/src/main/ets/test/FaShowOnLock.test.ets
+40
-48
ability/ability_runtime/actssupportfunction/fasupportfunction/entry/src/main/ets/MainAbility/app.ets
.../fasupportfunction/entry/src/main/ets/MainAbility/app.ets
+27
-11
ability/ability_runtime/actssupportfunction/fasupportfunction/entry/src/main/ets/MainAbility2/app.ets
...fasupportfunction/entry/src/main/ets/MainAbility2/app.ets
+7
-9
未找到文件。
ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaShowOnLock.test.ets
浏览文件 @
36e0b77c
...
...
@@ -105,12 +105,12 @@ export default function FaShowOnLockTest() {
let status1 = undefined;
let status2 = undefined;
let lifeList = [];
let listCheck = ["onCreate", "
onActive
"];
let
onActive = "Fa_SupportFunction_MainAbility_onActive
";
let listCheck = ["onCreate", "
wakeUpScreen
"];
let
wakeUpScreen = "Fa_SupportFunction_MainAbility_wakeUpScreen
";
var subscriber;
var subscribeInfo = {
events: [
onActive
]
events: [
wakeUpScreen
]
}
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...
...
@@ -119,7 +119,7 @@ export default function FaShowOnLockTest() {
commonEvent.subscribe(subscriber, async (err, data) => {
console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
if (data.event ==
onActive
) {
if (data.event ==
wakeUpScreen
) {
lifeList = data.parameters.lifeList;
setTimeout(async () => {
await power.isScreenOn().then((data) => {
...
...
@@ -162,8 +162,7 @@ export default function FaShowOnLockTest() {
bundleName: "ohos.acts.aafwk.test.fasupportfunction",
abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility",
parameters: {
number: 1,
flag: true
number: 1
}
}
await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
...
...
@@ -187,12 +186,12 @@ export default function FaShowOnLockTest() {
let status1 = undefined;
let status2 = undefined;
let lifeList = [];
let listCheck = ["onCreate", "
onActive
"];
let
onActive = "Fa_SupportFunction_MainAbility_onActive
";
let listCheck = ["onCreate", "
wakeUpScreen
"];
let
wakeUpScreen = "Fa_SupportFunction_MainAbility_wakeUpScreen
";
var subscriber;
var subscribeInfo = {
events: [
onActive
]
events: [
wakeUpScreen
]
}
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...
...
@@ -201,7 +200,7 @@ export default function FaShowOnLockTest() {
commonEvent.subscribe(subscriber, async (err, data) => {
console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
if (data.event ==
onActive
) {
if (data.event ==
wakeUpScreen
) {
lifeList = data.parameters.lifeList;
setTimeout(async () => {
await power.isScreenOn().then((data) => {
...
...
@@ -244,8 +243,7 @@ export default function FaShowOnLockTest() {
bundleName: "ohos.acts.aafwk.test.fasupportfunction",
abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility",
parameters: {
number: 2,
flag: true
number: 2
}
}
await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
...
...
@@ -269,12 +267,12 @@ export default function FaShowOnLockTest() {
let status1 = undefined;
let status2 = undefined;
let lifeList = [];
let listCheck = ["onCreate", "
onActive
"];
let
onActive = "Fa_SupportFunction_MainAbility_onActive
";
let listCheck = ["onCreate", "
wakeUpScreen
"];
let
wakeUpScreen = "Fa_SupportFunction_MainAbility_wakeUpScreen
";
var subscriber;
var subscribeInfo = {
events: [
onActive
]
events: [
wakeUpScreen
]
}
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...
...
@@ -283,7 +281,7 @@ export default function FaShowOnLockTest() {
commonEvent.subscribe(subscriber, async (err, data) => {
console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
if (data.event ==
onActive
) {
if (data.event ==
wakeUpScreen
) {
lifeList = data.parameters.lifeList;
setTimeout(async () => {
await power.isScreenOn().then((data) => {
...
...
@@ -326,8 +324,7 @@ export default function FaShowOnLockTest() {
bundleName: "ohos.acts.aafwk.test.fasupportfunction",
abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility",
parameters: {
number: 3,
flag: true
number: 3
}
}
await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
...
...
@@ -352,13 +349,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined;
let status3 = undefined;
let lifeList = [];
let listCheck = ["onCreate", "
onActive
"];
let
onActive = "Fa_SupportFunction_MainAbility2_onActive
";
let listCheck = ["onCreate", "
wakeUpScreen
"];
let
wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen
";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber;
var subscribeInfo = {
events: [
onActive
, wakeUpErr]
events: [
wakeUpScreen
, wakeUpErr]
}
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...
...
@@ -371,7 +368,7 @@ export default function FaShowOnLockTest() {
status3 = true;
}
if (data.event ==
onActive
) {
if (data.event ==
wakeUpScreen
) {
lifeList = data.parameters.lifeList;
setTimeout(async () => {
await power.isScreenOn().then((data) => {
...
...
@@ -415,8 +412,7 @@ export default function FaShowOnLockTest() {
bundleName: "ohos.acts.aafwk.test.fasupportfunction",
abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2",
parameters: {
number: 1,
flag: true
number: 1
}
}
await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
...
...
@@ -441,13 +437,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined;
let status3 = undefined;
let lifeList = [];
let listCheck = ["onCreate", "
onActive
"];
let
onActive = "Fa_SupportFunction_MainAbility2_onActive
";
let listCheck = ["onCreate", "
wakeUpScreen
"];
let
wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen
";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber;
var subscribeInfo = {
events: [
onActive
, wakeUpErr]
events: [
wakeUpScreen
, wakeUpErr]
}
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...
...
@@ -460,7 +456,7 @@ export default function FaShowOnLockTest() {
status3 = true;
}
if (data.event ==
onActive
) {
if (data.event ==
wakeUpScreen
) {
lifeList = data.parameters.lifeList;
setTimeout(async () => {
await power.isScreenOn().then((data) => {
...
...
@@ -504,8 +500,7 @@ export default function FaShowOnLockTest() {
bundleName: "ohos.acts.aafwk.test.fasupportfunction",
abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2",
parameters: {
number: 2,
flag: true
number: 2
}
}
await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
...
...
@@ -530,13 +525,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined;
let status3 = undefined;
let lifeList = [];
let listCheck = ["onCreate", "
onActive
"];
let
onActive = "Fa_SupportFunction_MainAbility2_onActive
";
let listCheck = ["onCreate", "
wakeUpScreen
"];
let
wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen
";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber;
var subscribeInfo = {
events: [
onActive
, wakeUpErr]
events: [
wakeUpScreen
, wakeUpErr]
}
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...
...
@@ -549,7 +544,7 @@ export default function FaShowOnLockTest() {
status3 = true;
}
if (data.event ==
onActive
) {
if (data.event ==
wakeUpScreen
) {
lifeList = data.parameters.lifeList;
setTimeout(async () => {
await power.isScreenOn().then((data) => {
...
...
@@ -593,8 +588,7 @@ export default function FaShowOnLockTest() {
bundleName: "ohos.acts.aafwk.test.fasupportfunction",
abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2",
parameters: {
number: 3,
flag: true
number: 3
}
}
await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
...
...
@@ -619,13 +613,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined;
let status3 = undefined;
let lifeList = [];
let listCheck = ["onCreate", "
onActive
"];
let
onActive = "Fa_SupportFunction_MainAbility2_onActive
";
let listCheck = ["onCreate", "
wakeUpScreen
"];
let
wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen
";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber;
var subscribeInfo = {
events: [
onActive
, wakeUpErr]
events: [
wakeUpScreen
, wakeUpErr]
}
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...
...
@@ -638,7 +632,7 @@ export default function FaShowOnLockTest() {
status3 = true;
}
if (data.event ==
onActive
) {
if (data.event ==
wakeUpScreen
) {
lifeList = data.parameters.lifeList;
setTimeout(async () => {
await power.isScreenOn().then((data) => {
...
...
@@ -682,8 +676,7 @@ export default function FaShowOnLockTest() {
bundleName: "ohos.acts.aafwk.test.fasupportfunction",
abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2",
parameters: {
number: 4,
flag: true
number: 4
}
}
await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
...
...
@@ -708,13 +701,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined;
let status3 = undefined;
let lifeList = [];
let listCheck = ["onCreate", "
onActive
"];
let
onActive = "Fa_SupportFunction_MainAbility2_onActive
";
let listCheck = ["onCreate", "
wakeUpScreen
"];
let
wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen
";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber;
var subscribeInfo = {
events: [
onActive
, wakeUpErr]
events: [
wakeUpScreen
, wakeUpErr]
}
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...
...
@@ -727,7 +720,7 @@ export default function FaShowOnLockTest() {
status3 = true;
}
if (data.event ==
onActive
) {
if (data.event ==
wakeUpScreen
) {
lifeList = data.parameters.lifeList;
setTimeout(async () => {
await power.isScreenOn().then((data) => {
...
...
@@ -771,8 +764,7 @@ export default function FaShowOnLockTest() {
bundleName: "ohos.acts.aafwk.test.fasupportfunction",
abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2",
parameters: {
number: 5,
flag: true
number: 5
}
}
await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
...
...
ability/ability_runtime/actssupportfunction/fasupportfunction/entry/src/main/ets/MainAbility/app.ets
浏览文件 @
36e0b77c
...
...
@@ -30,6 +30,15 @@ export default {
try {
ability_featureAbility.getContext().setWakeUpScreen(true).then((data) => {
console.log(TAG1 + "setWakeUpScreen data = " + JSON.stringify(data));
lifeList.push('wakeUpScreen');
let options = {
parameters: {
lifeList: lifeList
}
}
commonEvent.publish(listPush1 + "wakeUpScreen", options, (err) => {
console.log(TAG1 + listPush1 + "wakeUpScreen");
});
}).catch((error) => {
console.log(TAG1 + "setWakeUpScreen error = " + JSON.stringify(error));
})
...
...
@@ -41,29 +50,36 @@ export default {
ability_featureAbility.getContext().setWakeUpScreen(true, (error, data) => {
console.log(TAG1 + "setWakeUpScreen data = " + JSON.stringify(data));
console.log(TAG1 + "setWakeUpScreen error = " + JSON.stringify(error));
lifeList.push('wakeUpScreen');
let options = {
parameters: {
lifeList: lifeList
}
}
commonEvent.publish(listPush1 + "wakeUpScreen", options, (err) => {
console.log(TAG1 + listPush1 + "wakeUpScreen");
});
})
}
if(data.parameters.number == 3) {
try {
ability_featureAbility.getContext().setWakeUpScreen(false).then((data) => {
console.log(TAG1 + "setWakeUpScreen data = " + JSON.stringify(data));
}).catch((error) => {
console.log(TAG1 + "setWakeUpScreen error = " + JSON.stringify(error));
})
} catch(error) {
console.log(TAG1 + "setWakeUpScreen catch error = " + JSON.stringify(error));
}
}
if (data.parameters.flag) {
lifeList.push('onActive');
lifeList.push('wakeUpScreen');
let options = {
parameters: {
lifeList: lifeList
}
}
commonEvent.publish(listPush1 + "onActive
", options, (err) => {
console.log(TAG1 + listPush1 + "onActive
");
commonEvent.publish(listPush1 + "wakeUpScreen
", options, (err) => {
console.log(TAG1 + listPush1 + "wakeUpScreen
");
});
}).catch((error) => {
console.log(TAG1 + "setWakeUpScreen error = " + JSON.stringify(error));
})
} catch(error) {
console.log(TAG1 + "setWakeUpScreen catch error = " + JSON.stringify(error));
}
}
}).catch((error) => {
console.log(TAG1 + "getWant error = " + JSON.stringify(error));
...
...
ability/ability_runtime/actssupportfunction/fasupportfunction/entry/src/main/ets/MainAbility2/app.ets
浏览文件 @
36e0b77c
...
...
@@ -42,17 +42,15 @@ export default {
setWakeUpScreenP(ability_featureAbility, {status1: true, status2: true})
}
await sleep(300);
if (data.parameters.flag) {
lifeList.push('onActive');
lifeList.push('wakeUpScreen');
let options = {
parameters: {
lifeList: lifeList
}
}
commonEvent.publish(listPush1 + "onActive
", options, (err) => {
console.log(TAG1 + listPush1 + "onActive
");
commonEvent.publish(listPush1 + "wakeUpScreen
", options, (err) => {
console.log(TAG1 + listPush1 + "wakeUpScreen
");
});
}
}).catch((error) => {
console.log(TAG1 + "getWant error = " + JSON.stringify(error));
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录