From 8e0dcf8e158e5c25b0f947fc946e026fc17cc44f Mon Sep 17 00:00:00 2001 From: xinking129 Date: Tue, 8 Aug 2023 14:26:14 +0800 Subject: [PATCH] Add action XTS Signed-off-by: xinking129 --- ability/ability_runtime/BUILD.gn | 1 + .../actsactionextensionability/BUILD.gn | 26 + .../AppScope/app.json | 19 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin 0 -> 6790 bytes .../BUILD.gn | 43 + .../ets/UIExtensionAbility/UIExtAbility.ts | 47 + .../ActsActionExtensionAbility.ts | 76 + .../main/ets/calledability/CalledAbility.ts | 70 + .../src/main/ets/entryability/EntryAbility.ts | 110 ++ .../entry/src/main/ets/pages/Index.ets | 44 + .../entry/src/main/ets/pages/Page.ets | 34 + .../entry/src/main/ets/pages/PageThree.ets | 35 + .../entry/src/main/ets/pages/PageTwo.ets | 31 + .../entry/src/main/module.json | 73 + .../main/resources/base/element/color.json | 8 + .../main/resources/base/element/string.json | 24 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../resources/base/profile/main_pages.json | 6 + .../main/resources/en_US/element/string.json | 24 + .../main/resources/zh_CN/element/string.json | 24 + .../signature/openharmony_sx.p7b | Bin 0 -> 3732 bytes .../AppScope/app.json | 19 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin 0 -> 6790 bytes .../actsactionextensionabilityself/BUILD.gn | 72 + .../ets/UIExtensionAbility/UIExtAbility.ts | 428 +++++ .../ActsActionExtensionAbility.ts | 76 + .../main/ets/calledability/CalledAbility.ts | 100 + .../src/main/ets/entryability/EntryAbility.ts | 430 +++++ .../src/main/ets/otherability/OtherAbility.ts | 71 + .../entry/src/main/ets/pages/Index.ets | 92 + .../entry/src/main/ets/pages/IndexTwo.ets | 40 + .../entry/src/main/ets/pages/Page.ets | 95 + .../entry/src/main/ets/pages/PageThree.ets | 35 + .../entry/src/main/ets/pages/PageTwo.ets | 31 + .../entry/src/main/module.json | 86 + .../main/resources/base/element/color.json | 8 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../resources/base/profile/main_pages.json | 8 + .../main/resources/en_US/element/string.json | 32 + .../main/resources/zh_CN/element/string.json | 24 + .../FeatureActionExtensionAbility.ts | 58 + .../main/ets/featureability/FeatureAbility.ts | 88 + .../feature/src/main/ets/pages/Index.ets | 41 + .../feature/src/main/ets/pages/Index2.ets | 34 + .../feature/src/main/module.json | 41 + .../main/resources/base/element/color.json | 8 + .../main/resources/base/element/string.json | 16 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../resources/base/profile/main_pages.json | 6 + .../main/resources/en_US/element/string.json | 16 + .../main/resources/zh_CN/element/string.json | 16 + .../signature/openharmony_sx.p7b | Bin 0 -> 3732 bytes .../AppScope/app.json | 19 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin 0 -> 6790 bytes .../actsactionextensionabilitytest/BUILD.gn | 43 + .../actsactionextensionabilitytest/Test.json | 38 + .../ets/TestRunner/OpenHarmonyTestRunner.ts | 62 + .../entry/src/main/ets/test/Ability.test.ets | 1672 +++++++++++++++++ .../entry/src/main/ets/test/List.test.ets | 19 + .../src/main/ets/testability/TestAbility.ets | 63 + .../src/main/ets/testability/pages/Index.ets | 48 + .../entry/src/main/module.json | 41 + .../main/resources/base/element/color.json | 8 + .../main/resources/base/element/string.json | 16 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../resources/base/profile/test_pages.json | 5 + .../signature/openharmony_sx.p7b | Bin 0 -> 3732 bytes 71 files changed, 4756 insertions(+) create mode 100644 ability/ability_runtime/actsactionextensionability/BUILD.gn create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/AppScope/app.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/AppScope/resources/base/element/string.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/AppScope/resources/base/media/app_icon.png create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/BUILD.gn create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/actionextensionability/ActsActionExtensionAbility.ts create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/calledability/CalledAbility.ts create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/entryability/EntryAbility.ts create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/pages/Index.ets create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/pages/Page.ets create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/pages/PageThree.ets create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/pages/PageTwo.ets create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/module.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/resources/base/element/color.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/resources/base/element/string.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/resources/base/media/icon.png create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/resources/base/profile/main_pages.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/resources/en_US/element/string.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/resources/zh_CN/element/string.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/signature/openharmony_sx.p7b create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/AppScope/app.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/AppScope/resources/base/element/string.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/AppScope/resources/base/media/app_icon.png create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/BUILD.gn create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/actionextensionability/ActsActionExtensionAbility.ts create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/calledability/CalledAbility.ts create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/entryability/EntryAbility.ts create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/otherability/OtherAbility.ts create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/Index.ets create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/IndexTwo.ets create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/Page.ets create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/PageThree.ets create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/PageTwo.ets create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/module.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/resources/base/element/color.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/resources/base/element/string.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/resources/base/media/icon.png create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/resources/base/profile/main_pages.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/resources/en_US/element/string.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/resources/zh_CN/element/string.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/ets/actionextensionability/FeatureActionExtensionAbility.ts create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/ets/featureability/FeatureAbility.ts create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/ets/pages/Index.ets create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/ets/pages/Index2.ets create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/module.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/resources/base/element/color.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/resources/base/element/string.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/resources/base/media/icon.png create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/resources/base/profile/main_pages.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/resources/en_US/element/string.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/resources/zh_CN/element/string.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/signature/openharmony_sx.p7b create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/AppScope/app.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/AppScope/resources/base/element/string.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/AppScope/resources/base/media/app_icon.png create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/BUILD.gn create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/Test.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/test/Ability.test.ets create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/test/List.test.ets create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/testability/TestAbility.ets create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/testability/pages/Index.ets create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/module.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/resources/base/element/color.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/resources/base/element/string.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/resources/base/media/icon.png create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/resources/base/profile/test_pages.json create mode 100644 ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/BUILD.gn b/ability/ability_runtime/BUILD.gn index d03507b9b..0529f1856 100644 --- a/ability/ability_runtime/BUILD.gn +++ b/ability/ability_runtime/BUILD.gn @@ -25,6 +25,7 @@ group("ability_runtime") { "actsabilitydelegatorcase:ActsAbilityDelegatorCaseTest", "actsabilitymanageretstest:ActsAbilityManagerEtsTest", "actsabilityusertest:ActsAbilityuserTest", + "actsactionextensionability:actsactionextensionability", "actscalldataabilitytest:ActsCallDataAbilityTest", "actscalltest:actscalltest", "actscrosscall:actscrosscall", diff --git a/ability/ability_runtime/actsactionextensionability/BUILD.gn b/ability/ability_runtime/actsactionextensionability/BUILD.gn new file mode 100644 index 000000000..762a3075d --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/BUILD.gn @@ -0,0 +1,26 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +group("actsactionextensionability") { + testonly = true + if (is_standard_system) { + deps = [ + "actsactionextensionabilityotherrely:ActsActionExtensionAbilityOtherRely", + "actsactionextensionabilityself:ActsActionExtensionAbilitySelfRely", + "actsactionextensionabilityself:ActsActionExtensionAbilitySelfModule", + "actsactionextensionabilitytest:ActsActionExtensionAbilityTest", + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/AppScope/app.json b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/AppScope/app.json new file mode 100644 index 000000000..1b1ec18b9 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/AppScope/app.json @@ -0,0 +1,19 @@ +{ + "app": { + "bundleName": "com.example.actsactionextensionabilityrely", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 10, + "targetAPIVersion": 10, + "car": { + "apiCompatibleVersion": 10, + "singleUser": false + } + } +} diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..d71e5ead1 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "MyApplication" + } + ] +} diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXm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`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}yUIExtAbility onCreate======>'); + } + + onSessionCreate(want, session) { + console.log(`want: ${JSON.stringify(want)}}`); + var storage: LocalStorage = new LocalStorage({ + 'session': session + }); + session.loadContent('pages/Page', storage); + console.info('=======>UIExtAbility onSessionCreate======>'); + } + + onSessionDestroy(session) { + console.log('onSessionDestroy'); + } + + onDestroy() { + console.info('=======>UIExtensionAbility onDestroy ======>'); + } + + onForeground() { + // Ability has brought to foreground + console.log('=====> UIExtAbility onForeground =====> '); + } +}; diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/actionextensionability/ActsActionExtensionAbility.ts b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/actionextensionability/ActsActionExtensionAbility.ts new file mode 100644 index 000000000..8aa8a6d98 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/actionextensionability/ActsActionExtensionAbility.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import ActionExtensionAbility from '@ohos.app.ability.ActionExtensionAbility'; +import commonEventManager from '@ohos.commonEventManager'; + +var count = 0; +const TIME_OUT = 500; +export default class ActsActionExtensionAbility extends ActionExtensionAbility { + storage: LocalStorage; + message: string; + onCreate() { + console.log('====>ActsActionExtensionAbility onCreate called'); + count++; + } + + onForeground() { + console.log('====>ActsActionExtensionAbility onForeground called'); + count++; + var options = { + parameters: { + 'count': count + } + } + commonEventManager.publish('ACTS_TEST_FOREGROUND', options, function (){}); + } + + onBackground() { + console.log('====>ActsActionExtensionAbility onBackground called'); + count++; + commonEventManager.publish('ACTS_TEST_BACKGROUND', function (){}); + setTimeout(() => { + globalThis.session.terminateSelf(); + }, TIME_OUT); + } + + onSessionCreate(want, session) { + console.log('====>ActsActionExtensionAbility onSessionCreate called'); + count++; + this.message = want.parameters.shareMessages; + this.storage = new LocalStorage( + { + 'session': session, + 'messages': this.message + }); + session.loadContent('pages/PageThree', this.storage); + globalThis.session = session; + } + + onDestroy() { + console.log('====>ActsActionExtensionAbility onDestroy called'); + count++; + var options = { + parameters: { + 'count': count + } + } + commonEventManager.publish('ACTS_TEST_DESTROY', options, function (){}); + } + + onSessionDestroy(session) { + console.log('====>ActsActionExtensionAbility onSessionDestroy called'); + count++; + } +} diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/calledability/CalledAbility.ts b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/calledability/CalledAbility.ts new file mode 100644 index 000000000..e3749435f --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/calledability/CalledAbility.ts @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import type window from '@ohos.window'; + +export default class CalledAbility extends UIAbility { + onCreate(want, launchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'CalledAbility onCreate'); + + console.log('=====> second app CalledAbility bas been created =====>'); + + if (want.action === 'AsyncCallback_0200') { + this.context.terminateSelfWithResult({ + resultCode: 0, + want: { + parameters: { + action: 'ACTION' + } + } + }, (err) => { + console.log('=====> AsyncCallback_0200 CalledAbilityCallBack terminateSelfWithResult =====>' + err.code); + }); + } + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'CalledAbility onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/PageTwo', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'CalledAbility onWindowStageDestroy'); + } + + onForeground() { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'CalledAbility onForeground'); + } + + onBackground() { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'CalledAbility onBackground'); + } +} diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/entryability/EntryAbility.ts b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 000000000..4ddabe2dc --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + onCreate(want, launchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + console.info('====>another EntryAbility'); + + if (want.action === 'ActionExtensionAbility_0100') { + this.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilityrely', + abilityName: 'ActsActionExtensionAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }).catch((err)=>{ + console.info('====>ActionExtensionAbility_0100 err:'+ JSON.stringify(err)); + }) + } + + if (want.action === 'AsyncCallback_0200') { + console.info("====>EntryAbility want.action == 'AsyncCallback_0200':"); + AppStorage.SetOrCreate('want', { + action: 'AsyncCallback_0200', + bundleName: 'com.example.actsactionextensionabilityrely', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'AsyncCallback_0300') { + console.info("====>EntryAbility want.action == 'AsyncCallback_0300':"); + AppStorage.SetOrCreate('want', { + action: 'AsyncCallback_0300', + bundleName: 'com.example.actsactionextensionabilityrely', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Promise_0200') { + console.info("====>EntryAbility want.action == 'Promise_0200':"); + AppStorage.SetOrCreate('want', { + action: 'Promise_0200', + bundleName: 'com.example.actsactionextensionabilityrely', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + if (want.action === 'Promise_0300') { + console.info("====>EntryAbility want.action == 'Promise_0300':"); + AppStorage.SetOrCreate('want', { + action: 'Promise_0300', + bundleName: 'com.example.actsactionextensionabilityrely', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onBackground() { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/pages/Index.ets b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/pages/Index.ets new file mode 100644 index 000000000..94dc20c72 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Want from '@ohos.app.ability.Want'; + +@Entry +@Component +struct Index { + @State message: string = 'Second application' + @StorageLink('want') want: Want = { + action: "AsyncCallback_0200", + bundleName: 'com.example.actsactionextensionabilityrely', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + } + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + UIExtensionComponent(this.want) + .size({width:'100%',height:'100'}) + .backgroundColor(Color.Blue) + .border({width:5,color:Color.Red}) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/pages/Page.ets b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/pages/Page.ets new file mode 100644 index 000000000..30c9b5a2f --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/pages/Page.ets @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +var storage = LocalStorage.GetShared() + +@Entry(storage) +@Component +struct Page { + @State message: string = 'UIExtAbility' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(30) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/pages/PageThree.ets b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/pages/PageThree.ets new file mode 100644 index 000000000..ac2520e89 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/pages/PageThree.ets @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +var storage = LocalStorage.GetShared(); + +@Entry(storage) +@Component +struct PageThree { + + build() { + Row() { + Column() { + Text('acton') + .fontSize(24) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + .backgroundColor('#e0ffff') + .borderRadius(16) + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/pages/PageTwo.ets b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/pages/PageTwo.ets new file mode 100644 index 000000000..5bb697ee1 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/pages/PageTwo.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct PageTwo { + @State message: string = 'Second application' + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/module.json b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/module.json new file mode 100644 index 000000000..df6a7eaf9 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/module.json @@ -0,0 +1,73 @@ +{ + "module": { + "name": "entry_assist", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ts", + "description": "$string:EntryAbility_desc", + "icon": "$media:icon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + }, + { + "name": "CalledAbility", + "srcEntry": "./ets/calledability/CalledAbility.ts", + "description": "$string:CalledAbility_desc", + "visible": true, + "icon": "$media:icon", + "label": "$string:CalledAbility_label", + "launchType": "standard", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background" + } + ], + "extensionAbilities": [ + { + "name": "UIExtAbility", + "icon": "$media:icon", + "description": "UIExtAbility", + "type": "action", + "visible": true, + "srcEntrance": "./ets/UIExtensionAbility/UIExtAbility.ts" + }, + { + "name": "ActsActionExtensionAbility", + "icon": "$media:icon", + "description": "ActsActionExtensionAbility", + "type": "action", + "visible": true, + "srcEntrance": "./ets/actionextensionability/ActsActionExtensionAbility.ts" + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND" + }, + { + "name": "ohos.permission.START_INVISIBLE_ABILITY" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/resources/base/element/color.json b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/resources/base/element/color.json new file mode 100644 index 000000000..d66f9a7d4 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..3b2c2fd7e --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/resources/base/element/string.json @@ -0,0 +1,24 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "label" + }, + { + "name": "CalledAbility_desc", + "value": "description" + }, + { + "name": "CalledAbility_label", + "value": "label" + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q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pP z;qk%MQ$=$?SP7&?sT4W>owVnkC%2qxIJ9nm>8_z`-Wm2{RrjQamdrF}13R})&^>+f zbzVI+?k^QLDZ#YorajEh-#c}PXXK7GmpWGi$Gz>=f2Z+t!j85rn=gSUTV3nhPwgIa za@MZ5iLuLbA&+RtqjUW{n#8UF5$`Ug#S2?uAn$pjaKfgO{GIN^bRZP1jvM+_3lcC!Q#Jm7Uu&x?{qXM?P|{ zNuFCvpB4P#n&_K`XXbubhIA-UNV2=(`w6t%mNNF=r~{vBopCVs`co}Wg}||E4?G2! zaNWquMTWymu^d$Dji3@S0niBM+!$3OT6M{94(krB!;iBQ!)f~mi;rHdTRh<{+om=! zwet^!__6%sUvw|M__)ur qR5>MQz5e9f5%Z6zUn^*P;B(G^Z9MQv&r=&8u8V@LlhOxNHU9;|Q@Ymx literal 0 HcmV?d00001 diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/AppScope/app.json b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/AppScope/app.json new file mode 100644 index 000000000..abf2fd00b --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/AppScope/app.json @@ -0,0 +1,19 @@ +{ + "app": { + "bundleName": "com.example.actsactionextensionabilitytest", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 10, + "targetAPIVersion": 10, + "car": { + "apiCompatibleVersion": 10, + "singleUser": false + } + } +} diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..d71e5ead1 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "MyApplication" + } + ] +} diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4%CzIT zAm3CUtWSr1t4?h1kk#NBi{U|pJslvME{q|_eS^3En>SOqSxyuN1x;Is@8~m?*>}** znrRFArP!K_52RpX*&JHMR<^lVdm8ypJ}0R(S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amN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}yUIExtAbility onCreate======>'); + } + + onSessionCreate(want, session) { + console.log(`want: ${JSON.stringify(want)}}`); + var storage: LocalStorage = new LocalStorage({ + 'session': session + }); + session.loadContent('pages/Page', storage); + console.info('=======>UIExtAbility onSessionCreate======>'); + + if (want.action === 'Acts_ActionExtensionAbility_1000') { + console.info('=======>UIExtAbility onSessionCreate want.action == Acts_ActionExtensionAbility_1000======>'); + this.context.startAbility({ + action: 'Acts_ActionExtensionAbility_1000', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'CalledAbility', + parameters: { + [wantConstant.Params.ABILITY_BACK_TO_OTHER_MISSION_STACK]: true + } + }, (error) => { + console.info('=======>Acts_ActionExtensionAbility_1000 error.code ======>' + error.code); + var commonEventData = { + parameters: { + num: error.code + } + }; + commonEvent.publish('ACTS_CALL_EVENT', commonEventData, (err) => { + console.debug('====>Acts_ActionExtensionAbility_1000 publish err:' + JSON.stringify(err)); + }); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_1100') { + console.info('=======>UIExtAbility onSessionCreate want.action == Acts_ActionExtensionAbility_1100======>'); + this.context.startAbility({ + action: 'Acts_ActionExtensionAbility_1100', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'CalledAbility', + parameters: { + [wantConstant.Params.ABILITY_BACK_TO_OTHER_MISSION_STACK]: true + } + }).then(() => { + console.info('=======>Acts_ActionExtensionAbility_1100 UIExtAbility startAbility success ======>'); + var commonEventData = { + parameters: { + str: 'success' + } + }; + commonEvent.publish('ACTS_CALL_EVENT', commonEventData, (err) => { + console.debug('====>Acts_ActionExtensionAbility_1100 publish err:' + JSON.stringify(err)); + }); + }).catch((err) => { + console.debug('====>Acts_ActionExtensionAbility_1100 UIExtAbility startAbility err:' + JSON.stringify(err)); + }) + } + + if (want.action === 'Acts_ActionExtensionAbility_1200') { + console.info('=======>UIExtAbility onSessionCreate want.action == Acts_ActionExtensionAbility_1200======>'); + this.context.startAbility({ + action: 'Acts_ActionExtensionAbility_1200', + bundleName: 'xxx.xxxx.xxxxx', + abilityName: 'CalledAbility', + parameters: { + [wantConstant.Params.ABILITY_BACK_TO_OTHER_MISSION_STACK]: true + } + }, (error) => { + console.info('=======>Acts_ActionExtensionAbility_1200 error.code ======>' + error.code); + var commonEventData = { + parameters: { + num: error.code + } + }; + commonEvent.publish('ACTS_CALL_EVENT', commonEventData, (err) => { + console.debug('====>Acts_ActionExtensionAbility_1200 publish err:' + JSON.stringify(err)); + }); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_1300') { + console.info('=======>UIExtAbility onSessionCreate want.action == Acts_ActionExtensionAbility_1300======>'); + this.context.startAbilityForResult({ + action: 'Acts_ActionExtensionAbility_1300', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'CalledAbility', + parameters: { + [wantConstant.Params.ABILITY_BACK_TO_OTHER_MISSION_STACK]: true + } + }, (error, data) => { + console.info('=======>Acts_ActionExtensionAbility_1300 error.code ======>' + error.code); + console.info('=======>Acts_ActionExtensionAbility_1300 data.resultCode ======>' + data.resultCode); + console.info('=======>Acts_ActionExtensionAbility_1300 data.action ======>' + data.want.parameters.action); + var commonEventData = { + parameters: { + num: error.code, + str: data.want.parameters.action, + result: data.resultCode + } + }; + commonEvent.publish('ACTS_CALL_EVENT', commonEventData, (err) => { + console.debug('====>Acts_ActionExtensionAbility_1300 publish err:' + JSON.stringify(err)); + }); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_1400') { + console.info('=======>UIExtAbility onSessionCreate want.action == Acts_ActionExtensionAbility_1300======>'); + this.context.startAbilityForResult({ + action: 'Acts_ActionExtensionAbility_1400', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'CalledAbility', + parameters: { + [wantConstant.Params.ABILITY_BACK_TO_OTHER_MISSION_STACK]: true + } + }).then((data) => { + console.info('=======>Acts_ActionExtensionAbility_1400 data.resultCode ======>' + data.resultCode); + console.info('=======>Acts_ActionExtensionAbility_1400 data.action ======>' + data.want.parameters.action); + var commonEventData = { + parameters: { + str: data.want.parameters.action, + result: data.resultCode + } + }; + commonEvent.publish('ACTS_CALL_EVENT', commonEventData, (err) => { + console.debug('====>Acts_ActionExtensionAbility_1400 publish err:' + JSON.stringify(err)); + }); + }).catch((error) => { + console.info('=======>Acts_ActionExtensionAbility_1400 error.code ======>' + error.code); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_1500') { + console.info('=======>UIExtAbility onSessionCreate want.action == Acts_ActionExtensionAbility_1500======>'); + this.context.startAbilityForResult({ + action: 'Acts_ActionExtensionAbility_1500', + bundleName: 'xxx.xxxxxxx.xxx', + abilityName: 'CalledAbility', + parameters: { + [wantConstant.Params.ABILITY_BACK_TO_OTHER_MISSION_STACK]: true + } + }, (error, data) => { + console.info('=======>Acts_ActionExtensionAbility_1500 first from own error.code ======>' + error.code); + var commonEventData = { + parameters: { + num: error.code + } + }; + commonEvent.publish('ACTS_CALL_EVENT', commonEventData, (err) => { + console.debug('====>Acts_ActionExtensionAbility_1500 first publish err:' + JSON.stringify(err)); + }); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_1600') { + session.setReceiveDataCallback((data) => { + let options = { + parameters: { + 'result': data + } + } + commonEvent.publish('setReceiveDataCallback', options, (err) => { + console.log('Acts_ActionExtensionAbility_1600'); + }); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_1800') { + console.info('=======>UIExtAbility onSessionCreate want.action == Acts_ActionExtensionAbility_1800======>'); + this.context.startAbility({ + action: 'Acts_ActionExtensionAbility_1800', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'ActsActionExtensionAbility' + }, (error, data) => { + console.info('=======>Acts_ActionExtensionAbility_1800 first from own error.code ======>' + error.code); + var commonEventData = { + parameters: { + num: error.code + } + }; + commonEvent.publish('ACTS_CALL_EVENT', commonEventData, (err) => { + console.debug('====>Acts_ActionExtensionAbility_1800 first publish err:' + JSON.stringify(err)); + }); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_context') { + let options = { + parameters: { + 'context': this.context + } + } + commonEvent.publish('ACTS_TEST_CONTEXT', options, (err) => { + console.log('Acts_ActionExtensionAbility_context'); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_2200') { + console.info('=======>UIExtAbility onSessionCreate want.action == Acts_ActionExtensionAbility_2200======>'); + console.info('Acts_ActionExtensionAbility_2200 resourceManager: ' + this.context.resourceManager); + let commonEventData = { + parameters: { + resourceManager: this.context.resourceManager + } + }; + commonEvent.publish('ACTS_CALL_EVENT', commonEventData, (err) => { + console.debug('====>Acts_ActionExtensionAbility_2200 first publish err:' + JSON.stringify(err)); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_2300') { + console.info('=======>UIExtAbility onSessionCreate want.action == Acts_ActionExtensionAbility_2300======>'); + console.info('Acts_ActionExtensionAbility_2300 applicationInfo: ' + this.context.applicationInfo); + let applicationInfo = this.context.applicationInfo; + + let commonEventData = { + parameters: { + name: applicationInfo.name, + description_length: applicationInfo.description.length, + descriptionId: applicationInfo.descriptionId, + label: applicationInfo.label, + labelId: applicationInfo.labelId, + icon: applicationInfo.icon, + iconId: applicationInfo.iconId, + codePath: typeof (applicationInfo.codePath) + } + }; + commonEvent.publish('ACTS_CALL_EVENT', commonEventData, (err) => { + console.debug('====>Acts_ActionExtensionAbility_2300 first publish err:' + JSON.stringify(err)); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_2400') { + console.info('=======>UIExtAbility onSessionCreate want.action == Acts_ActionExtensionAbility_2400======>'); + + let commonEventData = { + parameters: { + cacheDir: this.context.cacheDir + } + }; + commonEvent.publish('ACTS_CALL_EVENT', commonEventData, (err) => { + console.debug('====>Acts_ActionExtensionAbility_2400 first publish err:' + JSON.stringify(err)); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_2500') { + console.info('=======>UIExtAbility onSessionCreate want.action == Acts_ActionExtensionAbility_2500======>'); + + let commonEventData = { + parameters: { + tempDir: this.context.tempDir + } + }; + commonEvent.publish('ACTS_CALL_EVENT', commonEventData, (err) => { + console.debug('====>Acts_ActionExtensionAbility_2500 first publish err:' + JSON.stringify(err)); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_2600') { + console.info('=======>UIExtAbility onSessionCreate want.action == Acts_ActionExtensionAbility_2600======>'); + + let commonEventData = { + parameters: { + filesDir: this.context.filesDir + } + }; + commonEvent.publish('ACTS_CALL_EVENT', commonEventData, (err) => { + console.debug('====>Acts_ActionExtensionAbility_2600 first publish err:' + JSON.stringify(err)); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_2700') { + console.info('=======>UIExtAbility onSessionCreate want.action == Acts_ActionExtensionAbility_2700======>'); + + let commonEventData = { + parameters: { + databaseDir: this.context.databaseDir + } + }; + commonEvent.publish('ACTS_CALL_EVENT', commonEventData, (err) => { + console.debug('====>Acts_ActionExtensionAbility_2700 first publish err:' + JSON.stringify(err)); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_2800') { + console.info('=======>UIExtAbility onSessionCreate want.action == Acts_ActionExtensionAbility_2800======>'); + + let commonEventData = { + parameters: { + preferencesDir: this.context.preferencesDir + } + }; + commonEvent.publish('ACTS_CALL_EVENT', commonEventData, (err) => { + console.debug('====>Acts_ActionExtensionAbility_2800 first publish err:' + JSON.stringify(err)); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_2900') { + console.info('=======>UIExtAbility onSessionCreate want.action == Acts_ActionExtensionAbility_2900======>'); + + let commonEventData = { + parameters: { + bundleCodeDir: this.context.bundleCodeDir + } + }; + commonEvent.publish('ACTS_CALL_EVENT', commonEventData, (err) => { + console.debug('====>Acts_ActionExtensionAbility_2900 first publish err:' + JSON.stringify(err)); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_3000') { + var moduleContext = this.context.createModuleContext('entry'); + let options = { + parameters: { + 'bundleName': moduleContext.applicationInfo.name + } + } + commonEvent.publish('ACTS_TEST_CONTEXT', options, (err) => { + console.log('Acts_ActionExtensionAbility_context'); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_3100') { + var moduleContext = this.context.createModuleContext('entry_test'); + let options = { + parameters: { + 'bundleName': moduleContext.applicationInfo.name + } + } + commonEvent.publish('ACTS_TEST_CONTEXT', options, (err) => { + console.log('Acts_ActionExtensionAbility_context'); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_3200') { + try { + var moduleContext = this.context.createModuleContext('entry_assist'); + } catch { + console.log('createModuleContext err'); + } + let options = { + parameters: { + 'moduleContext': moduleContext + } + } + commonEvent.publish('ACTS_TEST_CONTEXT', options, (err) => { + console.log('Acts_ActionExtensionAbility_context'); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_3300') { + try { + var moduleContext = this.context.createModuleContext('abc'); + } catch { + console.log('createModuleContext err'); + } + let options = { + parameters: { + 'moduleContext': moduleContext + } + } + commonEvent.publish('ACTS_TEST_CONTEXT', options, (err) => { + console.log('Acts_ActionExtensionAbility_context'); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_3400') { + try { + var moduleContext = this.context.createModuleContext(undefined); + } catch { + console.log('createModuleContext err'); + } + let options = { + parameters: { + 'moduleContext': moduleContext + } + } + commonEvent.publish('ACTS_TEST_CONTEXT', options, (err) => { + console.log('Acts_ActionExtensionAbility_context'); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_3500') { + var applicationContext = this.context.getApplicationContext(); + let options = { + parameters: { + 'applicationContext': applicationContext + } + } + commonEvent.publish('ACTS_TEST_CONTEXT', options, (err) => { + console.log('Acts_ActionExtensionAbility_context'); + }); + } + } + + onSessionDestroy(session) { + console.log('onSessionDestroy'); + } + + onDestroy() { + console.info('=======>UIExtensionAbility onDestroy ======>'); + } + + onForeground() { + console.log('=====> UIExtAbility onForeground =====> '); + } +}; diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/actionextensionability/ActsActionExtensionAbility.ts b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/actionextensionability/ActsActionExtensionAbility.ts new file mode 100644 index 000000000..8d8fcc7b2 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/actionextensionability/ActsActionExtensionAbility.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import ActionExtensionAbility from '@ohos.app.ability.ActionExtensionAbility'; +import commonEventManager from '@ohos.commonEventManager'; + +var count = 0; +const TIME_OUT = 500; +export default class ActsActionExtensionAbility extends ActionExtensionAbility { + storage: LocalStorage; + message: string; + onCreate() { + console.log('====>ActsActionExtensionAbility onCreate called'); + count++; + } + + onForeground() { + console.log('====>ActsActionExtensionAbility onForeground called'); + count++; + let options = { + parameters: { + 'count': count + } + } + commonEventManager.publish('ACTS_TEST_FOREGROUND', options, function (){}); + } + + onBackground() { + console.log('====>ActsActionExtensionAbility onBackground called'); + count++; + commonEventManager.publish('ACTS_TEST_BACKGROUND', function (){}); + setTimeout(() => { + globalThis.session.terminateSelf(); + }, TIME_OUT); + } + + onSessionCreate(want, session) { + console.log('====>ActsActionExtensionAbility onSessionCreate called'); + count++; + this.message = want.parameters.shareMessages; + this.storage = new LocalStorage( + { + 'session': session, + 'messages': this.message + }); + session.loadContent('pages/PageThree', this.storage); + globalThis.session = session; + } + + onDestroy() { + console.log('====>ActsActionExtensionAbility onDestroy called'); + count++; + var options = { + parameters: { + 'count': count + } + } + commonEventManager.publish('ACTS_TEST_DESTROY', options, function (){}); + } + + onSessionDestroy(session) { + console.log('====>ActsActionExtensionAbility onSessionDestroy called'); + count++; + } +} diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/calledability/CalledAbility.ts b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/calledability/CalledAbility.ts new file mode 100644 index 000000000..0aba6b9a9 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/calledability/CalledAbility.ts @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import type window from '@ohos.window'; + +export default class CalledAbility extends UIAbility { + onCreate(want, launchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'CalledAbility onCreate'); + console.log('=====> first app CalledAbility =====>'); + const TIMEOUT = 50; + globalThis.terminateCalledAbility = (str) => { + setTimeout(() => { + this.context.terminateSelf().then(() => { + console.info('====>terminateSelf' + JSON.stringify(str) + ' end'); + }).catch((err) => { + console.info('====>terminateSelf ' + JSON.stringify(str) + ' err:' + JSON.stringify(err)); + }); + }, TIMEOUT); + }; + + if (want.action === 'Acts_ActionExtensionAbility_1000') { + this.context.terminateSelf(); + } + + if (want.action === 'Acts_ActionExtensionAbility_1100') { + this.context.terminateSelf(); + } + + if (want.action === 'Acts_ActionExtensionAbility_1300') { + this.context.terminateSelfWithResult({ + resultCode: 0, + want: { + parameters: { + action: 'ACTION' + } + } + }, (err) => { + console.log('=====> Acts_ActionExtensionAbility_1300 CalledAbilityCallBack terminateSelfWithResult =====>' + err.code); + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_1400') { + this.context.terminateSelfWithResult({ + resultCode: 0, + want: { + parameters: { + action: 'ACTION' + } + } + }, (err) => { + console.log('=====> Acts_ActionExtensionAbility_1400 CalledAbilityCallBack terminateSelfWithResult =====>' + err.code); + }); + } + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'CalledAbility onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/PageTwo', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'CalledAbility onWindowStageDestroy'); + } + + onForeground() { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'CalledAbility onForeground'); + } + + onBackground() { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'CalledAbility onBackground'); + } +} diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/entryability/EntryAbility.ts b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 000000000..357e8bd4b --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,430 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import type window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + onCreate(want, launchParam) { + const TIMEOUT = 50; + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + globalThis.terminate = (str) => { + setTimeout(() => { + this.context.terminateSelf().then(() => { + console.info('====>terminateSelf' + JSON.stringify(str) + ' end'); + }).catch((err) => { + console.info('====>terminateSelf ' + JSON.stringify(str) + ' err:' + JSON.stringify(err)); + }); + }, TIMEOUT); + }; + + if (want.action === 'Acts_ActionExtensionAbility_0100') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_0100'); + AppStorage.SetOrCreate('want', { + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'ActsActionExtensionAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_0300') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_0300'); + AppStorage.SetOrCreate('want', { + bundleName: 'com.example.actsactionextensionabilityrely', + abilityName: 'ActsActionExtensionAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_0400') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_0400'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_0400', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'FeatureActionExtensionAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_0500') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_0500'); + AppStorage.SetOrCreate('want', { + bundleName: '', + abilityName: 'ActsActionExtensionAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_0600') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_0600'); + AppStorage.SetOrCreate('want', { + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: '', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_0700') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_0700'); + AppStorage.SetOrCreate('want', { + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'ActsActionExtensionAbility', + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_DEFAULT') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_DEFAULT'); + AppStorage.SetOrCreate('want', { + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_1000') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_1000'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_1000', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_1100') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_1100'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_1100', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_1200') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_1200'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_1200', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_1300') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_1300'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_1300', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_1400') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_1400'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_1400', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_1500') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_1500'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_1500', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_1600') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_1600'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_1600', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + + if (want.action === 'Acts_ActionExtensionAbility_1700') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_1700'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_1700', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_1800') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_1800'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_1800', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_context') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_context'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_context', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_2200') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_2200'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_2200', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_2300') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_2300'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_2300', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_2400') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_2400'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_2400', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_2500') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_2500'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_2500', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_2600') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_2600'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_2600', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_2700') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_2700'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_2700', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_2800') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_2800'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_2800', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_2900') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_2900'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_2900', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_3000') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_3000'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_3000', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_3100') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_3100'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_3100', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_3200') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_3200'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_3200', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_3300') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_3300'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_3300', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_3400') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_3400'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_3400', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_3500') { + console.info('====>EntryAbility want.action == Acts_ActionExtensionAbility_3500'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_3500', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + windowStage.loadContent('pages/Index', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground() { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + + } + + onBackground() { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/otherability/OtherAbility.ts b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/otherability/OtherAbility.ts new file mode 100644 index 000000000..e8f3616fc --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/otherability/OtherAbility.ts @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import type window from '@ohos.window'; + +const CUMULATIVE = 2; + +export default class OtherAbility extends UIAbility { + circulate: number = 0; + + onCreate(want, launchParam) { + console.log('=====> OtherAbility onCreate =====>'); + } + + onDestroy() { + console.log('=====> OtherAbility onDestroy =====>'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created, set main page for this ability + console.log('=====> OtherAbility onWindowStageCreate =====>'); + windowStage.loadContent('pages/IndexTwo', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log('=====> OtherAbility onWindowStageDestroy =====>'); + } + + onForeground() { + console.log('=====> OtherAbility onForeground =====>'); + this.circulate++; + console.log(`=====> OtherAbility circulate count: ${this.circulate}`); + if (this.circulate === CUMULATIVE) { + this.context.terminateSelfWithResult({ + resultCode: 0, + want: { + parameters: { + action: 'ACTION' + } + } + }, (err) => { + console.log('=====> OtherAbility CalledAbilityCallBack terminateSelfWithResult =====>' + err.code); + }); + } + } + + onBackground() { + // Ability has back to background + console.log('=====> OtherAbility onBackground =====>'); + } +} diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/Index.ets b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/Index.ets new file mode 100644 index 000000000..418b90077 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Want from '@ohos.app.ability.Want'; +import commonEventManager from '@ohos.commonEventManager'; + +@Entry +@Component +struct Index { + @State message: string = 'First application'; + @StorageLink('want') want: Want = { + action: 'AsyncCallback_0100', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'UIExtAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }; + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + UIExtensionComponent(this.want) + .size({width:'100%',height:'100'}) + .backgroundColor(Color.Blue) + .border({width:5,color:Color.Red}) + .onRemoteReady((proxy) => { + setTimeout(() => { + proxy.send({ + name: { + test: 'actionExtensionTest' + } + }); + }, 1000); + }) + .onResult((data)=>{ + var onResultEvent = 'ACTS_UIExtension_OnResult'; + var options = { + parameters: { + 'result': data + } + } + commonEventManager.publish(onResultEvent, options, (err) => { + console.log('ACTS_UIExtension_OnResult'); + }); + }) + .onReceive((data)=>{ + var onReceiveEvent = 'ACTS_UIExtension_OnReceive'; + var options = { + parameters: { + 'result': data + } + } + commonEventManager.publish(onReceiveEvent, options, (err) => { + console.log('ACTS_UIExtension_OnReceive'); + }); + }) + .onError((err) => { + var options = { + parameters: { + 'err': err + } + } + commonEventManager.publish('ACTS_TEST_START_ERR', options, function (){}); + }) + .onRelease((releaseCode) => { + var options = { + parameters: { + 'releaseCode': releaseCode + } + } + commonEventManager.publish('ACTS_TEST_RELEASE', options, function (){}); + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/IndexTwo.ets b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/IndexTwo.ets new file mode 100644 index 000000000..183421e58 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/IndexTwo.ets @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct IndexTwo { + @State message: string = 'Other Ability!'; + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button('TerminateCallback0100') + .fontSize(30) + .fontWeight(FontWeight.Bold) + .onClick(() => { + globalThis.StartAbilityForResult_CallBack() + }) + .margin({ + top: 5 + }) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/Page.ets b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/Page.ets new file mode 100644 index 000000000..1d8aff276 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/Page.ets @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Want from '@ohos.app.ability.Want'; +import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession'; +import commonEventManager from '@ohos.commonEventManager'; + +const sleepTimeOne = 1000; +var storage = LocalStorage.GetShared(); + +@Entry(storage) +@Component +struct Page { + @State message: string = 'UIExtAbility'; + @StorageLink('actionWant') want: Want = { + action: "Acts_ActionExtensionAbility_1700", + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'ActsActionExtensionAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }; + private session: UIExtensionContentSession = storage.get('session'); + + aboutToAppear() { + var appearEvent = 'ACTS_UIExtension_AboutToAppear'; + var terminateSelfWithResultEvent = 'ACTS_UIExtension_TerminateSelfWithResult'; + var sendDataEvent = 'ACTS_UIExtension_SendData'; + + var subscriber; + var subscribeInfo = { + events: [terminateSelfWithResultEvent, sendDataEvent] + }; + commonEventManager.createSubscriber(subscribeInfo).then(async (data) => { + console.log('createSubscriber data : ' + JSON.stringify(data)); + subscriber = data; + + commonEventManager.subscribe(subscriber, async (err, data) => { + console.log('SubscribeInfoCallback : ' + JSON.stringify(data)); + if (data.event === terminateSelfWithResultEvent) { + this.session.terminateSelfWithResult({ + 'resultCode': 1, + 'want': { + 'action': 'ACTION' + } + }); + commonEventManager.unsubscribe(subscriber, async (err, data) => { + console.log('UnSubscribeInfoCallback : ' + JSON.stringify(data)); + }); + } else if (data.event === sendDataEvent) { + this.session.sendData({ + name: { + test: 'actionExtensionTest' + } + }); + commonEventManager.unsubscribe(subscriber, async (err, data) => { + console.log('UnSubscribeInfoCallback : ' + JSON.stringify(data)); + }); + } + }); + }).catch((error) => { + console.log('createSubscriber error : ' + JSON.stringify(error)); + }) + setTimeout(() => { + commonEventManager.publish(appearEvent, function (){}); + }, sleepTimeOne); + } + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(30) + .fontWeight(FontWeight.Bold) + UIExtensionComponent(this.want) + .size({width:'100%',height:'100'}) + .backgroundColor(Color.Blue) + .border({width:5,color:Color.Red}) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/PageThree.ets b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/PageThree.ets new file mode 100644 index 000000000..8bedf00ee --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/PageThree.ets @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +var storage = LocalStorage.GetShared(); + +@Entry(storage) +@Component +struct Index3 { + + build() { + Row() { + Column() { + Text('acton') + .fontSize(24) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + .backgroundColor('#e0ffff') + .borderRadius(16) + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/PageTwo.ets b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/PageTwo.ets new file mode 100644 index 000000000..b10b4f798 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/pages/PageTwo.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct PageTwo { + @State message: string = 'Hello World'; + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/module.json b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/module.json new file mode 100644 index 000000000..3731f2bba --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/module.json @@ -0,0 +1,86 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "metadata":[ + { + "name":"test_metadata" + } + ], + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ts", + "description": "$string:EntryAbility_desc", + "icon": "$media:icon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + }, + { + "name": "OtherAbility", + "srcEntry": "./ets/otherability/OtherAbility.ts", + "description": "$string:OtherAbility_desc", + "visible": true, + "icon": "$media:icon", + "label": "$string:OtherAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background" + }, + { + "name": "CalledAbility", + "srcEntry": "./ets/calledability/CalledAbility.ts", + "description": "$string:CalledAbility_desc", + "visible": true, + "icon": "$media:icon", + "label": "$string:CalledAbility_label", + "launchType": "standard", + "exported": false, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background" + } + ], + "extensionAbilities": [ + { + "name": "UIExtAbility", + "icon": "$media:icon", + "description": "UIExtAbility", + "type": "action", + "visible": true, + "srcEntrance": "./ets/UIExtensionAbility/UIExtAbility.ts" + }, + { + "name": "ActsActionExtensionAbility", + "icon": "$media:icon", + "description": "ActsActionExtensionAbility", + "type": "action", + "visible": true, + "srcEntrance": "./ets/actionextensionability/ActsActionExtensionAbility.ts" + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/resources/base/element/color.json b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/resources/base/element/color.json new file mode 100644 index 000000000..d66f9a7d4 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..c27bb8403 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "OtherAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "label" + }, + { + "name": "OtherAbility_label", + "value": "label" + }, + { + "name": "CalledAbility_desc", + "value": "description" + }, + { + "name": "CalledAbility_label", + "value": "label" + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!D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rWnDUR zQBFIRG+X=6NnsI@mxnwm;tf5;_Uxg?jZ8m-m0}&6+DA!qam(p$mN5R})yA_7m$q@| zFEd|dpS595rxQr-n#GjI5i-AhnUE>Cr;jpCqSrD~EwK_DqI^7%3#p5)%T_od!t3SOmH9MyXeeGO2(UQL;ax|x?Ncixmeo1=$ z{-);Au{*tfzOG?KQ~K|ak8-HQ?`Pekhe2WM(8s{xv-p>Zmu_6{G!-oE$7$mY`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}yFeatureActionExtensionAbility onForeground called'); + } + + onBackground() { + console.log('====>FeatureActionExtensionAbility onBackground called'); + } + + onSessionCreate(want, session) { + console.log('====>FeatureActionExtensionAbility onSessionCreate called'); + commonEventManager.publish('ACTS_FEATURE_CREATE', function (){}); + if (want.action === 'Acts_ActionExtensionAbility_0400') { + this.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'FeatureAbility', + action: 'Acts_ActionExtensionAbility_0400' + }) + } + this.message = want.parameters.shareMessages; + this.storage = new LocalStorage( + { + 'session': session, + 'messages': this.message + }); + session.loadContent('pages/Index2', this.storage); + } + + onDestroy() { + console.log('====>FeatureActionExtensionAbility onDestroy called'); + } + + onSessionDestroy(session) { + console.log('====>FeatureActionExtensionAbility onSessionDestroy called'); + } +} diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/ets/featureability/FeatureAbility.ts b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/ets/featureability/FeatureAbility.ts new file mode 100644 index 000000000..77878edc6 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/ets/featureability/FeatureAbility.ts @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import window from '@ohos.window'; + +export default class FeatureAbility extends UIAbility { + onCreate(want, launchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + const TIMEOUT = 50; + globalThis.featureTerminate = (str) => { + setTimeout(() => { + this.context.terminateSelf().then(() => { + console.info('====>terminateSelf' + JSON.stringify(str) + ' end'); + }).catch((err) => { + console.info('====>terminateSelf ' + JSON.stringify(str) + ' err:' + JSON.stringify(err)); + }); + }, TIMEOUT); + }; + + if (want.action === 'Acts_ActionExtensionAbility_0400') { + console.info('====>FeatureAbility want.action == Acts_ActionExtensionAbility_0400'); + AppStorage.SetOrCreate('want', { + action: 'Acts_ActionExtensionAbility_0400', + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'FeatureActionExtensionAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + + if (want.action === 'Acts_ActionExtensionAbility_0200') { + console.info('====>FeatureAbility want.action == Acts_ActionExtensionAbility_0200'); + AppStorage.SetOrCreate('want', { + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'ActsActionExtensionAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + }); + } + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground() { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground() { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/ets/pages/Index.ets b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/ets/pages/Index.ets new file mode 100644 index 000000000..e51777e09 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/ets/pages/Index.ets @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import Want from '@ohos.app.ability.Want'; + +@Entry +@Component +struct Index { + @State message: string = 'Hello World' + @StorageLink('want') want: Want = { + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'ActsActionExtensionAbility', + parameters: { + 'ability.want.params.uiExtensionType': 'action' + } + } + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + UIExtensionComponent(this.want).width('100%').height('35%') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/ets/pages/Index2.ets b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/ets/pages/Index2.ets new file mode 100644 index 000000000..8269a4e97 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/ets/pages/Index2.ets @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +var storage = LocalStorage.GetShared(); + +@Entry(storage) +@Component +struct Index2 { + @State message: string = 'FeatureActionExtensionAbility'; + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(30) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/module.json b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/module.json new file mode 100644 index 000000000..124739b62 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/module.json @@ -0,0 +1,41 @@ +{ + "module": { + "name": "feature", + "type": "feature", + "description": "$string:module_desc", + "mainElement": "FeatureAbility", + "deviceTypes": [ + "default" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "FeatureAbility", + "srcEntry": "./ets/featureability/FeatureAbility.ts", + "description": "$string:FeatureAbility_desc", + "icon": "$media:icon", + "label": "$string:FeatureAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "exported": true + } + ], + "extensionAbilities": [ + { + "name": "FeatureActionExtensionAbility", + "icon": "$media:icon", + "description": "FeatureActionExtensionAbility", + "type": "action", + "exported": true, + "srcEntrance": "./ets/actionextensionability/FeatureActionExtensionAbility.ts" + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND" + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/resources/base/element/color.json b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/resources/base/element/color.json new file mode 100644 index 000000000..d66f9a7d4 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/resources/base/element/string.json b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/resources/base/element/string.json new file mode 100644 index 000000000..01a21433f --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "FeatureAbility_desc", + "value": "description" + }, + { + "name": "FeatureAbility_label", + "value": "label" + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QL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~U5 zHt+i@mraTG5&t@VrthY=&YYM4#p=)vocL5tVzaw%w&ueA=3TF>Utjbxb4UNA?9Jak z@SbB$Vqh(Gn)eB7BCqK--SKWYl9i#5WOu^%6KKCKZ5+N)M?TehVxZ*mQ!QVCz_CjY zJQ=w8vXP&QjE9$EC8*ZwK{aC3=~_U=l~E<4R+hd~G5_uRO6pz|Te5SHp3|53mlDmL zC#MWdAZrI6n{;3{7<2h1mn*FRmzT;v`||JgW!>&X@q$g@`3H`SU%USJrp+b0YwJE% veb)c#Ci#qs=IhrZ{GetFFUm8onQP9J#@LW literal 0 HcmV?d00001 diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/AppScope/app.json b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/AppScope/app.json new file mode 100644 index 000000000..abf2fd00b --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/AppScope/app.json @@ -0,0 +1,19 @@ +{ + "app": { + "bundleName": "com.example.actsactionextensionabilitytest", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 10, + "targetAPIVersion": 10, + "car": { + "apiCompatibleVersion": 10, + "singleUser": false + } + } +} diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..d71e5ead1 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "MyApplication" + } + ] +} diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/AppScope/resources/base/media/app_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ilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/test/Ability.test.ets new file mode 100644 index 000000000..7e0b00123 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/test/Ability.test.ets @@ -0,0 +1,1672 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import commonEvent from '@ohos.commonEventManager'; +import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import { Driver, ON } from '@ohos.UiTest'; + +var abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); +var ACTS_CallFunction = { + events: ['ACTS_CALL_EVENT', 'ACTS_CALL_EVENT_ANOTHER'] +}; +var ACTS_EVENT = { + events: ['ACTS_TEST_FOREGROUND', 'ACTS_TEST_DESTROY', 'ACTS_TEST_RELEASE', 'ACTS_TEST_START_ERR'] +}; +const CONTEXT_WANT = { + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_context' +}; +export default function abilityTest() { + describe('ActsAbilityTest', function () { + + /** + * @tc.number: Acts_ActionExtensionAbility_0100 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: With the same application with the same module, test ActionExtensionAbility lifecycle. + */ + it('Acts_ActionExtensionAbility_0100',0, async function (done) { + var subscriber; + commonEvent.createSubscriber(ACTS_EVENT).then(async (data) => { + console.info(`====>Acts_ActionExtensionAbility_0100 createSubscriber ${data}`); + subscriber = data; + commonEvent.subscribe(data, subscribeCallBack); + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_0100' + }, (err) => { + expect(err.code).assertEqual(0); + }); + + async function subscribeCallBack(err, data) { + console.log('====>Acts_ActionExtensionAbility_0100 subscribeCallBack :' + JSON.stringify(data)); + if (data.event == 'ACTS_TEST_FOREGROUND') { + expect(data.parameters.count).assertEqual(3); + await abilityDelegator.executeShellCommand('aa dump -a').then((data) => { + console.info('====>Acts_ActionExtensionAbility_0100 : data : ' + JSON.stringify(data.stdResult)); + var firstString = data.stdResult.split("entry/ActsActionExtensionAbility"); + var result = firstString[1].split("uri"); + console.info('====>Acts_ActionExtensionAbility_0100 result aa string: ' + JSON.stringify(result[0])); + try { + expect(result[0]).assertContain("main name [ActsActionExtensionAbility]"); + expect(result[0]).assertContain("bundle name [com.example.actsactionextensionabilitytest]"); + expect(result[0]).assertContain("ability type [SERVICE]"); + expect(result[0]).assertContain("app state #FOREGROUND"); + } catch { + expect().assertFail(); + } + }); + + setTimeout(() => { + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'CalledAbility' + }, (err) => { + expect(err.code).assertEqual(0); + }); + }, 1000); + } + if (data.event == 'ACTS_TEST_RELEASE') { + expect(data.parameters.releaseCode).assertEqual(0); + } + if (data.event == 'ACTS_TEST_DESTROY') { + expect(data.parameters.count).assertEqual(6); + setTimeout(() => { + commonEvent.unsubscribe(subscriber, unSubscribeCallback); + }, 500); + } + } + + async function unSubscribeCallback() { + await globalThis.terminate('Acts_ActionExtensionAbility_0100'); + await globalThis.terminateCalledAbility('Acts_ActionExtensionAbility_0100'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_0100 unSubscribeCallback`); + done(); + }, 2000); + } + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_0200 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: With the same application with the different module, test ActionExtensionAbility lifecycle. + */ + it('Acts_ActionExtensionAbility_0200',0, async function (done) { + var subscriber; + commonEvent.createSubscriber(ACTS_EVENT).then(async (data) => { + subscriber = data; + commonEvent.subscribe(data, subscribeCallBack); + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'FeatureAbility', + action: 'Acts_ActionExtensionAbility_0200' + }, (err) => { + expect(err.code).assertEqual(0); + }); + + async function subscribeCallBack(err, data) { + console.log('====>Acts_ActionExtensionAbility_0200 subscribeCallBack :' + JSON.stringify(data)); + if (data.event == 'ACTS_TEST_FOREGROUND') { + expect(data.parameters.count).assertEqual(3); + await abilityDelegator.executeShellCommand('aa dump -a').then((data) => { + console.info('====>Acts_ActionExtensionAbility_0200 : data : ' + JSON.stringify(data.stdResult)); + var firstString = data.stdResult.split("entry/ActsActionExtensionAbility"); + var result = firstString[1].split("uri"); + console.info('====>Acts_ActionExtensionAbility_0200 result aa string: ' + JSON.stringify(result[0])); + try { + expect(result[0]).assertContain("main name [ActsActionExtensionAbility]"); + expect(result[0]).assertContain("bundle name [com.example.actsactionextensionabilitytest]"); + expect(result[0]).assertContain("ability type [SERVICE]"); + expect(result[0]).assertContain("app state #FOREGROUND"); + } catch { + expect().assertFail(); + }; + }); + setTimeout(() => { + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'CalledAbility' + }, (err) => { + expect(err.code).assertEqual(0); + }); + }, 1000); + } + if (data.event == 'ACTS_TEST_RELEASE') { + expect(data.parameters.releaseCode).assertEqual(0); + } + if (data.event == 'ACTS_TEST_DESTROY') { + expect(data.parameters.count).assertEqual(6); + setTimeout(() => { + commonEvent.unsubscribe(subscriber, unSubscribeCallback); + }, 500); + } + } + + async function unSubscribeCallback() { + await globalThis.featureTerminate('Acts_ActionExtensionAbility_0200'); + await globalThis.terminateCalledAbility('Acts_ActionExtensionAbility_0200'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_0200 unSubscribeCallback`); + done(); + }, 2000); + } + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_0300 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: With the different application, test ActionExtensionAbility lifecycle. + */ + it('Acts_ActionExtensionAbility_0300',0, async function (done) { + var subscriber; + commonEvent.createSubscriber(ACTS_EVENT).then(async (data) => { + subscriber = data; + commonEvent.subscribe(data, subscribeCallBack); + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_0300' + }, (err) => { + expect(err.code).assertEqual(0); + }); + + async function subscribeCallBack(err, data) { + console.log('====>Acts_ActionExtensionAbility_0300 subscribeCallBack :' + JSON.stringify(data)); + if (data.event == 'ACTS_TEST_FOREGROUND') { + expect(data.parameters.count).assertEqual(3); + await abilityDelegator.executeShellCommand('aa dump -a').then((data) => { + console.info('====>Acts_ActionExtensionAbility_0300 : data : ' + JSON.stringify(data.stdResult)); + var firstString = data.stdResult.split("entry_assist/ActsActionExtensionAbility"); + var result = firstString[1].split("uri"); + console.info('====>Acts_ActionExtensionAbility_0300 result aa string: ' + JSON.stringify(result[0])); + try { + expect(result[0]).assertContain("main name [ActsActionExtensionAbility]"); + expect(result[0]).assertContain("bundle name [com.example.actsactionextensionabilityrely]"); + expect(result[0]).assertContain("ability type [SERVICE]"); + expect(result[0]).assertContain("app state #FOREGROUND"); + } catch { + expect().assertFail(); + } + }); + + setTimeout(() => { + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilityrely', + abilityName: 'CalledAbility' + }, (err) => { + expect(err.code).assertEqual(0); + }) + }, 1000); + } + if (data.event == 'ACTS_TEST_RELEASE') { + expect(data.parameters.releaseCode).assertEqual(0); + } + if (data.event == 'ACTS_TEST_DESTROY') { + expect(data.parameters.count).assertEqual(6); + setTimeout(() => { + commonEvent.unsubscribe(subscriber, unSubscribeCallback); + }, 500); + } + } + + async function unSubscribeCallback() { + await globalThis.terminate('Acts_ActionExtensionAbility_0300'); + var cmd = 'aa force-stop com.example.actsactionextensionabilityrely'; + await abilityDelegator.executeShellCommand(cmd).catch((error) => { + console.log("====>Acts_ActionExtensionAbility_0300 executeShellCommand error : " + JSON.stringify(error)); + }); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_0300 unSubscribeCallback`); + done(); + }, 2000); + } + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_0400 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Start the same ActionExtensionAbility with different UI components, and the test is successful. + */ + it('Acts_ActionExtensionAbility_0400',0, async function (done) { + var subscriber; + var ACTS_MODULE = { + events: ['ACTS_FEATURE_CREATE'] + }; + commonEvent.createSubscriber(ACTS_MODULE).then(async (data) => { + subscriber = data; + commonEvent.subscribe(data, subscribeCallBack); + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_0400' + }, (err) => { + expect(err.code).assertEqual(0); + }); + + var count = 0; + function subscribeCallBack(err, data) { + console.log('====>Acts_ActionExtensionAbility_0400 subscribeCallBack :' + JSON.stringify(data)); + if (data.event == 'ACTS_FEATURE_CREATE') { + count++; + } + if (count == 2) { + commonEvent.unsubscribe(subscriber, unSubscribeCallback); + } + } + + async function unSubscribeCallback() { + await globalThis.terminate('Acts_ActionExtensionAbility_0400'); + await globalThis.featureTerminate('Acts_ActionExtensionAbility_0400'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_0400 unSubscribeCallback`); + done(); + }, 2000); + } + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_0500 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Start ActionExtensionAbility with invalid bundleName, start failed. + */ + it('Acts_ActionExtensionAbility_0500',0, async function (done) { + var subscriber; + commonEvent.createSubscriber(ACTS_EVENT).then(async (data) => { + subscriber = data; + commonEvent.subscribe(data, subscribeCallBack); + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_0500' + }, (err) => { + expect(err.code).assertEqual(0); + }); + + var flag = true; + function subscribeCallBack(err, data) { + console.log('====>Acts_ActionExtensionAbility_0500 subscribeCallBack :' + JSON.stringify(data)); + if (data.event == 'ACTS_TEST_START_ERR' && flag) { + flag = false; + expect(data.parameters.err.code).assertEqual(1011); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + } + } + + async function unSubscribeCallback() { + await globalThis.terminate('Acts_ActionExtensionAbility_0500'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_0500 unSubscribeCallback`); + done(); + }, 2000); + } + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_0600 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Start ActionExtensionAbility with invalid abilityName, start failed. + */ + it('Acts_ActionExtensionAbility_0600',0, async function (done) { + var subscriber; + commonEvent.createSubscriber(ACTS_EVENT).then(async (data) => { + subscriber = data; + commonEvent.subscribe(data, subscribeCallBack); + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_0600' + }, (err) => { + expect(err.code).assertEqual(0); + }); + + var flag = true; + function subscribeCallBack(err, data) { + console.log('====>Acts_ActionExtensionAbility_0600 subscribeCallBack :' + JSON.stringify(data)); + if (data.event == 'ACTS_TEST_START_ERR' && flag) { + flag = false; + expect(data.parameters.err.code).assertEqual(1011); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + } + } + + function unSubscribeCallback() { + globalThis.terminate('Acts_ActionExtensionAbility_0600'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_0600 unSubscribeCallback`); + done(); + }, 2000); + } + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_0700 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Start ActionExtensionAbility with invalid parameters, start failed. + */ + it('Acts_ActionExtensionAbility_0700',0, async function (done) { + var subscriber; + commonEvent.createSubscriber(ACTS_EVENT).then(async (data) => { + console.info(`====>Acts_ActionExtensionAbility_0700 createSubscriber ${data}`); + subscriber = data; + commonEvent.subscribe(data, subscribeCallBack); + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_0700' + }, (err) => { + expect(err.code).assertEqual(0); + }); + + var flag = true; + function subscribeCallBack(err, data) { + console.info(`====>Acts_ActionExtensionAbility_0700 subscribeCallBack 'ACTS_CALL_EVENT' ${data}`); + if (data.event == 'ACTS_TEST_START_ERR' && flag) { + flag = false; + expect(data.parameters.err.code).assertEqual(1011); + commonEvent.unsubscribe(subscriber, unSubscribeCallback) + } + } + + function unSubscribeCallback() { + globalThis.terminate('Acts_ActionExtensionAbility_0700'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_0700 unSubscribeCallback`); + done(); + }, 2000); + } + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_0800 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test terminateSelfWithResultEvent successful. + */ + it('Acts_ActionExtensionAbility_0800',0, async function (done) { + var appearEvent = 'ACTS_UIExtension_AboutToAppear'; + var onResultEvent = 'ACTS_UIExtension_OnResult'; + var terminateSelfWithResultEvent = 'ACTS_UIExtension_TerminateSelfWithResult'; + + var subscriber; + var subscribeInfo = { + events: [appearEvent, onResultEvent] + } + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_DEFAULT' + }, (err) => { + expect(err.code).assertEqual(0); + }); + + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + + if (data.event == appearEvent) { + commonEvent.publish(terminateSelfWithResultEvent, function (){}); + } else if (data.event == onResultEvent) { + var result = data.parameters.result; + setTimeout(async () => { + commonEvent.unsubscribe(subscriber, async (err, data) => { + expect(result.want.action).assertEqual('ACTION'); + globalThis.terminate('Acts_ActionExtensionAbility_0800'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_0800 unSubscribeCallback`); + done(); + }, 2000); + }); + }, 1000); + } + }); + }).catch((error) => { + globalThis.terminate('Acts_ActionExtensionAbility_0800'); + setTimeout(() => { + console.log("createSubscriber err : " + JSON.stringify(error)); + expect().assertFail(); + }, 2000); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_0900 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test sendData successful. + */ + it('Acts_ActionExtensionAbility_0900',0, async function (done) { + var appearEvent = 'ACTS_UIExtension_AboutToAppear'; + var onReceiveEvent = 'ACTS_UIExtension_OnReceive'; + var sendDataEvent = 'ACTS_UIExtension_SendData'; + + var subscriber; + var subscribeInfo = { + events: [appearEvent, onReceiveEvent] + } + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_DEFAULT' + }, (err) => { + expect(err.code).assertEqual(0); + }); + + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + + if (data.event == appearEvent) { + commonEvent.publish(sendDataEvent, (err) => { + if (err) { + console.log(`publish ACTS_UIExtension_SendData failed, code is ${err.code}, message is ${err.message}`); + } else { + console.log('publish ACTS_UIExtension_SendData success'); + } + }); + } else if (data.event == onReceiveEvent) { + var result = data.parameters.result; + var resultCheck = { + name: { + test: 'actionExtensionTest' + } + }; + setTimeout(async () => { + commonEvent.unsubscribe(subscriber, async (err, data) => { + expect(JSON.stringify(result)).assertEqual(JSON.stringify(resultCheck)); + globalThis.terminate('Acts_ActionExtensionAbility_0900'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_0900 unSubscribeCallback`); + done(); + }, 2000); + }); + }, 1000); + } + }); + }).catch((error) => { + globalThis.terminate('Acts_ActionExtensionAbility_0900'); + setTimeout(() => { + console.log("createSubscriber err : " + JSON.stringify(error)); + expect().assertFail(); + }, 2000); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_1000 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test the startAbility interface in callback form. + */ + it('Acts_ActionExtensionAbility_1000',0, async function (done) { + var subscriber; + commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { + console.info(`====>Acts_ActionExtensionAbility_1000 createSubscriber ${data}`) + subscriber = data + commonEvent.subscribe(data, subscribeCallBack) + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_1000' + },(err) => { + console.info('====>Acts_ActionExtensionAbility_1000 startAbility err:' + JSON.stringify(err)); + }); + }) + + function subscribeCallBack(err, data) { + if(data.event == 'ACTS_CALL_EVENT') { + console.info(`====>Acts_ActionExtensionAbility_1000 subscribeCallBack 'ACTS_CALL_EVENT' ${data}`) + expect(data.parameters.num).assertEqual(0); + commonEvent.unsubscribe(subscriber, unSubscribeCallback); + } + } + + function unSubscribeCallback() { + console.info(`====>Acts_ActionExtensionAbility_1000 unSubscribeCallback 'ACTS_CALL_EVENT'`); + globalThis.terminate('Acts_ActionExtensionAbility_1000'); + setTimeout(() => { + done(); + }, 2000); + } + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_1100 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test the startAbility interface in promiss form. + */ + it('Acts_ActionExtensionAbility_1100',0, async function (done) { + var subscriber; + commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { + console.info(`====>Acts_ActionExtensionAbility_1100 createSubscriber ${data}`) + subscriber = data; + commonEvent.subscribe(data, subscribeCallBack); + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_1100' + },(err) => { + console.info('====>Acts_ActionExtensionAbility_1100 startAbility err:' + JSON.stringify(err)); + }); + }); + + function subscribeCallBack(err, data) { + if(data.event == 'ACTS_CALL_EVENT') { + console.info('====>Acts_ActionExtensionAbility_1100 subscribeCallBack ' + JSON.stringify(data)); + expect(data.parameters.str).assertEqual('success'); + commonEvent.unsubscribe(subscriber, unSubscribeCallback); + } + } + + function unSubscribeCallback() { + console.info(`====>Acts_ActionExtensionAbility_1100 unSubscribeCallback 'ACTS_CALL_EVENT'`); + globalThis.terminate('Acts_ActionExtensionAbility_1100'); + setTimeout(() => { + done(); + }, 2000); + } + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_1200 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test the startAbility interface with invalid want. + */ + it('Acts_ActionExtensionAbility_1200',0, async function (done) { + var subscriber; + commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { + console.info(`====>Acts_ActionExtensionAbility_1200 createSubscriber ${data}`); + subscriber = data; + commonEvent.subscribe(data, subscribeCallBack); + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_1200' + },(err) => { + console.info('====>Acts_ActionExtensionAbility_1200 startAbility err:' + JSON.stringify(err)); + }); + }); + + function subscribeCallBack(err, data) { + if(data.event == 'ACTS_CALL_EVENT') { + console.info('====>Acts_ActionExtensionAbility_1200 subscribeCallBack' + JSON.stringify(data)); + expect(data.parameters.num).assertEqual(16000001); + commonEvent.unsubscribe(subscriber, unSubscribeCallback); + } + } + + function unSubscribeCallback() { + console.info(`====>Acts_ActionExtensionAbility_1200 unSubscribeCallback 'ACTS_CALL_EVENT'`); + globalThis.terminate('Acts_ActionExtensionAbility_1200'); + setTimeout(() => { + done(); + }, 2000); + } + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_1300 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test the startAbilityForResult interface in callback form. + */ + it('Acts_ActionExtensionAbility_1300',0, async function (done) { + var subscriber; + commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { + console.info(`====>Acts_ActionExtensionAbility_1300 createSubscriber ${data}`); + subscriber = data; + commonEvent.subscribe(data, subscribeCallBack); + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_1300' + },(err) => { + console.info('====>Acts_ActionExtensionAbility_1300 startAbility err:' + JSON.stringify(err)); + }); + }); + + function subscribeCallBack(err, data) { + if(data.event == 'ACTS_CALL_EVENT') { + console.info(`====>Acts_ActionExtensionAbility_1300 subscribeCallBack 'ACTS_CALL_EVENT' ${data}`); + expect(data.parameters.str).assertEqual('ACTION'); + expect(data.parameters.result).assertEqual(0); + commonEvent.unsubscribe(subscriber, unSubscribeCallback); + } + }; + + function unSubscribeCallback() { + console.info(`====>Acts_ActionExtensionAbility_1300 unSubscribeCallback 'ACTS_CALL_EVENT'`); + globalThis.terminate('Acts_ActionExtensionAbility_1300'); + setTimeout(() => { + done(); + }, 2000); + } + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_1400 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test the startAbilityForResult interface in promiss form. + */ + it('Acts_ActionExtensionAbility_1400',0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { + console.info(`====>Acts_ActionExtensionAbility_1400 createSubscriber ${data}`); + subscriber = data; + commonEvent.subscribe(data, subscribeCallBack); + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_1400' + },(err) => { + console.info('====>Acts_ActionExtensionAbility_1400 startAbility err:' + JSON.stringify(err)); + }); + }); + + function subscribeCallBack(err, data) { + if(data.event == 'ACTS_CALL_EVENT') { + console.info(`====>Acts_ActionExtensionAbility_1400 subscribeCallBack 'ACTS_CALL_EVENT' ${data}`); + expect(data.parameters.str).assertEqual('ACTION'); + expect(data.parameters.result).assertEqual(0); + commonEvent.unsubscribe(subscriber, unSubscribeCallback); + } + } + + function unSubscribeCallback() { + console.info(`====>Acts_ActionExtensionAbility_1400 unSubscribeCallback 'ACTS_CALL_EVENT'`); + globalThis.terminate('Acts_ActionExtensionAbility_1400'); + setTimeout(() => { + done(); + }, 2000); + } + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_1500 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test the startAbilityForResult interface with invalid want. + */ + it('Acts_ActionExtensionAbility_1500',0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { + console.info(`====>Acts_ActionExtensionAbility_1500 createSubscriber ${data}`); + subscriber = data; + commonEvent.subscribe(data, subscribeCallBack); + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_1500' + },(err) => { + console.info('====>Acts_ActionExtensionAbility_1400 start Own Ability err:' + JSON.stringify(err)); + }); + }); + + function subscribeCallBack(err, data) { + console.info(`====>Acts_ActionExtensionAbility_1500 subscribeCallBack all ${data.event}`); + if(data.event == 'ACTS_CALL_EVENT') { + console.info(`====>Acts_ActionExtensionAbility_1500 subscribeCallBack 'ACTS_CALL_EVENT' ${data}`); + expect(data.parameters.num).assertEqual(16000001); + commonEvent.unsubscribe(subscriber, unSubscribeCallback); + } + } + + function unSubscribeCallback() { + console.info(`====>Acts_ActionExtensionAbility_1500 unSubscribeCallback 'ACTS_CALL_EVENT'`); + setTimeout(() => { + globalThis.terminate('Acts_ActionExtensionAbility_1500'); + done(); + }, 2000); + } + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_1600 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test setReceiveDataCallback successful. + */ + it('Acts_ActionExtensionAbility_1600',0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['setReceiveDataCallback'] + }; + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_1600' + }, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'setReceiveDataCallback') { + var resultCheck = { + name: { + test: 'actionExtensionTest' + } + }; + expect(JSON.stringify(data.parameters.result)).assertEqual(JSON.stringify(resultCheck)); + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_1600'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_1600 unSubscribeCallback`); + done(); + }, 2000); + }); + } + }); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_1700 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Use ui components continuously to start two ActionExtensionAbility. + */ + it('Acts_ActionExtensionAbility_1700',0, async function (done) { + await Driver.create().delayMs(2000); + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_1700' + }, (err) => { + expect(err.code).assertEqual(0); + }); + await Driver.create().delayMs(2000); + await abilityDelegator.executeShellCommand('aa dump -a').then((data) => { + console.info('====>Acts_ActionExtensionAbility_1700 : data : ' + JSON.stringify(data.stdResult)); + try { + expect(JSON.stringify(data)).assertContain("main name [ActsActionExtensionAbility]"); + expect(JSON.stringify(data)).assertContain("main name [UIExtAbility]"); + } catch { + expect().assertFail(); + } + }); + globalThis.terminate('Acts_ActionExtensionAbility_1700'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_1700 unSubscribeCallback`); + done(); + }, 2000); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_1800 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test starts ActionExtensionAbility using startAbility interface. + */ + it('Acts_ActionExtensionAbility_1800',0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['ACTS_CALL_EVENT'] + }; + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_1800' + }, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'ACTS_CALL_EVENT') { + await abilityDelegator.executeShellCommand('aa dump -a').then((data) => { + console.info('====>Acts_ActionExtensionAbility_1800 : data : ' + JSON.stringify(data.stdResult)); + try { + expect(JSON.stringify(data)).assertContain("main name [ActsActionExtensionAbility]"); + expect(JSON.stringify(data)).assertContain("main name [UIExtAbility]"); + } catch { + expect().assertFail(); + } + }); + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_1800'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_1800 unSubscribeCallback`); + done(); + }, 2000); + }); + } + }); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_1900 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test hapModuleInfo in context + */ + it('Acts_ActionExtensionAbility_1900',0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['ACTS_TEST_CONTEXT'] + }; + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility(CONTEXT_WANT, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'ACTS_TEST_CONTEXT') { + try { + expect(data.parameters.context != null).assertTrue(); + var hapModuleInfo = data.parameters.context.currentHapModuleInfo; + expect(hapModuleInfo != null).assertTrue(); + console.log("====>Acts_ActionExtensionAbility_1900 hapModuleInfo : " + JSON.stringify(hapModuleInfo)); + console.log(`Acts_ActionExtensionAbility_1900 hapModuleInfo.name: ` + hapModuleInfo.name); + expect(hapModuleInfo.name == "entry").assertTrue(); + console.log(`Acts_ActionExtensionAbility_1900 hapModuleInfo.icon: ` + hapModuleInfo.icon); + expect(hapModuleInfo.icon == "$media:icon").assertTrue(); + console.log(`Acts_ActionExtensionAbility_1900 hapModuleInfo.iconId: ` + hapModuleInfo.iconId); + expect(typeof (hapModuleInfo.iconId) == 'number').assertTrue(); + console.log(`Acts_ActionExtensionAbility_1900 hapModuleInfo.label: ` + hapModuleInfo.label); + expect(hapModuleInfo.label == "$string:EntryAbility_label").assertTrue(); + console.log(`Acts_ActionExtensionAbility_1900 hapModuleInfo.labelId: ` + hapModuleInfo.labelId); + expect(typeof (hapModuleInfo.labelId) == 'number').assertTrue(); + console.log(`Acts_ActionExtensionAbility_1900 hapModuleInfo.description: ` + hapModuleInfo.description); + expect(hapModuleInfo.description == "$string:module_desc").assertTrue(); + console.log(`Acts_ActionExtensionAbility_1900 hapModuleInfo.descriptionId: ` + hapModuleInfo.descriptionId); + expect(typeof (hapModuleInfo.descriptionId) == 'number').assertTrue(); + console.log(`Acts_ActionExtensionAbility_1900 hapModuleInfo.mainElementName: ` + hapModuleInfo.mainElementName); + expect(hapModuleInfo.mainElementName == "EntryAbility").assertTrue(); + console.log(`Acts_ActionExtensionAbility_1900 hapModuleInfo.metadata: ` + hapModuleInfo.metadata.length); + expect(hapModuleInfo.metadata.length >= 0).assertTrue(); + + console.log(`Acts_ActionExtensionAbility_1900 success`); + setTimeout(async () => { + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_1900'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_1900 unSubscribeCallback`); + done(); + }, 2000); + }); + }, 1000); + } catch (err) { + globalThis.terminate('Acts_ActionExtensionAbility_1900'); + setTimeout(() => { + console.log(`Acts_ActionExtensionAbility_1900 fail: ` + err); + expect().assertFail(); + }, 2000); + } + } + }); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_2000 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test config in context + */ + it('Acts_ActionExtensionAbility_2000',0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['ACTS_TEST_CONTEXT'] + }; + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility(CONTEXT_WANT, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'ACTS_TEST_CONTEXT') { + try { + expect(data.parameters.context != null).assertTrue(); + expect(data.parameters.context != null).assertTrue(); + var config = data.parameters.context.config; + expect(config != null).assertTrue(); + console.log(`Acts_ActionExtensionAbility_2000 config.colorMode: ` + config.colorMode); + expect(typeof (config.colorMode) == 'number').assertTrue(); + console.log(`Acts_ActionExtensionAbility_2000 config.direction: ` + config.direction); + expect(typeof (config.direction) == 'number').assertTrue(); + console.log(`Acts_ActionExtensionAbility_2000 success`); + setTimeout(async () => { + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_2000'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_2000 unSubscribeCallback`); + done(); + }, 2000); + }); + }, 1000); + } catch (err) { + globalThis.terminate('Acts_ActionExtensionAbility_2000'); + setTimeout(() => { + console.log(`Acts_ActionExtensionAbility_2000 fail: ` + err); + expect().assertFail(); + }, 2000); + } + } + }); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_2100 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test extensionAbilityInfo in context + */ + it('Acts_ActionExtensionAbility_2100',0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['ACTS_TEST_CONTEXT'] + }; + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility(CONTEXT_WANT, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'ACTS_TEST_CONTEXT') { + try { + expect(data.parameters.context != null).assertTrue(); + var extensionAbilityInfo = data.parameters.context.extensionAbilityInfo; + expect(extensionAbilityInfo != null).assertTrue(); + console.log(`Acts_ActionExtensionAbility_2100 extensionAbilityInfo: ` + JSON.stringify(extensionAbilityInfo)); + expect(extensionAbilityInfo.bundleName == 'com.example.actsactionextensionabilitytest').assertTrue(); + console.log(`extensionAbilityInfo.descriptionId: ` + JSON.stringify(extensionAbilityInfo.descriptionId)); + expect(typeof (extensionAbilityInfo.descriptionId) == 'number').assertTrue(); + console.log(`extensionAbilityInfo.enabled: ` + JSON.stringify(extensionAbilityInfo.enabled)); + expect(typeof (extensionAbilityInfo.enabled) == 'boolean').assertTrue(); + console.log(`extensionAbilityInfo.exported: ` + JSON.stringify(extensionAbilityInfo.exported)); + expect(typeof (extensionAbilityInfo.exported) == 'boolean').assertTrue(); + console.log(`extensionAbilityInfo.extensionAbilityType: ` + JSON.stringify(extensionAbilityInfo.extensionAbilityType)); + expect(extensionAbilityInfo.extensionAbilityType == 19).assertTrue(); + console.log(`extensionAbilityInfo.iconId: ` + JSON.stringify(extensionAbilityInfo.iconId)); + expect(typeof (extensionAbilityInfo.iconId) == 'number').assertTrue(); + console.log(`extensionAbilityInfo.isVisible: ` + JSON.stringify(extensionAbilityInfo.isVisible)); + expect(typeof (extensionAbilityInfo.isVisible) == 'boolean').assertTrue(); + console.log(`extensionAbilityInfo.labelId: ` + JSON.stringify(extensionAbilityInfo.labelId)); + expect(typeof (extensionAbilityInfo.labelId) == 'number').assertTrue(); + console.log(`extensionAbilityInfo.moduleName: ` + JSON.stringify(extensionAbilityInfo.moduleName)); + expect(extensionAbilityInfo.moduleName == 'entry').assertTrue(); + console.log(`extensionAbilityInfo.name: ` + JSON.stringify(extensionAbilityInfo.name)); + expect(extensionAbilityInfo.name == 'UIExtAbility').assertTrue(); + setTimeout(async () => { + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_2100'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_2100 unSubscribeCallback`); + done(); + }, 2000); + }); + }, 1000); + } catch (err) { + globalThis.terminate('Acts_ActionExtensionAbility_2100'); + setTimeout(() => { + console.log(`Acts_ActionExtensionAbility_2100 fail: ` + err); + expect().assertFail(); + }, 2000); + } + } + }); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_2200 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test resourceManager in context + */ + it('Acts_ActionExtensionAbility_2200', 0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['ACTS_CALL_EVENT'] + }; + + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_2200' + }, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'ACTS_CALL_EVENT') { + expect(data.parameters.resourceManager != null).assertTrue(); + console.log('Acts_ActionExtensionAbility_2200 success'); + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_2200'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_2200 unSubscribeCallback`); + done(); + }, 2000); + }); + } + }); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_2300 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test applicationInfo in context + */ + it('Acts_ActionExtensionAbility_2300', 0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['ACTS_CALL_EVENT'] + }; + + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_2300' + }, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'ACTS_CALL_EVENT') { + console.log(`Acts_ActionExtensionAbility_2300 applicationInfo.name: ` + data.parameters.name); + expect(data.parameters.name == 'com.example.actsactionextensionabilitytest').assertTrue(); + console.log(`Acts_ActionExtensionAbility_2300 applicationInfo.description: ` + data.parameters.description_length); + expect(data.parameters.description_length >= 0).assertTrue(); + console.log(`Acts_ActionExtensionAbility_2300 applicationInfo.descriptionId: ` + data.parameters.descriptionId); + expect(data.parameters.descriptionId == 0).assertTrue(); + console.log(`Acts_ActionExtensionAbility_2300 applicationInfo.label: ` + data.parameters.label); + expect(data.parameters.label == '$string:app_name').assertTrue(); + console.log(`Acts_ActionExtensionAbility_2300 applicationInfo.labelId: ` + data.parameters.labelId); + expect(data.parameters.labelId != null).assertTrue(); + console.log(`Acts_ActionExtensionAbility_2300 applicationInfo.icon: ` + data.parameters.icon); + expect(data.parameters.icon == '$media:app_icon').assertTrue(); + console.log(`Acts_ActionExtensionAbility_2300 applicationInfo.iconId: ` + data.parameters.iconId); + expect(data.parameters.iconId != null).assertTrue(); + console.log(`Acts_ActionExtensionAbility_2300 applicationInfo.codePath: ` + data.parameters.codePath); + expect(data.parameters.codePath == 'string').assertTrue(); + console.log(`Acts_ActionExtensionAbility_2300 success`); + + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_2300'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_2300 unSubscribeCallback`); + done(); + }, 2000); + }); + } + }); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_2400 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test cacheDir in context + */ + it('Acts_ActionExtensionAbility_2400', 0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['ACTS_CALL_EVENT'] + }; + + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_2400' + }, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'ACTS_CALL_EVENT') { + let cacheDir = data.parameters.cacheDir; + console.log(`Acts_ActionExtensionAbility_2400 cacheDir:` + cacheDir); + expect(typeof (cacheDir) == 'string').assertTrue(); + console.log(`Acts_ActionExtensionAbility_2400 success`); + + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_2400'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_2400 unSubscribeCallback`); + done(); + }, 2000); + }); + } + }); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_2500 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test tempDir in context + */ + it('Acts_ActionExtensionAbility_2500', 0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['ACTS_CALL_EVENT'] + }; + + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_2500' + }, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'ACTS_CALL_EVENT') { + let tempDir = data.parameters.tempDir; + console.log(`Acts_ActionExtensionAbility_2500 tempDir:` + tempDir); + expect(typeof (tempDir) == 'string').assertTrue(); + console.log(`Acts_ActionExtensionAbility_2500 success`); + + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_2500'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_2500 unSubscribeCallback`); + done(); + }, 2000); + }); + } + }); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_2600 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test filesDir in context + */ + it('Acts_ActionExtensionAbility_2600', 0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['ACTS_CALL_EVENT'] + }; + + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_2600' + }, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'ACTS_CALL_EVENT') { + let filesDir = data.parameters.filesDir; + console.log(`Acts_ActionExtensionAbility_2600 filesDir:` + filesDir); + expect(typeof (filesDir) == 'string').assertTrue(); + console.log(`Acts_ActionExtensionAbility_2600 success`); + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_2600'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_2600 unSubscribeCallback`); + done(); + }, 2000); + }); + } + }); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_2700 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test databaseDir in context + */ + it('Acts_ActionExtensionAbility_2700', 0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['ACTS_CALL_EVENT'] + }; + + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_2700' + }, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'ACTS_CALL_EVENT') { + let databaseDir = data.parameters.databaseDir; + console.log(`Acts_ActionExtensionAbility_2700 databaseDir:` + databaseDir); + expect(typeof (databaseDir) == 'string').assertTrue(); + console.log(`Acts_ActionExtensionAbility_2700 success`); + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_2700'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_2700 unSubscribeCallback`); + done(); + }, 2000); + }); + } + }); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_2800 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test preferencesDir in context + */ + it('Acts_ActionExtensionAbility_2800', 0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['ACTS_CALL_EVENT'] + }; + + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_2800' + }, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'ACTS_CALL_EVENT') { + let preferencesDir = data.parameters.preferencesDir; + console.log(`Acts_ActionExtensionAbility_2800 preferencesDir:` + preferencesDir); + expect(typeof (preferencesDir) == 'string').assertTrue(); + console.log(`Acts_ActionExtensionAbility_2800 success`); + + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_2800'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_2800 unSubscribeCallback`); + done(); + }, 2000); + }); + } + }); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_2900 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Test bundleCodeDir in context + */ + it('Acts_ActionExtensionAbility_2900', 0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['ACTS_CALL_EVENT'] + }; + + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_2900' + }, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'ACTS_CALL_EVENT') { + let bundleCodeDir = data.parameters.bundleCodeDir; + console.log(`Acts_ActionExtensionAbility_2900 bundleCodeDir:` + bundleCodeDir); + expect(typeof (bundleCodeDir) == 'string').assertTrue(); + console.log(`Acts_ActionExtensionAbility_2900 success`); + + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_2900'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_2900 unSubscribeCallback`); + done(); + }, 2000); + }); + } + }); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_3000 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Context calls createModuleContext, passing in the moduleName of the current application hap1 + */ + it('Acts_ActionExtensionAbility_3000',0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['ACTS_TEST_CONTEXT'] + }; + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_3000' + }, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'ACTS_TEST_CONTEXT') { + try { + expect(data.parameters.bundleName != null).assertTrue(); + expect(data.parameters.bundleName).assertEqual("com.example.actsactionextensionabilitytest"); + setTimeout(async () => { + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_3000'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_3000 unSubscribeCallback`); + done(); + }, 2000); + }); + }, 1000); + } catch (err) { + globalThis.terminate('Acts_ActionExtensionAbility_3000'); + setTimeout(() => { + console.log(`Acts_ActionExtensionAbility_3000 fail: ` + err); + expect().assertFail(); + }, 2000); + } + } + }); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_3100 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Context calls createModuleContext, passing in the moduleName of the current application hap2 + */ + it('Acts_ActionExtensionAbility_3100',0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['ACTS_TEST_CONTEXT'] + }; + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_3100' + }, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'ACTS_TEST_CONTEXT') { + try { + expect(data.parameters.bundleName != null).assertTrue(); + expect(data.parameters.bundleName).assertEqual("com.example.actsactionextensionabilitytest"); + setTimeout(async () => { + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_3000'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_3000 unSubscribeCallback`); + done(); + }, 2000); + }); + }, 1000); + } catch (err) { + globalThis.terminate('Acts_ActionExtensionAbility_3100'); + setTimeout(() => { + console.log(`Acts_ActionExtensionAbility_3100 fail: ` + err); + expect().assertFail(); + }, 2000); + } + } + }); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_3200 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Context calls createModuleContext, passing in the moduleName of the cross-application hap1 + */ + it('Acts_ActionExtensionAbility_3200',0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['ACTS_TEST_CONTEXT'] + }; + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_3200' + }, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'ACTS_TEST_CONTEXT') { + try { + expect(!data.parameters.moduleContext).assertTrue(); + setTimeout(async () => { + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_3200'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_3200 unSubscribeCallback`); + done(); + }, 2000); + }); + }, 1000); + } catch (err) { + globalThis.terminate('Acts_ActionExtensionAbility_3200'); + setTimeout(() => { + console.log(`Acts_ActionExtensionAbility_3200 fail: ` + err); + expect().assertFail(); + }, 2000); + } + } + }); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_3300 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Context calls createModuleContext, passing in a non-existing moduleName + */ + it('Acts_ActionExtensionAbility_3300',0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['ACTS_TEST_CONTEXT'] + }; + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_3300' + }, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'ACTS_TEST_CONTEXT') { + try { + expect(!data.parameters.moduleContext).assertTrue(); + setTimeout(async () => { + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_3300'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_3300 unSubscribeCallback`); + done(); + }, 2000); + }); + }, 1000); + } catch (err) { + globalThis.terminate('Acts_ActionExtensionAbility_3300'); + setTimeout(() => { + console.log(`Acts_ActionExtensionAbility_3300 fail: ` + err); + expect().assertFail(); + }, 2000); + } + } + }); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_3400 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: Context calls createModuleContext, and the incoming moduleName is undefined + */ + it('Acts_ActionExtensionAbility_3400',0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['ACTS_TEST_CONTEXT'] + }; + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_3400' + }, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'ACTS_TEST_CONTEXT') { + try { + expect(!data.parameters.moduleContext).assertTrue(); + setTimeout(async () => { + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_3400'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_3400 unSubscribeCallback`); + done(); + }, 2000); + }); + }, 1000); + } catch (err) { + globalThis.terminate('Acts_ActionExtensionAbility_3400'); + setTimeout(() => { + console.log(`Acts_ActionExtensionAbility_3400 fail: ` + err); + expect().assertFail(); + }, 2000); + } + } + }); + }); + }) + + /** + * @tc.number: Acts_ActionExtensionAbility_3500 + * @tc.name: Test ActionExtensionAbility basic function. + * @tc.desc: test getApplicationContext return not empty + */ + it('Acts_ActionExtensionAbility_3500',0, async function (done) { + await Driver.create().delayMs(2000); + var subscriber; + var subscribeInfo = { + events: ['ACTS_TEST_CONTEXT'] + }; + await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { + console.log("createSubscriber data : " + JSON.stringify(data)); + subscriber = data; + globalThis.context.startAbility({ + bundleName: 'com.example.actsactionextensionabilitytest', + abilityName: 'EntryAbility', + action: 'Acts_ActionExtensionAbility_3500' + }, (err) => { + expect(err.code).assertEqual(0); + }); + commonEvent.subscribe(subscriber, async (err, data) => { + console.log("SubscribeInfoCallback : " + JSON.stringify(data)); + if (data.event == 'ACTS_TEST_CONTEXT') { + try { + expect(data.parameters.applicationContext != null).assertTrue(); + setTimeout(async () => { + commonEvent.unsubscribe(subscriber, async (err, data) => { + globalThis.terminate('Acts_ActionExtensionAbility_3500'); + setTimeout(() => { + console.info(`====>Acts_ActionExtensionAbility_3500 unSubscribeCallback`); + done(); + }, 2000); + }); + }, 1000); + } catch (err) { + globalThis.terminate('Acts_ActionExtensionAbility_3500'); + setTimeout(() => { + console.log(`Acts_ActionExtensionAbility_3500 fail: ` + err); + expect().assertFail(); + }, 2000); + } + } + }); + }); + }) + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/test/List.test.ets new file mode 100644 index 000000000..f133cdf57 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/test/List.test.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import abilityTest from './Ability.test'; + +export default function testsuite() { + abilityTest(); +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/testability/TestAbility.ets b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/testability/TestAbility.ets new file mode 100644 index 000000000..3f8a95b41 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/testability/TestAbility.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import UIAbility from '@ohos.app.ability.UIAbility'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import hilog from '@ohos.hilog'; +import { Hypium } from '@ohos/hypium'; +import testsuite from '../test/List.test'; +import window from '@ohos.window'; + +export default class TestAbility extends UIAbility { + onCreate(want, launchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); + globalThis.context = this.context; + var abilityDelegator: any; + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + var abilityDelegatorArguments: any; + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite); + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('testability/pages/Index', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/testability/pages/Index.ets b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/testability/pages/Index.ets new file mode 100644 index 000000000..8d97b5c21 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/testability/pages/Index.ets @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import hilog from '@ohos.hilog'; + +@Entry +@Component +struct Index { + aboutToAppear() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); + } + @State message: string = 'Hello World'; + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .width('35%') + .height('5%') + .onClick(()=>{ + }) + } + .width('100%') + } + .height('100%') + } + } \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/module.json b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/module.json new file mode 100644 index 000000000..83894d37b --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/module.json @@ -0,0 +1,41 @@ +{ + "module": { + "name": "entry_test", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "abilities": [ + { + "name": "TestAbility", + "srcEntry": "./ets/testability/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "exported": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND" + } + ] + } +} diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/resources/base/element/color.json b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/resources/base/element/color.json new file mode 100644 index 000000000..3c712962d --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..65d8fa5a7 --- /dev/null +++ b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb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