提交 36e0b77c 编写于 作者: Z zhoujun62

solve xts problem

Signed-off-by: Nzhoujun62 <zhoujun62@huawei.com>
上级 f46cc2c3
...@@ -105,12 +105,12 @@ export default function FaShowOnLockTest() { ...@@ -105,12 +105,12 @@ export default function FaShowOnLockTest() {
let status1 = undefined; let status1 = undefined;
let status2 = undefined; let status2 = undefined;
let lifeList = []; let lifeList = [];
let listCheck = ["onCreate", "onActive"]; let listCheck = ["onCreate", "wakeUpScreen"];
let onActive = "Fa_SupportFunction_MainAbility_onActive"; let wakeUpScreen = "Fa_SupportFunction_MainAbility_wakeUpScreen";
var subscriber; var subscriber;
var subscribeInfo = { var subscribeInfo = {
events: [onActive] events: [wakeUpScreen]
} }
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data)); console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...@@ -119,7 +119,7 @@ export default function FaShowOnLockTest() { ...@@ -119,7 +119,7 @@ export default function FaShowOnLockTest() {
commonEvent.subscribe(subscriber, async (err, data) => { commonEvent.subscribe(subscriber, async (err, data) => {
console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data)); console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
if (data.event == onActive) { if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList; lifeList = data.parameters.lifeList;
setTimeout(async () => { setTimeout(async () => {
await power.isScreenOn().then((data) => { await power.isScreenOn().then((data) => {
...@@ -162,8 +162,7 @@ export default function FaShowOnLockTest() { ...@@ -162,8 +162,7 @@ export default function FaShowOnLockTest() {
bundleName: "ohos.acts.aafwk.test.fasupportfunction", bundleName: "ohos.acts.aafwk.test.fasupportfunction",
abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility", abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility",
parameters: { parameters: {
number: 1, number: 1
flag: true
} }
} }
await globalThis.abilityTestContext.startAbility(wantNum).then((data) => { await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
...@@ -187,12 +186,12 @@ export default function FaShowOnLockTest() { ...@@ -187,12 +186,12 @@ export default function FaShowOnLockTest() {
let status1 = undefined; let status1 = undefined;
let status2 = undefined; let status2 = undefined;
let lifeList = []; let lifeList = [];
let listCheck = ["onCreate", "onActive"]; let listCheck = ["onCreate", "wakeUpScreen"];
let onActive = "Fa_SupportFunction_MainAbility_onActive"; let wakeUpScreen = "Fa_SupportFunction_MainAbility_wakeUpScreen";
var subscriber; var subscriber;
var subscribeInfo = { var subscribeInfo = {
events: [onActive] events: [wakeUpScreen]
} }
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data)); console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...@@ -201,7 +200,7 @@ export default function FaShowOnLockTest() { ...@@ -201,7 +200,7 @@ export default function FaShowOnLockTest() {
commonEvent.subscribe(subscriber, async (err, data) => { commonEvent.subscribe(subscriber, async (err, data) => {
console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data)); console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
if (data.event == onActive) { if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList; lifeList = data.parameters.lifeList;
setTimeout(async () => { setTimeout(async () => {
await power.isScreenOn().then((data) => { await power.isScreenOn().then((data) => {
...@@ -244,8 +243,7 @@ export default function FaShowOnLockTest() { ...@@ -244,8 +243,7 @@ export default function FaShowOnLockTest() {
bundleName: "ohos.acts.aafwk.test.fasupportfunction", bundleName: "ohos.acts.aafwk.test.fasupportfunction",
abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility", abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility",
parameters: { parameters: {
number: 2, number: 2
flag: true
} }
} }
await globalThis.abilityTestContext.startAbility(wantNum).then((data) => { await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
...@@ -269,12 +267,12 @@ export default function FaShowOnLockTest() { ...@@ -269,12 +267,12 @@ export default function FaShowOnLockTest() {
let status1 = undefined; let status1 = undefined;
let status2 = undefined; let status2 = undefined;
let lifeList = []; let lifeList = [];
let listCheck = ["onCreate", "onActive"]; let listCheck = ["onCreate", "wakeUpScreen"];
let onActive = "Fa_SupportFunction_MainAbility_onActive"; let wakeUpScreen = "Fa_SupportFunction_MainAbility_wakeUpScreen";
var subscriber; var subscriber;
var subscribeInfo = { var subscribeInfo = {
events: [onActive] events: [wakeUpScreen]
} }
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data)); console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...@@ -283,7 +281,7 @@ export default function FaShowOnLockTest() { ...@@ -283,7 +281,7 @@ export default function FaShowOnLockTest() {
commonEvent.subscribe(subscriber, async (err, data) => { commonEvent.subscribe(subscriber, async (err, data) => {
console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data)); console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
if (data.event == onActive) { if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList; lifeList = data.parameters.lifeList;
setTimeout(async () => { setTimeout(async () => {
await power.isScreenOn().then((data) => { await power.isScreenOn().then((data) => {
...@@ -326,8 +324,7 @@ export default function FaShowOnLockTest() { ...@@ -326,8 +324,7 @@ export default function FaShowOnLockTest() {
bundleName: "ohos.acts.aafwk.test.fasupportfunction", bundleName: "ohos.acts.aafwk.test.fasupportfunction",
abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility", abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility",
parameters: { parameters: {
number: 3, number: 3
flag: true
} }
} }
await globalThis.abilityTestContext.startAbility(wantNum).then((data) => { await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
...@@ -352,13 +349,13 @@ export default function FaShowOnLockTest() { ...@@ -352,13 +349,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined; let status2 = undefined;
let status3 = undefined; let status3 = undefined;
let lifeList = []; let lifeList = [];
let listCheck = ["onCreate", "onActive"]; let listCheck = ["onCreate", "wakeUpScreen"];
let onActive = "Fa_SupportFunction_MainAbility2_onActive"; let wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr"; let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber; var subscriber;
var subscribeInfo = { var subscribeInfo = {
events: [onActive, wakeUpErr] events: [wakeUpScreen, wakeUpErr]
} }
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data)); console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...@@ -371,7 +368,7 @@ export default function FaShowOnLockTest() { ...@@ -371,7 +368,7 @@ export default function FaShowOnLockTest() {
status3 = true; status3 = true;
} }
if (data.event == onActive) { if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList; lifeList = data.parameters.lifeList;
setTimeout(async () => { setTimeout(async () => {
await power.isScreenOn().then((data) => { await power.isScreenOn().then((data) => {
...@@ -415,8 +412,7 @@ export default function FaShowOnLockTest() { ...@@ -415,8 +412,7 @@ export default function FaShowOnLockTest() {
bundleName: "ohos.acts.aafwk.test.fasupportfunction", bundleName: "ohos.acts.aafwk.test.fasupportfunction",
abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2", abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2",
parameters: { parameters: {
number: 1, number: 1
flag: true
} }
} }
await globalThis.abilityTestContext.startAbility(wantNum).then((data) => { await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
...@@ -441,13 +437,13 @@ export default function FaShowOnLockTest() { ...@@ -441,13 +437,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined; let status2 = undefined;
let status3 = undefined; let status3 = undefined;
let lifeList = []; let lifeList = [];
let listCheck = ["onCreate", "onActive"]; let listCheck = ["onCreate", "wakeUpScreen"];
let onActive = "Fa_SupportFunction_MainAbility2_onActive"; let wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr"; let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber; var subscriber;
var subscribeInfo = { var subscribeInfo = {
events: [onActive, wakeUpErr] events: [wakeUpScreen, wakeUpErr]
} }
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data)); console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...@@ -460,7 +456,7 @@ export default function FaShowOnLockTest() { ...@@ -460,7 +456,7 @@ export default function FaShowOnLockTest() {
status3 = true; status3 = true;
} }
if (data.event == onActive) { if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList; lifeList = data.parameters.lifeList;
setTimeout(async () => { setTimeout(async () => {
await power.isScreenOn().then((data) => { await power.isScreenOn().then((data) => {
...@@ -504,8 +500,7 @@ export default function FaShowOnLockTest() { ...@@ -504,8 +500,7 @@ export default function FaShowOnLockTest() {
bundleName: "ohos.acts.aafwk.test.fasupportfunction", bundleName: "ohos.acts.aafwk.test.fasupportfunction",
abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2", abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2",
parameters: { parameters: {
number: 2, number: 2
flag: true
} }
} }
await globalThis.abilityTestContext.startAbility(wantNum).then((data) => { await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
...@@ -530,13 +525,13 @@ export default function FaShowOnLockTest() { ...@@ -530,13 +525,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined; let status2 = undefined;
let status3 = undefined; let status3 = undefined;
let lifeList = []; let lifeList = [];
let listCheck = ["onCreate", "onActive"]; let listCheck = ["onCreate", "wakeUpScreen"];
let onActive = "Fa_SupportFunction_MainAbility2_onActive"; let wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr"; let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber; var subscriber;
var subscribeInfo = { var subscribeInfo = {
events: [onActive, wakeUpErr] events: [wakeUpScreen, wakeUpErr]
} }
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data)); console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...@@ -549,7 +544,7 @@ export default function FaShowOnLockTest() { ...@@ -549,7 +544,7 @@ export default function FaShowOnLockTest() {
status3 = true; status3 = true;
} }
if (data.event == onActive) { if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList; lifeList = data.parameters.lifeList;
setTimeout(async () => { setTimeout(async () => {
await power.isScreenOn().then((data) => { await power.isScreenOn().then((data) => {
...@@ -593,8 +588,7 @@ export default function FaShowOnLockTest() { ...@@ -593,8 +588,7 @@ export default function FaShowOnLockTest() {
bundleName: "ohos.acts.aafwk.test.fasupportfunction", bundleName: "ohos.acts.aafwk.test.fasupportfunction",
abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2", abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2",
parameters: { parameters: {
number: 3, number: 3
flag: true
} }
} }
await globalThis.abilityTestContext.startAbility(wantNum).then((data) => { await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
...@@ -619,13 +613,13 @@ export default function FaShowOnLockTest() { ...@@ -619,13 +613,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined; let status2 = undefined;
let status3 = undefined; let status3 = undefined;
let lifeList = []; let lifeList = [];
let listCheck = ["onCreate", "onActive"]; let listCheck = ["onCreate", "wakeUpScreen"];
let onActive = "Fa_SupportFunction_MainAbility2_onActive"; let wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr"; let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber; var subscriber;
var subscribeInfo = { var subscribeInfo = {
events: [onActive, wakeUpErr] events: [wakeUpScreen, wakeUpErr]
} }
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data)); console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...@@ -638,7 +632,7 @@ export default function FaShowOnLockTest() { ...@@ -638,7 +632,7 @@ export default function FaShowOnLockTest() {
status3 = true; status3 = true;
} }
if (data.event == onActive) { if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList; lifeList = data.parameters.lifeList;
setTimeout(async () => { setTimeout(async () => {
await power.isScreenOn().then((data) => { await power.isScreenOn().then((data) => {
...@@ -682,8 +676,7 @@ export default function FaShowOnLockTest() { ...@@ -682,8 +676,7 @@ export default function FaShowOnLockTest() {
bundleName: "ohos.acts.aafwk.test.fasupportfunction", bundleName: "ohos.acts.aafwk.test.fasupportfunction",
abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2", abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2",
parameters: { parameters: {
number: 4, number: 4
flag: true
} }
} }
await globalThis.abilityTestContext.startAbility(wantNum).then((data) => { await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
...@@ -708,13 +701,13 @@ export default function FaShowOnLockTest() { ...@@ -708,13 +701,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined; let status2 = undefined;
let status3 = undefined; let status3 = undefined;
let lifeList = []; let lifeList = [];
let listCheck = ["onCreate", "onActive"]; let listCheck = ["onCreate", "wakeUpScreen"];
let onActive = "Fa_SupportFunction_MainAbility2_onActive"; let wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr"; let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber; var subscriber;
var subscribeInfo = { var subscribeInfo = {
events: [onActive, wakeUpErr] events: [wakeUpScreen, wakeUpErr]
} }
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data)); console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...@@ -727,7 +720,7 @@ export default function FaShowOnLockTest() { ...@@ -727,7 +720,7 @@ export default function FaShowOnLockTest() {
status3 = true; status3 = true;
} }
if (data.event == onActive) { if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList; lifeList = data.parameters.lifeList;
setTimeout(async () => { setTimeout(async () => {
await power.isScreenOn().then((data) => { await power.isScreenOn().then((data) => {
...@@ -771,8 +764,7 @@ export default function FaShowOnLockTest() { ...@@ -771,8 +764,7 @@ export default function FaShowOnLockTest() {
bundleName: "ohos.acts.aafwk.test.fasupportfunction", bundleName: "ohos.acts.aafwk.test.fasupportfunction",
abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2", abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2",
parameters: { parameters: {
number: 5, number: 5
flag: true
} }
} }
await globalThis.abilityTestContext.startAbility(wantNum).then((data) => { await globalThis.abilityTestContext.startAbility(wantNum).then((data) => {
......
...@@ -30,6 +30,15 @@ export default { ...@@ -30,6 +30,15 @@ export default {
try { try {
ability_featureAbility.getContext().setWakeUpScreen(true).then((data) => { ability_featureAbility.getContext().setWakeUpScreen(true).then((data) => {
console.log(TAG1 + "setWakeUpScreen data = " + JSON.stringify(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) => { }).catch((error) => {
console.log(TAG1 + "setWakeUpScreen error = " + JSON.stringify(error)); console.log(TAG1 + "setWakeUpScreen error = " + JSON.stringify(error));
}) })
...@@ -41,12 +50,30 @@ export default { ...@@ -41,12 +50,30 @@ export default {
ability_featureAbility.getContext().setWakeUpScreen(true, (error, data) => { ability_featureAbility.getContext().setWakeUpScreen(true, (error, data) => {
console.log(TAG1 + "setWakeUpScreen data = " + JSON.stringify(data)); console.log(TAG1 + "setWakeUpScreen data = " + JSON.stringify(data));
console.log(TAG1 + "setWakeUpScreen error = " + JSON.stringify(error)); 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) { if(data.parameters.number == 3) {
try { try {
ability_featureAbility.getContext().setWakeUpScreen(false).then((data) => { ability_featureAbility.getContext().setWakeUpScreen(false).then((data) => {
console.log(TAG1 + "setWakeUpScreen data = " + JSON.stringify(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) => { }).catch((error) => {
console.log(TAG1 + "setWakeUpScreen error = " + JSON.stringify(error)); console.log(TAG1 + "setWakeUpScreen error = " + JSON.stringify(error));
}) })
...@@ -54,17 +81,6 @@ export default { ...@@ -54,17 +81,6 @@ export default {
console.log(TAG1 + "setWakeUpScreen catch error = " + JSON.stringify(error)); console.log(TAG1 + "setWakeUpScreen catch error = " + JSON.stringify(error));
} }
} }
if (data.parameters.flag) {
lifeList.push('onActive');
let options = {
parameters: {
lifeList: lifeList
}
}
commonEvent.publish(listPush1 + "onActive", options, (err) => {
console.log(TAG1 + listPush1 + "onActive");
});
}
}).catch((error) => { }).catch((error) => {
console.log(TAG1 + "getWant error = " + JSON.stringify(error)); console.log(TAG1 + "getWant error = " + JSON.stringify(error));
}) })
......
...@@ -42,17 +42,15 @@ export default { ...@@ -42,17 +42,15 @@ export default {
setWakeUpScreenP(ability_featureAbility, {status1: true, status2: true}) setWakeUpScreenP(ability_featureAbility, {status1: true, status2: true})
} }
await sleep(300); await sleep(300);
if (data.parameters.flag) { lifeList.push('wakeUpScreen');
lifeList.push('onActive'); let options = {
let options = { parameters: {
parameters: { lifeList: lifeList
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) => { }).catch((error) => {
console.log(TAG1 + "getWant error = " + JSON.stringify(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.
先完成此消息的编辑!
想要评论请 注册