diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.js b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.js index 4124d4cd65dff39a20a83de3ca3a23d5d98a7f41..6a7a379d295ebf9a2bed52b5eb8db721a900a039 100644 --- a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.js +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.js @@ -105,10 +105,6 @@ export default { onInit() { this.title = "AbilityMultiInstanceAppE"; callBackSeq += "onInit"; - }, - onShow() { - console.log('AbilityMultiInstanceAppE onShow start'); - callBackSeq += "onShow"; onShowProcess(); }, onStart() { diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets index c13edd358fd36710b9247a9c50a67ce8afd77d9c..c2816b1b06996508bf29d654d6526123f8359204 100644 --- a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets @@ -775,7 +775,6 @@ export default function abilityTest(abilityContext) { console.log('ACTS_AbilityMultiInstance_Single_1300==== { - console.log(TAG + "createSubscriber data : " + JSON.stringify(data)); - subscriber = data; - - commonEvent.subscribe(subscriber, async (err, data) => { - console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data)); - - if (data.event == onActive) { - let cmd = "uinput -K -d 18 -u 18"; - await executeShellCommand(cmd, TAG); - } - - if (data.event == onHide) { - let cmd = "uinput -K -d 18 -u 18"; - await executeShellCommand(cmd, TAG); - await slideScreen(TAG); - } - - if (data.event == onShow) { - lifeList = data.parameters.lifeList; - setTimeout(async () => { - commonEvent.unsubscribe(subscriber, async (err, data) => { - console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data)); - expect(JSON.stringify(lifeList)).assertEqual(JSON.stringify(listCheck)); - expect(status1).assertTrue(); - done(); - }); - }, sleepTimeOne); - } - }); - }).catch((error) => { - console.log(TAG + "createSubscriber data : " + JSON.stringify(error)); - expect().assertFail(); - done(); - }) - - await power.isScreenOn().then((data) => { - console.log(TAG + "isScreenOn status1 data = " + JSON.stringify(data)); - status1 = data; - }).catch((error) => { - console.log(TAG + "isScreenOn status1 error = " + JSON.stringify(error)); - expect().assertFail(); - done(); - }) - - let wantNum = { - bundleName: "ohos.acts.aafwk.test.faonandoffscreen", - abilityName: "ohos.acts.aafwk.test.faonandoffscreen.MainAbility" - } - await globalThis.abilityTestContext.startAbility(wantNum).then((data) => { - console.log(TAG + "startAbility data = " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + "startAbility error = " + JSON.stringify(error)); - expect().assertFail(); - done(); - }) - }) - /* * @tc.number : SUB_AA_OpenHarmony_OnAndOffScreen_0300 * @tc.name : Verify the life cycle of on / off screen ability diff --git a/ability/ability_runtime/actssupportfunction/faonandoffscreen/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actssupportfunction/faonandoffscreen/entry/src/main/ets/MainAbility/app.ets index 68128296754ce97582de6eda9e6401e215debea7..339c7f0863f08a76c721b78c3bfea9404cb18aa5 100644 --- a/ability/ability_runtime/actssupportfunction/faonandoffscreen/entry/src/main/ets/MainAbility/app.ets +++ b/ability/ability_runtime/actssupportfunction/faonandoffscreen/entry/src/main/ets/MainAbility/app.ets @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import ability_featureAbility from '@ohos.ability.featureAbility'; import commonEvent from '@ohos.commonEvent'; var TAG1 = "Fa:FaOnAndOffScreen:MainAbility:"; @@ -38,19 +37,6 @@ export default { console.log(TAG1 + 'onInactive'); lifeList.push('onInactive'); }, - onShow() { - console.log(TAG1 + 'onShow'); - lifeList.push('onShow'); - - let options = { - parameters: { - lifeList: lifeList - } - } - commonEvent.publish(listPush1 + "onShow", options, (err) => { - console.log(TAG1 + listPush1 + "onShow"); - }); - }, onHide() { console.log(TAG1 + 'onHide'); lifeList.push('onHide');