diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/Test.json b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/Test.json index 4553d0904aa1784824061c0793aa049d7cbc5aa2..281959c6472b92d614116c41114d1bfc7bb8959f 100644 --- a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/Test.json +++ b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/Test.json @@ -17,6 +17,14 @@ ], "type": "AppInstallKit", "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "power-shell wakeup", + "power-shell setmode 602", + "uinput -T -d 300 600 -m 300 600 300 100 -u 300 100" + ] } ] } diff --git a/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/Test.json b/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/Test.json index 43943c705dbd0648f1ae9d0a88188ac6fd8125d5..aba0baa13f1d3eb36ac48f490f0a8c5d9a521287 100644 --- a/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/Test.json +++ b/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/Test.json @@ -19,6 +19,14 @@ ], "type": "AppInstallKit", "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "power-shell wakeup", + "power-shell setmode 602", + "uinput -T -d 300 600 -m 300 600 300 100 -u 300 100" + ] } ] } diff --git a/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaShowOnLock.test.ets b/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaShowOnLock.test.ets index ca61879ab195fc366be1bb330c6d17c6c19d9daf..26f8e0c1f9c09781c198455cb88e6a1fa5c3b43e 100644 --- a/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaShowOnLock.test.ets +++ b/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/ets/test/FaShowOnLock.test.ets @@ -162,7 +162,8 @@ export default function FaShowOnLockTest() { bundleName: "ohos.acts.aafwk.test.fasupportfunction", abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility", parameters: { - number: 1 + number: 1, + flag: true } } await globalThis.abilityTestContext.startAbility(wantNum).then((data) => { @@ -243,7 +244,8 @@ export default function FaShowOnLockTest() { bundleName: "ohos.acts.aafwk.test.fasupportfunction", abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility", parameters: { - number: 2 + number: 2, + flag: true } } await globalThis.abilityTestContext.startAbility(wantNum).then((data) => { @@ -324,7 +326,8 @@ export default function FaShowOnLockTest() { bundleName: "ohos.acts.aafwk.test.fasupportfunction", abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility", parameters: { - number: 3 + number: 3, + flag: true } } await globalThis.abilityTestContext.startAbility(wantNum).then((data) => { @@ -412,7 +415,8 @@ export default function FaShowOnLockTest() { bundleName: "ohos.acts.aafwk.test.fasupportfunction", abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2", parameters: { - number: 1 + number: 1, + flag: true } } await globalThis.abilityTestContext.startAbility(wantNum).then((data) => { @@ -500,7 +504,8 @@ export default function FaShowOnLockTest() { bundleName: "ohos.acts.aafwk.test.fasupportfunction", abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2", parameters: { - number: 2 + number: 2, + flag: true } } await globalThis.abilityTestContext.startAbility(wantNum).then((data) => { @@ -588,7 +593,8 @@ export default function FaShowOnLockTest() { bundleName: "ohos.acts.aafwk.test.fasupportfunction", abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2", parameters: { - number: 3 + number: 3, + flag: true } } await globalThis.abilityTestContext.startAbility(wantNum).then((data) => { @@ -676,7 +682,8 @@ export default function FaShowOnLockTest() { bundleName: "ohos.acts.aafwk.test.fasupportfunction", abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2", parameters: { - number: 4 + number: 4, + flag: true } } await globalThis.abilityTestContext.startAbility(wantNum).then((data) => { @@ -764,7 +771,8 @@ export default function FaShowOnLockTest() { bundleName: "ohos.acts.aafwk.test.fasupportfunction", abilityName: "ohos.acts.aafwk.test.fasupportfunction.MainAbility2", parameters: { - number: 5 + number: 5, + flag: true } } await globalThis.abilityTestContext.startAbility(wantNum).then((data) => { diff --git a/ability/ability_runtime/actssupportfunction/fasupportfunction/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actssupportfunction/fasupportfunction/entry/src/main/ets/MainAbility/app.ets index f4201ff8d26cd27f7f439b3a3e56098321373527..ec797b3757d82e0291246133fa34886cb462024b 100644 --- a/ability/ability_runtime/actssupportfunction/fasupportfunction/entry/src/main/ets/MainAbility/app.ets +++ b/ability/ability_runtime/actssupportfunction/fasupportfunction/entry/src/main/ets/MainAbility/app.ets @@ -54,6 +54,17 @@ export default { 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) => { console.log(TAG1 + "getWant error = " + JSON.stringify(error)); }) diff --git a/ability/ability_runtime/actssupportfunction/fasupportfunction/entry/src/main/ets/MainAbility2/app.ets b/ability/ability_runtime/actssupportfunction/fasupportfunction/entry/src/main/ets/MainAbility2/app.ets index 6bf5dbc46c9f52af9265255669df61165c285c53..d10150fd017e6e24d6cd4dad2cc2a22e052454e7 100644 --- a/ability/ability_runtime/actssupportfunction/fasupportfunction/entry/src/main/ets/MainAbility2/app.ets +++ b/ability/ability_runtime/actssupportfunction/fasupportfunction/entry/src/main/ets/MainAbility2/app.ets @@ -19,11 +19,11 @@ var TAG1 = "Fa:SupportFunction:MainAbility2:"; var listPush1 = "Fa_SupportFunction_MainAbility2_"; var lifeList = []; export default { - onCreate() { + async onCreate() { console.log(TAG1 + 'onCreate'); lifeList.push('onCreate'); - ability_featureAbility.getWant().then((data) => { + ability_featureAbility.getWant().then(async (data) => { console.log(TAG1 + "getWant data = " + JSON.stringify(data)); if(data.parameters.number == 1) { @@ -41,6 +41,18 @@ export default { if(data.parameters.number == 5) { setWakeUpScreenP(ability_featureAbility, {status1: true, status2: true}) } + await sleep(300); + 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) => { console.log(TAG1 + "getWant error = " + JSON.stringify(error)); }) @@ -72,6 +84,10 @@ export default { } } +function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); +} + function setWakeUpScreenP(featureAbility, wakeUp) { try { console.log(TAG1 + "setWakeUpScreenP start"); diff --git a/ability/ability_runtime/apitest/Test.json b/ability/ability_runtime/apitest/Test.json index f38c063ea5246f53dfcad0412373722c79e74ba6..3e5ae31ab30fd93848e8a72c8cd67d19b21d2e8d 100644 --- a/ability/ability_runtime/apitest/Test.json +++ b/ability/ability_runtime/apitest/Test.json @@ -15,6 +15,14 @@ ], "type": "AppInstallKit", "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "power-shell wakeup", + "power-shell setmode 602", + "uinput -T -d 300 600 -m 300 600 300 100 -u 300 100" + ] } ] }