diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/AppScope/app.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/AppScope/app.json deleted file mode 100644 index 9087707bf3c287cfc49008a669c937d3c027742c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/AppScope/app.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "app": { - "bundleName": "com.example.applicationstatechangeonereply", - "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/getrunningprocessinformation/ApplicationStateChangeOneReply/AppScope/resources/base/element/string.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/AppScope/resources/base/element/string.json deleted file mode 100644 index b4d147945d6938b849e36414954d633f8d7db5c3..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ApplicationStateChangeOneReply" - } - ] -} diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/BUILD.gn b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/BUILD.gn deleted file mode 100644 index f1daca7ca5c27416352eeae23f098062403231c0..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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") - -ohos_hap_assist_suite("ApplicationStateChangeOneReply") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":applicationstatechangeonereply_js_assets", - ":applicationstatechangeonereply_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ApplicationStateChangeOneReply" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("applicationstatechangeonereply_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("applicationstatechangeonereply_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("applicationstatechangeonereply_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":applicationstatechangeonereply_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/ets/entryability/EntryAbility.ts b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/ets/entryability/EntryAbility.ts deleted file mode 100644 index 08bbc7445600342b3353b16bf13f95c4aa3df826..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/ets/entryability/EntryAbility.ts +++ /dev/null @@ -1,146 +0,0 @@ -/* - * 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'; -import Ability from '@ohos.app.ability.UIAbility' -import Window from '@ohos.window' -import commonEvent from '@ohos.commonEvent'; -let commonStateArr: number[] = [-1, -1, -1, -1] -let commonEventData = { - parameters: { - commonStateArr: commonStateArr - } -} -let onForeGroundTAG = -1 -let TAG = 'StateChangeTestTAG' -let ApplicationStateChangeCallbackFir = { - onApplicationForeground() { - console.log(TAG, 'ApplicationStateChangeCallbackFir onApplicationForeground') - commonEventData.parameters.commonStateArr[0] = 1 - - setTimeout(() => { - console.info('Enter onApplicationForeground publish!') - commonEvent.publish('processState', commonEventData, (err) => { - console.info("====>processState publish err: " + JSON.stringify(err)) - }) - }, 1000) - - }, - onApplicationBackground() { - console.log(TAG, 'ApplicationStateChangeCallbackFir onApplicationBackground') - commonEventData.parameters.commonStateArr[1] = 1 - - if (globalThis.want.action == 'NeedBackGroundOff' || globalThis.want.action == 'MultiAppRegister') { - console.info('entered needbackgroundoff!') - globalThis.applicationContext.off('applicationStateChange', ApplicationStateChangeCallbackFir) - } - } -} - -let ApplicationStateChangeCallbackSec = { - onApplicationForeground() { - console.log(TAG, 'ApplicationStateChangeCallbackSec onApplicationForeground') - commonEventData.parameters.commonStateArr[2] = 1 - }, - onApplicationBackground() { - console.log(TAG, 'ApplicationStateChangeCallbackSec onApplicationBackground') - commonEventData.parameters.commonStateArr[3] = 1 - if (globalThis.want.action == 'doubleNeedBackGroundOff') { - setTimeout(() => { - globalThis.applicationContext.off('applicationStateChange', ApplicationStateChangeCallbackSec) - }, 500) - } - else if (globalThis.want.action == 'DoubleRegisterOff') { - setTimeout(() => { - console.info('entered DoubleRegisterOff') - globalThis.applicationContext.off('applicationStateChange') - }, 500) - } - } -} -export default class EntryAbility extends Ability { - onCreate(want, launchParam) { - onForeGroundTAG = -1 - for (let i = 0; i < 4; i++) { - commonStateArr[i] = -1 - } - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); - globalThis.abilityContext = this.context - globalThis.want = want - globalThis.applicationContext = this.context.getApplicationContext(); - if (globalThis.want.action == 'RegisterOnOffOn') { - globalThis.applicationContext.on('applicationStateChange', ApplicationStateChangeCallbackFir) - globalThis.applicationContext.off('applicationStateChange', ApplicationStateChangeCallbackFir) - } - globalThis.applicationContext.on('applicationStateChange', ApplicationStateChangeCallbackFir) - if (globalThis.want.action == 'doubleRegister' || globalThis.want.action == 'doubleNeedBackGroundOff' - || globalThis.want.action == 'DoubleRegisterOff') { - console.info("double in action is logic entered!") - globalThis.applicationContext.on('applicationStateChange', ApplicationStateChangeCallbackSec) - } - - } - - onDestroy() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: Window.WindowStage) { - // Main window is created, set main page for this ability - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - 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.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground() { - // Ability has brought to foreground - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Abilityone onForeground'); - onForeGroundTAG += 1 - if (onForeGroundTAG == 1 && (globalThis.want.action == 'NeedBackGroundOff' || globalThis.want.action == 'MultiAppRegister' - || globalThis.want.action == 'DoubleRegisterOff')) { - setTimeout(() => { - commonEvent.publish('processState', commonEventData, (err) => { - console.info("====>processState publish err: " + JSON.stringify(err)) - }) - }, 2000) - - } - } - - onBackground() { - // Ability has back to background - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Abilityone onBackground'); - } -} diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/ets/pages/Index.ets b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index ad7ec009d021f1ebecb5a816a69e3c80cf654b63..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 Index { - @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/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/module.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/module.json deleted file mode 100644 index 744de4947a3779088b8c551e3bef74beda2255e8..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/module.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntrance": "./ets/entryability/EntryAbility.ts", - "description": "$string:EntryAbility_desc", - "icon": "$media:icon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "visible": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/resources/base/element/color.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/resources/en_US/element/string.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/resources/zh_CN/element/string.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 597ecf95e61d7e30367c22fe2f8638008361b044..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/signature/openharmony_sx.p7b b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/signature/openharmony_sx.p7b deleted file mode 100644 index 011ef05d5dd78a233599f5034f92275365050e80..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/AppScope/app.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/AppScope/app.json deleted file mode 100644 index 11026896c3a086ba0261051e3fd2ff338eb05016..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/AppScope/app.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "app": { - "bundleName": "com.example.applicationstatechangethreereply", - "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/getrunningprocessinformation/ApplicationStateChangeThreeReply/AppScope/resources/base/element/string.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/AppScope/resources/base/element/string.json deleted file mode 100644 index ed62247d7712519262bc6d406f2aa51bd27b818c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ApplicationStateChangeThreeReply" - } - ] -} diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/BUILD.gn b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/BUILD.gn deleted file mode 100644 index b94d433c9e6becbe8048de85850d79aea28bd387..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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") - -ohos_hap_assist_suite("ApplicationStateChangeThreeReply") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":applicationstatechangethreereply_js_assets", - ":applicationstatechangethreereply_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ApplicationStateChangeThreeReply" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("applicationstatechangethreereply_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("applicationstatechangethreereply_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("applicationstatechangethreereply_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":applicationstatechangethreereply_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/entryability/EntryAbility.ts b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/entryability/EntryAbility.ts deleted file mode 100644 index b75a41e2f998db3855b2867f3f7f9eed1269a6d4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/entryability/EntryAbility.ts +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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'; -import Ability from '@ohos.app.ability.UIAbility' -import Window from '@ohos.window' -import commonEvent from '@ohos.commonEvent' - - -let TAG = 'getRunningProcess' -let commonStateArr -let commonEventData = { - parameters: { - commonStateArr: commonStateArr - } -} -let ApplicationStateChangeCallbackFir = { - onApplicationForeground() { - console.log(TAG, 'ApplicationStateChangeCallbackFir onApplicationForeground') - }, - onApplicationBackground() { - console.log(TAG, 'ApplicationStateChangeCallbackFir onApplicationBackground') - setTimeout(() => { - console.info('Enter onApplicationForeground publish!') - commonEventData.parameters.commonStateArr = 1 - commonEvent.publish('processState', commonEventData, (err) => { - console.info("====>processState publish err: " + JSON.stringify(err)) - }) - }, 1000) - } -} -let ForegroundTAG = -1 -export default class EntryAbility extends Ability { - onCreate(want, launchParam) { - ForegroundTAG = -1 - commonEventData.parameters.commonStateArr = -1 - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); - globalThis.abilityContext1 = this.context - globalThis.want1 = want - globalThis.applicationContext1 = this.context.getApplicationContext(); - globalThis.applicationContext1.on('applicationStateChange', ApplicationStateChangeCallbackFir) - - } - - onDestroy() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: Window.WindowStage) { - // Main window is created, set main page for this ability - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - 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.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground() { - // Ability has brought to foreground - ForegroundTAG++ - if (ForegroundTAG == 1) { - setTimeout(() => { - commonEvent.publish('processState', commonEventData, (err) => { - console.info("====>processState publish err: " + JSON.stringify(err)) - }) - }, 3000) - - } - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground() { - // Ability has back to background - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); - } -} diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/entryability1/EntryAbility1.ts b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/entryability1/EntryAbility1.ts deleted file mode 100644 index 65d03a40477fcca9e8309f1ef1cc6f57eec59dee..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/entryability1/EntryAbility1.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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'; -import Ability from '@ohos.app.ability.UIAbility' -import Window from '@ohos.window' - -export default class EntryAbility1 extends Ability { - onCreate(want, launchParam) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); - globalThis.abilityContext2 = this.context - globalThis.want2 = want - globalThis.applicationContext2 = this.context.getApplicationContext(); - } - - onDestroy() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: Window.WindowStage) { - // Main window is created, set main page for this ability - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - 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.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground() { - // Ability has brought to foreground - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); - setTimeout(() => { - globalThis.abilityContext2.terminateSelf((err) => { - console.log('terminateSelf result:' + JSON.stringify(err)); - }) - }, 3000) - } - - onBackground() { - // Ability has back to background - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); - } -} diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/pages/Index.ets b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index ad7ec009d021f1ebecb5a816a69e3c80cf654b63..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 Index { - @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/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/pages/Index1.ets b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/pages/Index1.ets deleted file mode 100644 index ed56120fd06b8c1da8fb47f9a7ebf692c37a2937..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/pages/Index1.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 Index1 { - @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/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/module.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/module.json deleted file mode 100644 index 68978ce749059ecd4ee82bdcbeb4f3b0676155d3..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/module.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntrance": "./ets/entryability/EntryAbility.ts", - "description": "$string:EntryAbility_desc", - "icon": "$media:icon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "visible": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - }, - { - "name": "EntryAbility1", - "srcEntrance": "./ets/entryability1/EntryAbility1.ts", - "description": "$string:EntryAbility1_desc", - "icon": "$media:icon", - "label": "$string:EntryAbility1_label", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "visible": true - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/resources/base/element/color.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 922f8b0c516fdb4c0925dc146a51c12dffe426a7..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "EntryAbility1_desc", - "value": "description" - }, - { - "name": "EntryAbility1_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 097c1e806d73c7aba1ef9ed4cc12d53e266d4d2b..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/Index", - "pages/Index1" - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/resources/en_US/element/string.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 922f8b0c516fdb4c0925dc146a51c12dffe426a7..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "EntryAbility1_desc", - "value": "description" - }, - { - "name": "EntryAbility1_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/resources/zh_CN/element/string.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 38ffb2c06734f8b88e3f1a728ec8735879759c6e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "EntryAbility1_desc", - "value": "description" - }, - { - "name": "EntryAbility1_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/signature/openharmony_sx.p7b b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/signature/openharmony_sx.p7b deleted file mode 100644 index 2185a3d683ff2587937d945bc20ed5f515d0a432..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/AppScope/app.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/AppScope/app.json deleted file mode 100644 index 1ea420be7f749203f60585ffa4d58d6eb5d7c1fc..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/AppScope/app.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "app": { - "bundleName": "com.example.applicationstatechangetworeply", - "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/getrunningprocessinformation/ApplicationStateChangeTwoReply/AppScope/resources/base/element/string.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/AppScope/resources/base/element/string.json deleted file mode 100644 index b876fbbb461af8a131197b7f34a6c473d222cea8..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ApplicationStateChangeTwoReply" - } - ] -} diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/BUILD.gn b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/BUILD.gn deleted file mode 100644 index 103e1b16d26e61f21ec891a2bae44f459b5cba73..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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") - -ohos_hap_assist_suite("ApplicationStateChangeTwoReply") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":applicationstatechangetworeply_js_assets", - ":applicationstatechangetworeply_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ApplicationStateChangeTwoReply" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("applicationstatechangetworeply_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("applicationstatechangetworeply_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("applicationstatechangetworeply_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":applicationstatechangetworeply_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/ets/entryability/EntryAbility.ts b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/ets/entryability/EntryAbility.ts deleted file mode 100644 index 17dde9b8a88bc191ea15241ad2fea78b1265724d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/ets/entryability/EntryAbility.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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'; -import Ability from '@ohos.app.ability.UIAbility' -import Window from '@ohos.window' - -let TAG = 'StateChangeTestTAG' -let ApplicationStateChangeCallbackSec = { - onApplicationForeground() { - console.info('==== ApplicationStateChange Foreground ===='); - console.log(TAG, 'App2 ApplicationStateChangeCallbackSec onApplicationForeground') - }, - onApplicationBackground() { - console.info('==== ApplicationStateChange Background ===='); - console.log(TAG, 'App2 ApplicationStateChangeCallbackSec onApplicationBackground') - } -} -export default class EntryAbility extends Ability { - onCreate(want, launchParam) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); - - globalThis.abilityContext = this.context - globalThis.want = want - if (want.action == 'MultiAppRegister' || want.action == 'DoubleRegisterOff') { - globalThis.applicationContext = this.context.getApplicationContext(); - globalThis.applicationContext.on('applicationStateChange', ApplicationStateChangeCallbackSec) - } - } - - onDestroy() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: Window.WindowStage) { - // Main window is created, set main page for this ability - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - 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.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground() { - // Ability has brought to foreground - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); - setTimeout(() => { - globalThis.abilityContext.terminateSelf((err) => { - console.log('terminateSelf result:' + JSON.stringify(err)); - }) - }, 3000) - } - - onBackground() { - // Ability has back to background - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); - } -} diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/ets/pages/Index.ets b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index ad7ec009d021f1ebecb5a816a69e3c80cf654b63..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 Index { - @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/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/module.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/module.json deleted file mode 100644 index 744de4947a3779088b8c551e3bef74beda2255e8..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/module.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntrance": "./ets/entryability/EntryAbility.ts", - "description": "$string:EntryAbility_desc", - "icon": "$media:icon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "visible": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/resources/base/element/color.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/resources/en_US/element/string.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/resources/zh_CN/element/string.json b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 597ecf95e61d7e30367c22fe2f8638008361b044..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/signature/openharmony_sx.p7b b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/signature/openharmony_sx.p7b deleted file mode 100644 index 750905b862dfc4671cec271a49c3fe0900a1b832..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/getrunningprocessinformation/BUILD.gn b/ability/ability_runtime/getrunningprocessinformation/BUILD.gn deleted file mode 100644 index ca23004fb9f4a43539aa6fb6981054473bbf3bf4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/BUILD.gn +++ /dev/null @@ -1,28 +0,0 @@ -# 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("getrunningprocessinformation") { - testonly = true - if (is_standard_system) { - deps = [ - "ApplicationStateChangeOneReply:ApplicationStateChangeOneReply", - "ApplicationStateChangeThreeReply:ApplicationStateChangeThreeReply", - "ApplicationStateChangeTwoReply:ApplicationStateChangeTwoReply", - "GetRunningProcessInformationOneReply:GetRunningProcessInformationOneReply", - "GetRunningProcessInformationTest:GetRunningProcessInformationTest", - "GetRunningProcessInformationTwoReply:GetRunningProcessInformationTwoReply", - ] - } -} diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/AppScope/app.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/AppScope/app.json deleted file mode 100644 index 10c9ecef49a18923bae73b5f8e9eb85a5096cafd..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/AppScope/app.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "app": { - "bundleName": "com.example.getrunningprocessinformationonereply", - "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/getrunningprocessinformation/GetRunningProcessInformationOneReply/AppScope/resources/base/element/string.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/AppScope/resources/base/element/string.json deleted file mode 100644 index fbd5f1ad5cef73af0af750716514b6002fcec698..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "GetRunningProcessInformationOneReply" - } - ] -} diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/BUILD.gn b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/BUILD.gn deleted file mode 100644 index 29f164a10596208d0d7e19c4e5c9d9f5b5b99210..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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") - -ohos_hap_assist_suite("GetRunningProcessInformationOneReply") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":getrunningprocessinformationonereply_js_assets", - ":getrunningprocessinformationonereply_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "GetRunningProcessInformationOneReply" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("getrunningprocessinformationonereply_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("getrunningprocessinformationonereply_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("getrunningprocessinformationonereply_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":getrunningprocessinformationonereply_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/ets/entryability/EntryAbility.ts b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/ets/entryability/EntryAbility.ts deleted file mode 100644 index 9e866a0f1d937615c7ec010bb6c04f2d2fe743fe..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/ets/entryability/EntryAbility.ts +++ /dev/null @@ -1,132 +0,0 @@ -/* - * 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'; -import Ability from '@ohos.app.ability.UIAbility' -import Window from '@ohos.window' -import commonEvent from '@ohos.commonEvent' -import AbilityConstant from '@ohos.app.ability.AbilityConstant' - -let sequence = 0; -let TAG = 'GetRunningProcessInformation' -let commonStateArr: number[] = [-1, -1, -1, -1] -let commonEventData = { - parameters: { - commonStateArr: commonStateArr - } -} -globalThis.StartFloatingAbility = () => { - let want = { - "deviceId": "", - "bundleName": "com.example.getrunningprocessinformationtworeply", // - "abilityName": "EntryAbility" - }; - let options = { - windowMode: AbilityConstant.WindowMode.WINDOW_MODE_FLOATING, - }; - globalThis.abilityContext.startAbility(want, options, (error) => { - console.log(TAG, "start floating ability error.code = " + error.code) - }) -} - -globalThis.StartNormalAbility = () => { - let want = { - "deviceId": "", - "bundleName": "com.example.getrunningprocessinformationtworeply", // - "abilityName": "EntryAbility" - }; - globalThis.abilityContext.startAbility(want, (error) => { - console.log(TAG, "start normal ability error.code = " + error.code) - }) -} - -globalThis.GetRunningProcessInfoCallback = () => { - globalThis.applicationContext.getRunningProcessInformation((err, data) => { - if (err) { - console.log(TAG, `getRunningProcessInformation err: ` + JSON.stringify(err)); - } - else { - console.log(TAG, 'Oncreate Callback State: ' + JSON.stringify(data[0].state)); - commonStateArr[sequence++] = data[0].state - } - }) -} - -globalThis.GetRunningProcessInfoPromise = () => { - globalThis.applicationContext.getRunningProcessInformation().then((data) => { - console.log(TAG, 'Oncreate Promise State: ' + JSON.stringify(data[0].state)); - commonStateArr[sequence++] = data[0].state - }).catch((err) => { - console.log(TAG, `getRunningProcessInformation err: ` + JSON.stringify(err)); - }); -} - -globalThis.PublishStateArray = () => { - commonEvent.publish('processState', commonEventData, (err) => { - console.info("====>processState publish err: " + JSON.stringify(err)) - }) -} - -export default class EntryAbility extends Ability { - onCreate(want, launchParam) { - sequence = 0 - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); - - globalThis.want = want - globalThis.abilityContext = this.context - globalThis.applicationContext = this.context.getApplicationContext(); - - } - - onDestroy() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); - } - onWindowStageCreate(windowStage: Window.WindowStage) { - // Main window is created, set main page for this ability - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - 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.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground() { - // Ability has brought to foreground - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground() { - // Ability has back to background - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); - } -} diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/ets/pages/Index.ets b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index b10be60029f81e225bd719b839b96d78c1ea32e5..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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 Index { - @State message: string = 'Hello World' - - build() { - Row() { - Column() { - Button() { - Text('get BackInfo') - .fontSize(25) - .fontWeight(FontWeight.Bold) - .fontColor('#FFFFFF') - } - .id('Backtest') - .type(ButtonType.Capsule) - .margin({ top: 30 }) - .backgroundColor('#87CEEB') - .width('90%') - .height('6%') - .onClick(() => { - if (globalThis.want.action == 'Callback') { - setTimeout(() => { - globalThis.StartNormalAbility() - },500) - - setTimeout(() => { - globalThis.GetRunningProcessInfoCallback() - },3000) - - setTimeout(() => { - globalThis.PublishStateArray() - },5000) - } - else if (globalThis.want.action == 'Promise') { - setTimeout(() => { - globalThis.StartNormalAbility() - },500) - - setTimeout(() => { - globalThis.GetRunningProcessInfoPromise() - },3000) - - setTimeout(() => { - globalThis.PublishStateArray() - },5000) - } - }) - - Button() { - Text('get unFocusedInfo') - .fontSize(25) - .fontWeight(FontWeight.Bold) - .fontColor('#FFFFFF') - } - .id('unFocusedtest') - .type(ButtonType.Capsule) - .margin({ top: 30 }) - .backgroundColor('#87CEEB') - .width('90%') - .height('6%') - .onClick(() => { - if (globalThis.want.action == 'Callback') { - setTimeout(() => { - globalThis.StartFloatingAbility() - },500) - - setTimeout(() => { - globalThis.GetRunningProcessInfoCallback() - },2500) - } - else if (globalThis.want.action == 'Promise') { - setTimeout(() => { - globalThis.StartFloatingAbility() - },500) - - setTimeout(() => { - globalThis.GetRunningProcessInfoPromise() - },2500) - } - }) - - Button() { - Text('get focusedInfo') - .fontSize(25) - .fontWeight(FontWeight.Bold) - .fontColor('#FFFFFF') - } - .id('Focustest') - .type(ButtonType.Capsule) - .margin({ top: 30 }) - .backgroundColor('#87CEEB') - .width('90%') - .height('6%') - .onClick(() => { - if (globalThis.want.action == 'Callback') { - setTimeout(() => { - globalThis.GetRunningProcessInfoCallback() - },500) - } - else if (globalThis.want.action == 'Promise') { - setTimeout(() => { - globalThis.GetRunningProcessInfoPromise() - },500) - } - }) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/module.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/module.json deleted file mode 100644 index 744de4947a3779088b8c551e3bef74beda2255e8..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/module.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntrance": "./ets/entryability/EntryAbility.ts", - "description": "$string:EntryAbility_desc", - "icon": "$media:icon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "visible": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/resources/base/element/color.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/resources/en_US/element/string.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/resources/zh_CN/element/string.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 597ecf95e61d7e30367c22fe2f8638008361b044..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/signature/openharmony_sx.p7b b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/signature/openharmony_sx.p7b deleted file mode 100644 index 75935361525df5b7eb14038c7ef79651113f9793..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationOneReply/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/AppScope/app.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/AppScope/app.json deleted file mode 100644 index 80dd558ded5c2664440fc589e538128f21d5155e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/AppScope/app.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "app": { - "bundleName": "com.example.getrunningprocessinformationtest", - "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/getrunningprocessinformation/GetRunningProcessInformationTest/AppScope/resources/base/element/string.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/AppScope/resources/base/element/string.json deleted file mode 100644 index c50a35fde22783361078d3e4c748b948cf12d7c7..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "GetRunningProcessInformationTest" - } - ] -} diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/BUILD.gn b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/BUILD.gn deleted file mode 100644 index bbe5762ef4c0f058380a9b1a77241bed2eeeaa24..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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") - -ohos_js_hap_suite("GetRunningProcessInformationTest") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":getrunningprocessinformationtest_js_assets", - ":getrunningprocessinformationtest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "GetRunningProcessInformationTest" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("getrunningprocessinformationtest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("getrunningprocessinformationtest_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("getrunningprocessinformationtest_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":getrunningprocessinformationtest_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/Test.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/Test.json deleted file mode 100644 index a7bde9ce5aabb458c994b23732a2509586e43d4f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/Test.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "description": "Configuration for aceceshi Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "600000", - "bundle-name": "com.example.getrunningprocessinformationtest", - "module-name": "entry_test", - "shell-timeout": "600000", - "testcase-timeout": "30000" - }, - "kits": [ - { - "test-file-name": [ - "GetRunningProcessInformationTest.hap", - "GetRunningProcessInformationOneReply.hap", - "GetRunningProcessInformationTwoReply.hap", - "ApplicationStateChangeThreeReply.hap", - "ApplicationStateChangeOneReply.hap", - "ApplicationStateChangeTwoReply.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "param set persist.sys.suspend_manager_enabled false", - "reboot", - "power-shell wakeup", - "uinput -T -d 300 600 -m 300 600 300 100 -u 300 100", - "power-shell setmode 602", - "hilog -Q pidoff", - "hilog -Q domainoff", - "hilog -b D", - "setenforce 0" - ], - "teardown-command": [ - "param set persist.sys.suspend_manager_enabled true", - "power-shell setmode 601", - "reboot" - ] - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 1a6fe3a85d02631857806c78ce19b460a510b137..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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'; -import TestRunner from '@ohos.application.testRunner' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -function translateParamsToString(parameters) { - const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s it', - '-s level', '-s testType', '-s size', '-s timeout', - '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` - } - } - return targetParams.trim() -} - -async function onAbilityCreateCallback() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); -} - -async function addAbilityMonitorCallback(err: any) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); - } - - async onRun() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters['-D'] - if (debug == 'true') - { - cmd += ' -D' - } - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); - hilog.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/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/test/Ability.test.ets deleted file mode 100644 index 994e9f0355c1337b1a7ffc655be1e729df6d2f98..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/test/Ability.test.ets +++ /dev/null @@ -1,724 +0,0 @@ -/* - * 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' -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' -import { Component, Driver, UiWindow, ON, UiDriver } from '@ohos.UiTest' -import commonEvent from '@ohos.commonEvent' -import appManager from '@ohos.app.ability.appManager' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -let ACTS_ProcessState = { - events: ["processState"] -}; - -export default function abilityTest() { - describe('GetRunningProcessInformationTest', function () { - - beforeEach(async function () { - var abilityDelegator; - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - let cmd1 = 'hilog -r' - await abilityDelegator.executeShellCommand(cmd1, (err : any, data : any) => { - console.info("executeShellCommand1 callback"); - }); - await abilityDelegator.executeShellCommand("hilog -G 20M", async (err, data) => {}) - }) - - afterEach(async function () { - var abilityDelegator; - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - let cmd1 = 'aa force-stop com.example.applicationstatechangeonereply' - let cmd2 = 'aa force-stop com.example.applicationstatechangetworeply' - let cmd6 = 'aa force-stop com.example.applicationstatechangethreereply' - let cmd4 = 'aa force-stop com.example.getrunningprocessinformationonereply' - let cmd5 = 'aa force-stop com.example.getrunningprocessinformationtworeply' - let cmd3 = 'hilog -r' - await abilityDelegator.executeShellCommand(cmd1).then(() => { - console.info("executeShellCommand1 callback"); - }); - await abilityDelegator.executeShellCommand(cmd2).then(() => { - console.info("executeShellCommand2 callback"); - }); - await abilityDelegator.executeShellCommand(cmd3).then(() => { - console.info("executeShellCommand3 callback"); - }); - await abilityDelegator.executeShellCommand(cmd4).then(() => { - console.info("executeShellCommand3 callback"); - }); - await abilityDelegator.executeShellCommand(cmd5).then(() => { - console.info("executeShellCommand3 callback"); - }); - await abilityDelegator.executeShellCommand(cmd6).then(() => { - console.info("executeShellCommand3 callback"); - }); - }) - - /* - * @tc.number: Acts_ApplicationStateChange_0100 - * @tc.name: Register and deregister to monitor the foreground and background changes of this application. - * @tc.desc: In the same application, the on interface is called once, but the off interface is not called, and the - * foreground and background changes can be monitored. - */ - it('Acts_ApplicationStateChange_0100',0, function (done) { - let want = { - "deviceId": "", - "bundleName": "com.example.applicationstatechangeonereply", - "abilityName": "EntryAbility", - "action": "Normal" - }; - let wantAuxiliary = { - "deviceId": "", - "bundleName": "com.example.applicationstatechangetworeply", - "abilityName": "EntryAbility", - "action": "Normal" - }; - let subscriber; - function unSubscribeCallback() { - console.debug("====>Acts_ApplicationStateChange_0100 unSubscribeCallback"); - done(); - } - function subscribeCallBack(err, data) { - console.debug("====>Acts_ApplicationStateChange_0100 data: " + JSON.stringify(data)); - console.debug("====>Acts_ApplicationStateChange_0100 err: " + JSON.stringify(err)); - if(data.event == "processState") { - try{ - expect(data.parameters.commonStateArr[0]).assertEqual(1); - expect(data.parameters.commonStateArr[1]).assertEqual(1); - expect(data.parameters.commonStateArr[2]).assertEqual(-1); - expect(data.parameters.commonStateArr[3]).assertEqual(-1); - } - catch(error) { - console.log("An error is generated") - } - commonEvent.unsubscribe(subscriber, unSubscribeCallback); - } - } - setTimeout(() => { - commonEvent.createSubscriber(ACTS_ProcessState).then((data) => { - console.debug("====>Acts_ApplicationStateChange_0100 Create Subscribe"); - subscriber = data; - commonEvent.subscribe(subscriber, subscribeCallBack); - - globalThis.abilityContext.startAbility(want, (error) => { - console.log("ability error.code = " + error.code); - expect(error.code).assertEqual(0); - }) - - setTimeout(() => { - globalThis.abilityContext.startAbility(wantAuxiliary, (error) => { - console.log("auxiliary ability error.code = " + error.code); - expect(error.code).assertEqual(0); - }) - },3000) - - }); - },700); - }) - - /* - * @tc.number: Acts_ApplicationStateChange_0200 - * @tc.name: Register and deregister to monitor the foreground and background changes of this application. - * @tc.desc: In the same application, the on interface is called once, and the off interface is called, and the - * foreground and background changes can be monitored. - */ - it('Acts_ApplicationStateChange_0200',0, async function (done) { - let want = { - "deviceId": "", - "bundleName": "com.example.applicationstatechangeonereply", - "abilityName": "EntryAbility", - "action": "NeedBackGroundOff" - } - let wantAuxiliary = { - "deviceId": "", - "bundleName": "com.example.applicationstatechangetworeply", - "abilityName": "EntryAbility", - "action": "Normal" - } - let subscriber - function unSubscribeCallback() { - console.debug("====>Acts_ApplicationStateChange_0200 unSubscribeCallback"); - done(); - } - function subscribeCallBack(err, data) { - console.debug("====>Acts_ApplicationStateChange_0200 data: " + JSON.stringify(data)); - console.debug("====>Acts_ApplicationStateChange_0200 err: " + JSON.stringify(err)); - if(data.event == "processState") { - console.info("entered assert zone!") - try{ - expect(data.parameters.commonStateArr[0]).assertEqual(-1) - expect(data.parameters.commonStateArr[1]).assertEqual(1) - expect(data.parameters.commonStateArr[2]).assertEqual(-1) - expect(data.parameters.commonStateArr[3]).assertEqual(-1) - } - catch{ - console.log("An error is generated") - } - - commonEvent.unsubscribe(subscriber, unSubscribeCallback); - } - } - setTimeout(() => { - commonEvent.createSubscriber(ACTS_ProcessState).then(async (data) => { - console.debug("====>Acts_ApplicationStateChange_0200 Create Subscribe"); - subscriber = data; - commonEvent.subscribe(subscriber, subscribeCallBack); - - globalThis.abilityContext.startAbility(want, (error) => { - console.log("ability error.code = " + error.code) - expect(error.code).assertEqual(0); - }) - - setTimeout(() => { - globalThis.abilityContext.startAbility(wantAuxiliary, (error) => { - console.log("auxiliary ability error.code = " + error.code) - expect(error.code).assertEqual(0); - }) - },3000) - }) - },700) - }) - - /* - * @tc.number: Acts_ApplicationStateChange_0300 - * @tc.name: Register and deregister to monitor the foreground and background changes of this application. - * @tc.desc: In the same application, the on interface is called many times, but the off interface is not called, - * and the foreground and background changes can be monitored. - */ - it('Acts_ApplicationStateChange_0300',0, async function (done) { - let want = { - "deviceId": "", - "bundleName": "com.example.applicationstatechangeonereply", - "abilityName": "EntryAbility", - "action": "doubleRegister" - } - let wantAuxiliary = { - "deviceId": "", - "bundleName": "com.example.applicationstatechangetworeply", - "abilityName": "EntryAbility", - "action": "Normal" - } - - let subscriber - function unSubscribeCallback() { - console.debug("====>Acts_ApplicationStateChange_0300 unSubscribeCallback"); - done(); - } - function subscribeCallBack(err, data) { - console.debug("====>Acts_ApplicationStateChange_0300 data: " + JSON.stringify(data)); - console.debug("====>Acts_ApplicationStateChange_0300 err: " + JSON.stringify(err)); - if(data.event == "processState") { - console.info("entered assert zone!") - try{ - expect(data.parameters.commonStateArr[0]).assertEqual(1) - expect(data.parameters.commonStateArr[1]).assertEqual(1) - expect(data.parameters.commonStateArr[2]).assertEqual(1) - expect(data.parameters.commonStateArr[3]).assertEqual(1) - } - catch(error){ - console.log("An error is generated") - } - commonEvent.unsubscribe(subscriber, unSubscribeCallback); - } - } - setTimeout(() => { - commonEvent.createSubscriber(ACTS_ProcessState).then(async (data) => { - console.debug("====>Acts_ApplicationStateChange_0300 Create Subscribe"); - subscriber = data; - commonEvent.subscribe(subscriber, subscribeCallBack); - - globalThis.abilityContext.startAbility(want, (error) => { - console.log("ability error.code = " + error.code) - expect(error.code).assertEqual(0); - }) - setTimeout(() => { - globalThis.abilityContext.startAbility(wantAuxiliary, (error) => { - console.log("auxiliary ability error.code = " + error.code) - expect(error.code).assertEqual(0); - }) - },3000) - }) - },700) - }) - - /* - * @tc.number: Acts_ApplicationStateChange_0400 - * @tc.name: Register and deregister to monitor the foreground and background changes of this application. - * @tc.desc: In the same application, the on interface is called many times, and the off interface is called - * (Callback is specified), and the foreground and background changes can be monitored. - */ - it('Acts_ApplicationStateChange_0400',0, async function (done) { - let abilityDelegator; - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - let want = { - "deviceId": "", - "bundleName": "com.example.applicationstatechangeonereply", - "abilityName": "EntryAbility", - "action": "doubleNeedBackGroundOff" - } - let wantAuxiliary = { - "deviceId": "", - "bundleName": "com.example.applicationstatechangetworeply", - "abilityName": "EntryAbility", - "action": "Normal" - } - - let subscriber - function unSubscribeCallback() { - console.debug("====>Acts_ApplicationStateChange_0400 unSubscribeCallback"); - done(); - } - function subscribeCallBack(err, data) { - console.debug("====>Acts_ApplicationStateChange_0400 data: " + JSON.stringify(data)); - console.debug("====>Acts_ApplicationStateChange_0400 err: " + JSON.stringify(err)); - if(data.event == "processState") { - console.info("entered assert zone!") - try{ - expect(data.parameters.commonStateArr[0]).assertEqual(1) - expect(data.parameters.commonStateArr[1]).assertEqual(1) - expect(data.parameters.commonStateArr[2]).assertEqual(-1) - expect(data.parameters.commonStateArr[3]).assertEqual(1) - } - catch(error){ - console.log("An error is generated") - } - commonEvent.unsubscribe(subscriber, unSubscribeCallback); - } - } - setTimeout(() => { - commonEvent.createSubscriber(ACTS_ProcessState).then(async (data) => { - console.debug("====>Acts_ApplicationStateChange_0400 Create Subscribe"); - subscriber = data; - commonEvent.subscribe(subscriber, subscribeCallBack); - - globalThis.abilityContext.startAbility(want, (error) => { - console.log("ability error.code = " + error.code) - expect(error.code).assertEqual(0); - }) - setTimeout(() => { - globalThis.abilityContext.startAbility(wantAuxiliary, (error) => { - console.log("auxiliary ability error.code = " + error.code) - expect(error.code).assertEqual(0); - }) - },3000) - }) - },700) - }) - - /* - * @tc.number: Acts_ApplicationStateChange_0500 - * @tc.name: Register and deregister to monitor the foreground and background changes of this application. - * @tc.desc: In the different application, the on interface is called many times, and the off interface is called, - * and the foreground and background changes can be monitored. - */ - it('Acts_ApplicationStateChange_0500',0, async function (done) { - let abilityDelegator; - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - let want = { - "deviceId": "", - "bundleName": "com.example.applicationstatechangeonereply", - "abilityName": "EntryAbility", - "action": "MultiAppRegister" - } - let wantAuxiliary = { - "deviceId": "", - "bundleName": "com.example.applicationstatechangetworeply", - "abilityName": "EntryAbility", - "action": "MultiAppRegister" - } - - let subscriber - function unSubscribeCallback() { - console.debug("====>Acts_ApplicationStateChange_0500 unSubscribeCallback"); - done(); - } - function subscribeCallBack(err, data) { - console.debug("====>Acts_ApplicationStateChange_0500 data: " + JSON.stringify(data)); - console.debug("====>Acts_ApplicationStateChange_0500 err: " + JSON.stringify(err)); - if(data.event == "processState") { - console.info("entered assert zone!") - try{ - expect(data.parameters.commonStateArr[0]).assertEqual(-1) - expect(data.parameters.commonStateArr[1]).assertEqual(1) - expect(data.parameters.commonStateArr[2]).assertEqual(-1) - expect(data.parameters.commonStateArr[3]).assertEqual(-1) - } - catch(error){ - console.log("An error is generated") - } - commonEvent.unsubscribe(subscriber, unSubscribeCallback); - } - } - setTimeout(() => { - commonEvent.createSubscriber(ACTS_ProcessState).then(async (data) => { - console.debug("====>Acts_ApplicationStateChange_0500 Create Subscribe"); - subscriber = data; - commonEvent.subscribe(subscriber, subscribeCallBack); - - globalThis.abilityContext.startAbility(want, (error) => { - console.log("ability error.code = " + error.code) - expect(error.code).assertEqual(0); - }) - setTimeout(() => { - globalThis.abilityContext.startAbility(wantAuxiliary, (error) => { - console.log("auxiliary ability error.code = " + error.code) - expect(error.code).assertEqual(0); - }) - },3000) - }) - },700) - }) - - /* - * @tc.number: Acts_ApplicationStateChange_0600 - * @tc.name: Register and deregister to monitor the foreground and background changes of this application. - * @tc.desc: In the same application, the on interface is called many times, and the off interface is called - * (Callback is not specified), and the foreground and background changes can be monitored. - */ - it('Acts_ApplicationStateChange_0600',0, async function (done) { - let abilityDelegator; - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - let want = { - "deviceId": "", - "bundleName": "com.example.applicationstatechangeonereply", - "abilityName": "EntryAbility", - "action": "DoubleRegisterOff" - } - let wantAuxiliary = { - "deviceId": "", - "bundleName": "com.example.applicationstatechangetworeply", - "abilityName": "EntryAbility", - "action": "DoubleRegisterOff" - } - - let subscriber - function unSubscribeCallback() { - console.debug("====>Acts_ApplicationStateChange_0600 unSubscribeCallback"); - done(); - } - function subscribeCallBack(err, data) { - console.debug("====>Acts_ApplicationStateChange_0600 data: " + JSON.stringify(data)); - console.debug("====>Acts_ApplicationStateChange_0600 err: " + JSON.stringify(err)); - if(data.event == "processState") { - console.info("entered assert zone!") - try{ - expect(data.parameters.commonStateArr[0]).assertEqual(-1) - expect(data.parameters.commonStateArr[1]).assertEqual(1) - expect(data.parameters.commonStateArr[2]).assertEqual(-1) - expect(data.parameters.commonStateArr[3]).assertEqual(1) - } - catch(error){ - console.log("An error is generated") - } - commonEvent.unsubscribe(subscriber, unSubscribeCallback); - } - } - setTimeout(() => { - commonEvent.createSubscriber(ACTS_ProcessState).then(async (data) => { - console.debug("====>Acts_ApplicationStateChange_0600 Create Subscribe"); - subscriber = data; - commonEvent.subscribe(subscriber, subscribeCallBack); - - globalThis.abilityContext.startAbility(want, (error) => { - console.log("ability error.code = " + error.code) - expect(error.code).assertEqual(0); - }) - setTimeout(() => { - globalThis.abilityContext.startAbility(wantAuxiliary, (error) => { - console.log("auxiliary ability error.code = " + error.code) - expect(error.code).assertEqual(0); - }) - },3000) - }) - },700); - }) - - /* - * @tc.number: Acts_ApplicationStateChange_0700 - * @tc.name: Register and deregister to monitor the foreground and background changes of this application. - * @tc.desc: In the same application, call on interface, call off interface and then call on again., and the - * foreground and background changes can be monitored. - */ - it('Acts_ApplicationStateChange_0700',0, function (done) { - let want = { - "deviceId": "", - "bundleName": "com.example.applicationstatechangeonereply", - "abilityName": "EntryAbility", - "action": "RegisterOnOffOn" - } - let wantAuxiliary = { - "deviceId": "", - "bundleName": "com.example.applicationstatechangetworeply", - "abilityName": "EntryAbility", - "action": "Normal" - } - let subscriber - function unSubscribeCallback() { - console.debug("====>Acts_ApplicationStateChange_0700 unSubscribeCallback"); - done(); - } - function subscribeCallBack(err, data) { - console.debug("====>Acts_ApplicationStateChange_0700 data: " + JSON.stringify(data)); - console.debug("====>Acts_ApplicationStateChange_0700 err: " + JSON.stringify(err)); - if(data.event == "processState") { - try{ - expect(data.parameters.commonStateArr[0]).assertEqual(1) - expect(data.parameters.commonStateArr[1]).assertEqual(1) - expect(data.parameters.commonStateArr[2]).assertEqual(-1) - expect(data.parameters.commonStateArr[3]).assertEqual(-1) - } - catch(error) { - console.log("An error is generated") - } - commonEvent.unsubscribe(subscriber, unSubscribeCallback); - } - } - setTimeout(() => { - commonEvent.createSubscriber(ACTS_ProcessState).then((data) => { - console.debug("====>Acts_ApplicationStateChange_0700 Create Subscribe"); - subscriber = data; - commonEvent.subscribe(subscriber, subscribeCallBack); - - globalThis.abilityContext.startAbility(want, (error) => { - console.log("ability error.code = " + error.code) - expect(error.code).assertEqual(0); - }) - - setTimeout(() => { - globalThis.abilityContext.startAbility(wantAuxiliary, (error) => { - console.log("auxiliary ability error.code = " + error.code) - expect(error.code).assertEqual(0); - }) - },3000) - - }) - },700); - }) - - /* - * @tc.number: Acts_ApplicationStateChange_0800 - * @tc.name: Register and deregister to monitor the foreground and background changes of this application. - * @tc.desc: In the same application, start multiple abilities, call the on interface, and not all the application - * abilities can't be monitored in the background. - */ - it('Acts_ApplicationStateChange_0800', 0, async function (done) { - let want = { - "deviceId": "", - "bundleName": "com.example.applicationstatechangethreereply", - "abilityName": "EntryAbility", - "action": "DoubleAbilityTest" - } - let wantAuxiliary = { - "deviceId": "", - "bundleName": "com.example.applicationstatechangethreereply", - "abilityName": "EntryAbility1", - "action": "DoubleAbilityTest" - } - - let subscriber; - - function unSubscribeCallback() { - console.debug("====>Acts_ApplicationStateChange_0800 unSubscribeCallback"); - done(); - } - - function subscribeCallBack(err, data) { - console.debug("====>Acts_ApplicationStateChange_0800 data: " + JSON.stringify(data)); - console.debug("====>Acts_ApplicationStateChange_0800 err: " + JSON.stringify(err)); - if (data.event == "processState") { - console.info("entered assert zone!") - try { - expect(data.parameters.commonStateArr).assertEqual(-1) - } - catch (error) { - console.log("An error is generated") - } - commonEvent.unsubscribe(subscriber, unSubscribeCallback); - } - } - - setTimeout(() => { - commonEvent.createSubscriber(ACTS_ProcessState).then(async (data) => { - console.debug("====>Acts_ApplicationStateChange_0800 Create Subscribe"); - subscriber = data; - commonEvent.subscribe(subscriber, subscribeCallBack); - - globalThis.abilityContext.startAbility(want, (error) => { - console.log("ability error.code = " + error.code) - expect(error.code).assertEqual(0); - }) - setTimeout(() => { - globalThis.abilityContext.startAbility(wantAuxiliary, (error) => { - console.log("auxiliary ability error.code = " + error.code) - expect(error.code).assertEqual(0); - }) - }, 3000) - }) - }, 700); - }) - - /* - * @tc.number: Acts_GetRunningProcessInformation_AsyncCallback_0100 - * @tc.name: When getting ProcessInfo, add the state field. - * @tc.desc: When the application obtains and does not obtain the focus, it can get the process information by - * calling the getRunningProcessInformation interface in AsyncCallback mode. - */ - it('Acts_GetRunningProcessInformation_AsyncCallback_0100', 0, async function (done) { - let TAG = 'getRunningProcess' - console.info("=====>Acts_GetRunningProcessInformation_AsyncCallback_0100 start<=====") - let want = { - "deviceId": "", - "bundleName": "com.example.getrunningprocessinformationonereply", - "abilityName": "EntryAbility", - "action": "Callback" - } - let subscriber - - function unSubscribeCallback() { - console.debug("====>Acts_GetRunningProcessInformation_AsyncCallback_0100 unSubscribeCallback"); - done() - } - - function subscribeCallBack(err, data) { - console.debug("====>Acts_GetRunningProcessInformation_AsyncCallback_0100 data: " + JSON.stringify(data)); - console.debug("====>Acts_GetRunningProcessInformation_AsyncCallback_0100 err: " + JSON.stringify(err)); - if (data.event == "processState") { - console.info("entered assert zone!") - try { - expect(data.parameters.commonStateArr[0]).assertEqual(2) - console.info("this is array one") - expect(data.parameters.commonStateArr[1]).assertEqual(1) - console.info("this is array one") - expect(data.parameters.commonStateArr[2]).assertEqual(3) - console.info("this is array one") - expect(data.parameters.commonStateArr[3]).assertEqual(-1) - console.info("this is array one") - } - catch (error) { - console.log("An error is generated") - } - commonEvent.unsubscribe(subscriber, unSubscribeCallback); - } - } - - setTimeout(() => { - commonEvent.createSubscriber(ACTS_ProcessState).then(async (data) => { - console.debug("====>Acts_GetRunningProcessInformation_AsyncCallback_0100 Create Subscribe"); - subscriber = data; - commonEvent.subscribe(subscriber, subscribeCallBack); - - globalThis.abilityContext.startAbility(want, (error) => { - console.log("start normal ability error.code = " + error.code) - expect(error.code).assertEqual(0); - }) - - setTimeout(async () => { - let driver = Driver.create() - await driver.delayMs(1500) - let button1 = await driver.findComponent(ON.text('get focusedInfo')) - await expect(button1 != null).assertTrue() - let button2 = await driver.findComponent(ON.text('get unFocusedInfo')) - await expect(button2 != null).assertTrue() - let button3 = await driver.findComponent(ON.text('get BackInfo')) - await expect(button3 != null).assertTrue() - await button1.click() - await driver.delayMs(2000) - await button2.click() - await driver.delayMs(4000) - await driver.pressBack() - await driver.delayMs(2000) - await button3.click() - }, 3000) - }) - }, 1000) - }) - - /* - * @tc.number: Acts_GetRunningProcessInformation_Promise_0100 - * @tc.name: When getting ProcessInfo, add the state field. - * @tc.desc: When the application obtains and does not obtain the focus, it can get the process information by - * calling the getRunningProcessInformation interface in promise mode. - */ - it('Acts_GetRunningProcessInformation_Promise_0100', 0, async function (done) { - let TAG = 'getRunningProcess' - console.info("=====>Acts_GetRunningProcessInformation_AsyncCallback_0100 start<=====") - let want = { - "deviceId": "", - "bundleName": "com.example.getrunningprocessinformationonereply", - "abilityName": "EntryAbility", - "action": "Promise" - } - let subscriber - - function unSubscribeCallback() { - console.debug("====>Acts_GetRunningProcessInformation_Promise_0100 unSubscribeCallback"); - done(); - } - - function subscribeCallBack(err, data) { - console.debug("====>Acts_GetRunningProcessInformation_Promise_0100 data: " + JSON.stringify(data)); - console.debug("====>Acts_GetRunningProcessInformation_Promise_0100 err: " + JSON.stringify(err)); - if (data.event == "processState") { - console.info("entered assert zone!") - try { - expect(data.parameters.commonStateArr[0]).assertEqual(2) - console.info("this is array one") - expect(data.parameters.commonStateArr[1]).assertEqual(1) - console.info("this is array one") - expect(data.parameters.commonStateArr[2]).assertEqual(3) - console.info("this is array one") - expect(data.parameters.commonStateArr[3]).assertEqual(-1) - console.info("this is array one") - } - catch (error) { - console.log("An error is generated") - } - commonEvent.unsubscribe(subscriber, unSubscribeCallback); - } - } - - setTimeout(() => { - commonEvent.createSubscriber(ACTS_ProcessState).then(async (data) => { - console.debug("====>Acts_GetRunningProcessInformation_Promise_0100 Create Subscribe"); - subscriber = data; - commonEvent.subscribe(subscriber, subscribeCallBack); - - globalThis.abilityContext.startAbility(want, (error) => { - console.log("start normal ability error.code = " + error.code) - expect(error.code).assertEqual(0); - }) - - setTimeout(async () => { - let driver = Driver.create() - await driver.delayMs(1500) - let button1 = await driver.findComponent(ON.text('get focusedInfo')) - await expect(button1 != null).assertTrue() - let button2 = await driver.findComponent(ON.text('get unFocusedInfo')) - await expect(button2 != null).assertTrue() - let button3 = await driver.findComponent(ON.text('get BackInfo')) - await expect(button3 != null).assertTrue() - await button1.click() - await driver.delayMs(2000) - await button2.click() - await driver.delayMs(4000) - await driver.pressBack() - await driver.delayMs(2000) - await button3.click() - }, 3000) - }) - }, 1000) - - }) - - }) -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index cb2e22661cde4c6c3e986a6718061d089e25fcd5..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/testability/TestAbility.ets b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/testability/TestAbility.ets deleted file mode 100644 index c5a431851c11d91a4d66eb39f33aba2a63937332..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/testability/TestAbility.ets +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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'; -import Ability from '@ohos.app.ability.UIAbility' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' -import Window from '@ohos.window' - -export default class TestAbility extends Ability { - onCreate(want, launchParam) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - 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.abilityContext = this.context - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - } - - onDestroy() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); - } - - onWindowStageCreate(windowStage: Window.WindowStage) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', - JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); - } - - onForeground() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); - } - - onBackground() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); - } -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/testability/pages/Index.ets b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/testability/pages/Index.ets deleted file mode 100644 index 431674fc5573a62cfd4d76547115834080634060..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/testability/pages/Index.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - 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/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/module.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/module.json deleted file mode 100644 index d37222041008bf924368e085fea565e6048502af..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/module.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "module": { - "name": "entry_test", - "type": "feature", - "description": "$string:module_test_desc", - "mainElement": "TestAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:test_pages", - "abilities": [ - { - "name": "TestAbility", - "srcEntrance": "./ets/testability/TestAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "visible": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.START_INVISIBLE_ABILITY" - }, - { - "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND" - } - ] - } -} diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/resources/base/element/color.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c712962da3c2751c2b9ddb53559afcbd2b54a02..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 65d8fa5a7cf54aa3943dcd0214f58d1771bc1f6c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "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/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/resources/base/profile/test_pages.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/resources/base/profile/test_pages.json deleted file mode 100644 index b7e7343cacb32ce982a45e76daad86e435e054fe..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/resources/base/profile/test_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "testability/pages/Index" - ] -} diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/signature/openharmony_sx.p7b b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/signature/openharmony_sx.p7b deleted file mode 100644 index a591a70418ccecfe9a2b6b7367ac3d2542c02e94..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/AppScope/app.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/AppScope/app.json deleted file mode 100644 index b415ca4bfb85f9e3557cd46704db5024c393ae89..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/AppScope/app.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "app": { - "bundleName": "com.example.getrunningprocessinformationtworeply", - "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/getrunningprocessinformation/GetRunningProcessInformationTwoReply/AppScope/resources/base/element/string.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/AppScope/resources/base/element/string.json deleted file mode 100644 index e119e5d35177a009c4416884cd86e9a762200273..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "GetRunningProcessInformationTwoReply" - } - ] -} diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/BUILD.gn b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/BUILD.gn deleted file mode 100644 index 170e5306cc9de69e8fa703dbf041914ff7ad7174..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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") - -ohos_hap_assist_suite("GetRunningProcessInformationTwoReply") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":getrunningprocessinformationtworeply_js_assets", - ":getrunningprocessinformationtworeply_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "GetRunningProcessInformationTwoReply" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("getrunningprocessinformationtworeply_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("getrunningprocessinformationtworeply_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("getrunningprocessinformationtworeply_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":getrunningprocessinformationtworeply_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/ets/entryability/EntryAbility.ts b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/ets/entryability/EntryAbility.ts deleted file mode 100644 index 0f3f4f49f6bd2c07e3bdfb11619c8f8f3232935c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/ets/entryability/EntryAbility.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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'; -import Ability from '@ohos.app.ability.UIAbility' -import Window from '@ohos.window' - -export default class EntryAbility extends Ability { - onCreate(want, launchParam) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); - } - - onDestroy() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: Window.WindowStage) { - // Main window is created, set main page for this ability - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - 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.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground() { - // Ability has brought to foreground - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground() { - // Ability has back to background - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); - } -} diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/ets/pages/Index.ets b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index ad7ec009d021f1ebecb5a816a69e3c80cf654b63..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 Index { - @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/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/module.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/module.json deleted file mode 100644 index 744de4947a3779088b8c551e3bef74beda2255e8..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/module.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntrance": "./ets/entryability/EntryAbility.ts", - "description": "$string:EntryAbility_desc", - "icon": "$media:icon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "visible": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/resources/base/element/color.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/resources/base/element/color.json deleted file mode 100644 index d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94f58d6128ab712be2c68acc7c98e9ab9ce..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/resources/en_US/element/string.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/resources/zh_CN/element/string.json b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 597ecf95e61d7e30367c22fe2f8638008361b044..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/signature/openharmony_sx.p7b b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/signature/openharmony_sx.p7b deleted file mode 100644 index e139020a0a39e96053d2b965004b09b0816d0c72..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTwoReply/signature/openharmony_sx.p7b and /dev/null differ