diff --git a/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystageatest/Test.json b/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystageatest/Test.json index 6c3aee8e69a045333bda253acfdfdc9439e8e949..4f14c370e608f0e9de22a2d6e30321d039ca39cb 100644 --- a/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystageatest/Test.json +++ b/ability/ability_runtime/actsqueryfunctiontest/actsgetcurrenttopabilitystageatest/Test.json @@ -14,6 +14,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/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/actsonandoffscreentest/entry/src/main/module.json b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/module.json index 1c1f79631cd29e00a72166d2879615b16b188dea..0b82e31ff35baa87365dff04081a9ddbd922d164 100644 --- a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/module.json +++ b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/module.json @@ -13,6 +13,12 @@ "installationFree": false, "pages": "$profile:main_pages", "uiSyntax": "ets", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "false" + } + ], "abilities": [ { "name": "MainAbility", 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..f938b0608da11dd9626acd1e909d6b7cea3c43d8 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 @@ -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) => { @@ -186,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)); @@ -200,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) => { @@ -267,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)); @@ -281,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) => { @@ -349,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)); @@ -368,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) => { @@ -437,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)); @@ -456,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) => { @@ -525,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)); @@ -544,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) => { @@ -613,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)); @@ -632,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) => { @@ -701,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)); @@ -720,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) => { diff --git a/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/module.json b/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/module.json index 1c1f79631cd29e00a72166d2879615b16b188dea..0b82e31ff35baa87365dff04081a9ddbd922d164 100644 --- a/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/module.json +++ b/ability/ability_runtime/actssupportfunction/actssupportfunctiontest/entry/src/main/module.json @@ -13,6 +13,12 @@ "installationFree": false, "pages": "$profile:main_pages", "uiSyntax": "ets", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "false" + } + ], "abilities": [ { "name": "MainAbility", 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..f6d3f74f8d3d1fe1a47699f2145ce36656d12027 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 @@ -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,12 +50,30 @@ 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)); + 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)); }) 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..afb0ad280d59d283cc9a8f26b9cbdb86b3326814 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,16 @@ export default { if(data.parameters.number == 5) { setWakeUpScreenP(ability_featureAbility, {status1: true, status2: true}) } + await sleep(300); + lifeList.push('wakeUpScreen'); + let options = { + parameters: { + lifeList: lifeList + } + } + commonEvent.publish(listPush1 + "wakeUpScreen", options, (err) => { + console.log(TAG1 + listPush1 + "wakeUpScreen"); + }); }).catch((error) => { console.log(TAG1 + "getWant error = " + JSON.stringify(error)); }) @@ -72,6 +82,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/actssupportfunction/stageonandoffscreen/entry/src/main/module.json b/ability/ability_runtime/actssupportfunction/stageonandoffscreen/entry/src/main/module.json index beea295e0f48bebbea24fc6335d3ddcf8809d5b4..29364789c7bb09a6b0a0ae895000d1a7ca81a126 100644 --- a/ability/ability_runtime/actssupportfunction/stageonandoffscreen/entry/src/main/module.json +++ b/ability/ability_runtime/actssupportfunction/stageonandoffscreen/entry/src/main/module.json @@ -13,6 +13,12 @@ "installationFree": false, "pages": "$profile:main_pages", "uiSyntax": "ets", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "false" + } + ], "abilities": [ { "name": "MainAbility", diff --git a/ability/ability_runtime/actssupportfunction/stagesupportfunction/entry/src/main/module.json b/ability/ability_runtime/actssupportfunction/stagesupportfunction/entry/src/main/module.json index fd3799416ce086806f54dae11a522f3c0170b9e0..46e186a731875aa67405243b3af36661798f388f 100644 --- a/ability/ability_runtime/actssupportfunction/stagesupportfunction/entry/src/main/module.json +++ b/ability/ability_runtime/actssupportfunction/stagesupportfunction/entry/src/main/module.json @@ -13,6 +13,12 @@ "installationFree": false, "pages": "$profile:main_pages", "uiSyntax": "ets", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "false" + } + ], "abilities": [ { "skills": [