diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsFeatureTest/BUILD.gn b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsFeatureTest/BUILD.gn index f15217a4614b72033af7708d6ea48809c9f07a5b..38754c9cbf51ec1b06483b59ff022855b2d14c6a 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsFeatureTest/BUILD.gn +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsFeatureTest/BUILD.gn @@ -22,29 +22,19 @@ ohos_hap_assist_suite("ActsLifeCycleEtsFeatureTest") { ets2abc = true certificate_profile = "./signature/openharmony_sx.p7b" - # hap_name: HAP的名字,可选,默认为目标名 hap_name = "ActsLifeCycleEtsFeatureTest" subsystem_name = "ability" part_name = "ability_runtime" } ohos_app_scope("windowStage_app_profile") { - # app_profile: HAP的AppScope中的app.json,只在Stage模型下使用 app_profile = "AppScope/app.json" - - # sources: 资源文件路径 sources = [ "AppScope/resources" ] } ohos_js_assets("windowStage_js_assets") { - # source_dir: js或ets代码路径,兼容FA模型的单ability配置到ability目录 source_dir = "src/main/ets" } ohos_resources("windowStage_resources") { - # sources: 资源文件路径 sources = [ "src/main/resources" ] - - # deps: 当前目标的依赖 deps = [ ":windowStage_app_profile" ] - - # hap_profile: HAP的config.json,Stage模型对应module.json hap_profile = "src/main/module.json" } diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsFeatureTest/src/main/ets/mainability/MainAbility.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsFeatureTest/src/main/ets/mainability/MainAbility.ts index 48ed78ede44301c09930a040be34590a7cc3c63c..3270d9cdfd70b020b363ca7edb0b8c94606dbf9c 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsFeatureTest/src/main/ets/mainability/MainAbility.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsFeatureTest/src/main/ets/mainability/MainAbility.ts @@ -91,7 +91,6 @@ export default class MainAbility extends Ability { } } globalThis.applicationContext1 = this.context.getApplicationContext(); - // let lifecycleid = globalThis.applicationContext1.registerAbilityLifecycleCallback(AbilityLifecycleCallback); let lifecycleid = globalThis.applicationContext1.on('abilityLifecycle', AbilityLifecycleCallback); console.log("[Demo] registerAbilityLifecycleCallback1 number: " + JSON.stringify(lifecycleid)); setTimeout(function () { @@ -109,7 +108,6 @@ export default class MainAbility extends Ability { // Main window is created, set main page for this ability console.log("[Demo] MainAbility onWindowStageCreate") globalThis.featureAbilityContext = this.context; - // windowStage.setUIContent(this.context, "testability/pages/index1", null) windowStage.loadContent('pages/Index', (err, data) => { if (err.code) { diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/BUILD.gn b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/BUILD.gn index fd7f83d5d7ea3426b8669cc956d0f7bc63b07e19..319b8f92a116dbf8cde11cedc1f53f03da7c7f3d 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/BUILD.gn +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/BUILD.gn @@ -22,29 +22,19 @@ ohos_js_hap_suite("ActsLifeCycleEtsTest") { ets2abc = true certificate_profile = "./signature/openharmony_sx.p7b" - # hap_name: HAP的名字,可选,默认为目标名 hap_name = "ActsLifeCycleEtsTest" subsystem_name = "ability" part_name = "ability_runtime" } ohos_app_scope("windowStage_app_profile") { - # app_profile: HAP的AppScope中的app.json,只在Stage模型下使用 app_profile = "AppScope/app.json" - - # sources: 资源文件路径 sources = [ "AppScope/resources" ] } ohos_js_assets("windowStage_js_assets") { - # source_dir: js或ets代码路径,兼容FA模型的单ability配置到ability目录 source_dir = "src/main/ets" } ohos_resources("windowStage_resources") { - # sources: 资源文件路径 sources = [ "src/main/resources" ] - - # deps: 当前目标的依赖 deps = [ ":windowStage_app_profile" ] - - # hap_profile: HAP的config.json,Stage模型对应module.json hap_profile = "src/main/module.json" } diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/Application/AbilityStage.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/Application/AbilityStage.ts index 4fda95d87eb46eaede3d6f12f500d0b40428c204..674dbf6cd01426066dec6d5d12882ff1350299fb 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/Application/AbilityStage.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/Application/AbilityStage.ts @@ -101,7 +101,6 @@ export default class MyAbilityStage extends AbilityStage { } globalThis.applicationContext = this.context.getApplicationContext(); console.log("[Demo] stage applicationContext: " + JSON.stringify(globalThis.applicationContext)); - // let lifecycleid = globalThis.applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); let lifecycleid = globalThis.applicationContext.on('abilityLifecycle', AbilityLifecycleCallback); console.log("[Demo] registerAbilityLifecycleCallback number: " + JSON.stringify(lifecycleid)); setTimeout(function () { diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/Hap1MainAbility1/Hap1MainAbility1.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/Hap1MainAbility1/Hap1MainAbility1.ts index 0d641e5d63f4216744f5522c9f26c42be7f26ab4..9c82b95eb39dd1de16d0cc837b0967181d79756c 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/Hap1MainAbility1/Hap1MainAbility1.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/Hap1MainAbility1/Hap1MainAbility1.ts @@ -35,8 +35,6 @@ export default class Hap1MainAbility1 extends Ability { // Main window is created, set main page for this ability console.log("[Demo] Hap1MainAbility1 onWindowStageCreate") - // windowStage.setUIContent(this.context, "testability/pages/indexh1a1", null) - windowStage.loadContent('testability/pages/indexh1a1', (err, data) => { if (err.code) { console.log('Hap1MainAbility1 loadContent error'); diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/Hap1MainAbility2/Hap1MainAbility2.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/Hap1MainAbility2/Hap1MainAbility2.ts index 4a83e15fce7ff50d0e4dc1f7cca213a7b87bedb1..49c1c33a44ec27464be1214f05a27aa626e2282c 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/Hap1MainAbility2/Hap1MainAbility2.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/Hap1MainAbility2/Hap1MainAbility2.ts @@ -35,8 +35,6 @@ export default class Hap1MainAbility2 extends Ability { // Main window is created, set main page for this ability console.log("[Demo] Hap1MainAbility2 onWindowStageCreate") - // windowStage.setUIContent(this.context, "testability/pages/indexh1a2", null) - windowStage.loadContent('testability/pages/indexh1a2', (err, data) => { if (err.code) { console.log('Hap1MainAbility2 loadContent error'); diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility1/MainAbility1.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility1/MainAbility1.ts index 5c11f638b6d371009289a7eb12d710fd6044cd78..a05411d74e2efba8d61db1d4f0e474cf781651d5 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility1/MainAbility1.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility1/MainAbility1.ts @@ -98,7 +98,6 @@ export default class MainAbility1 extends Ability { } } globalThis.applicationContext1 = this.context.getApplicationContext(); - // let lifecycleid = globalThis.applicationContext1.registerAbilityLifecycleCallback(AbilityLifecycleCallback); let lifecycleid = globalThis.applicationContext1.on('abilityLifecycle', AbilityLifecycleCallback); console.log("[Demo] registerAbilityLifecycleCallback1 number: " + JSON.stringify(lifecycleid)); setTimeout(function () { @@ -116,7 +115,6 @@ export default class MainAbility1 extends Ability { // Main window is created, set main page for this ability console.log("[Demo] MainAbility1 onWindowStageCreate") globalThis.ability1context = this.context; - // windowStage.setUIContent(this.context, "testability/pages/index1", null) windowStage.loadContent('testability/pages/index1', (err, data) => { if (err.code) { diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility10/MainAbility10.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility10/MainAbility10.ts index c7ce463264e78e0c301169203ad81568c2dd9842..b82dff3f47c461607ced69de7be85ce2ec77380c 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility10/MainAbility10.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility10/MainAbility10.ts @@ -86,7 +86,6 @@ export default class MainAbility10 extends Ability { } } globalThis.applicationContext10 = this.context.getApplicationContext(); - // let lifecycleid = globalThis.applicationContext10.registerAbilityLifecycleCallback(AbilityLifecycleCallback); let lifecycleid = globalThis.applicationContext10.on('abilityLifecycle', AbilityLifecycleCallback); console.log("[Demo] registerAbilityLifecycleCallback10 number: " + JSON.stringify(lifecycleid)); setTimeout(function () { @@ -104,7 +103,6 @@ export default class MainAbility10 extends Ability { // Main window is created, set main page for this ability console.log("[Demo] MainAbility10 onWindowStageCreate") globalThis.ability10 = this.context; - // windowStage.setUIContent(this.context, "testability/pages/index10", null) windowStage.loadContent('testability/pages/index10', (err, data) => { if (err.code) { diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility11/MainAbility11.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility11/MainAbility11.ts index 3a2fb077e658d02f961af8fb9150d9261287cad0..a6810a24c6b2d76f166ba628e5416b1adcbef635 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility11/MainAbility11.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility11/MainAbility11.ts @@ -80,7 +80,6 @@ export default class MainAbility11 extends Ability { } } globalThis.applicationContext11 = globalThis.ability11.getApplicationContext(); - // let lifecycleid = globalThis.applicationContext11.registerAbilityLifecycleCallback(AbilityLifecycleCallback); let lifecycleid = globalThis.applicationContext11.on('abilityLifecycle', AbilityLifecycleCallback); console.log("[Demo] registerAbilityLifecycleCallback11 number: " + JSON.stringify(lifecycleid)); setTimeout(function () { @@ -98,8 +97,6 @@ export default class MainAbility11 extends Ability { // Main window is created, set main page for this ability console.log("[Demo] MainAbility11 onWindowStageCreate") - // windowStage.setUIContent(this.context, "testability/pages/index11", null) - windowStage.loadContent('testability/pages/index11', (err, data) => { if (err.code) { console.log('MainAbility11 loadContent error'); diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility12/MainAbility12.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility12/MainAbility12.ts index 34464745ab67eba450795b27951a073b143d1e81..83200a2f3209fde9891b8ed239036fb3a0b5d8ba 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility12/MainAbility12.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility12/MainAbility12.ts @@ -79,7 +79,6 @@ export default class MainAbility12 extends Ability { } } globalThis.applicationContext12 = this.context.getApplicationContext(); - // let lifecycleid = globalThis.applicationContext12.registerAbilityLifecycleCallback(AbilityLifecycleCallback); let lifecycleid = globalThis.applicationContext12.on('abilityLifecycle', AbilityLifecycleCallback); console.log("[Demo] registerAbilityLifecycleCallback12 number: " + JSON.stringify(lifecycleid)); setTimeout(function () { @@ -97,7 +96,6 @@ export default class MainAbility12 extends Ability { // Main window is created, set main page for this ability console.log("[Demo] MainAbility12 onWindowStageCreate") globalThis.ability12 = this.context; - // windowStage.setUIContent(this.context, "testability/pages/index12", null) windowStage.loadContent('testability/pages/index12', (err, data) => { if (err.code) { diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility13/MainAbility13.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility13/MainAbility13.ts index 3f12f8bef101545d930eadb03793c14ce306ad0f..73fc3b6f8c23c24d1f0b002c418c8f30087b9d72 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility13/MainAbility13.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility13/MainAbility13.ts @@ -201,7 +201,6 @@ export default class MainAbility13 extends Ability { // Main window is created, set main page for this ability console.log("[Demo] MainAbility13 onWindowStageCreate") globalThis.ability1context = this.context; - // windowStage.setUIContent(this.context, "testability/pages/index1", null) windowStage.loadContent('testability/pages/index1', (err, data) => { if (err.code) { diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility14/MainAbility14.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility14/MainAbility14.ts index 271074c5c3345a7bed282f1aeacceac8a193ae53..1e93e990e17a78863f8002d5c51a582d96bd6ae9 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility14/MainAbility14.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility14/MainAbility14.ts @@ -28,7 +28,6 @@ export default class MainAbility14 extends Ability { // Main window is created, set main page for this ability console.log("[Demo] MainAbility14 onWindowStageCreate") globalThis.ability14 = this.context; - // windowStage.setUIContent(this.context, "testability/pages/index2", null) windowStage.loadContent('testability/pages/index2', (err, data) => { if (err.code) { console.log('MainAbility14 loadContent error'); diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility2/MainAbility2.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility2/MainAbility2.ts index 55c429ca9b56d8e67877af4a24e0ded20cf700eb..b295e5eac72f026f988dd7a3b34a93a77b11b49a 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility2/MainAbility2.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility2/MainAbility2.ts @@ -28,7 +28,6 @@ export default class MainAbility2 extends Ability { // Main window is created, set main page for this ability console.log("[Demo] MainAbility2 onWindowStageCreate") globalThis.ability2 = this.context; - // windowStage.setUIContent(this.context, "testability/pages/index2", null) windowStage.loadContent('testability/pages/index2', (err, data) => { if (err.code) { console.log('MainAbility2 loadContent error'); diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility3/MainAbility3.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility3/MainAbility3.ts index a50f9754ba39c693fa8aaa17ffdf68fccb47c8dd..20902279d838865fd792b56e657a6a81ffc51ecf 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility3/MainAbility3.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility3/MainAbility3.ts @@ -102,7 +102,6 @@ export default class MainAbility3 extends Ability { } } globalThis.applicationContext3 = this.context.getApplicationContext(); - // let lifecycleid = globalThis.applicationContext3.registerAbilityLifecycleCallback(AbilityLifecycleCallback); let lifecycleid = globalThis.applicationContext3.on('abilityLifecycle', AbilityLifecycleCallback); console.log("[Demo] registerAbilityLifecycleCallback3 number: " + JSON.stringify(lifecycleid)); setTimeout(function () { @@ -120,7 +119,6 @@ export default class MainAbility3 extends Ability { // Main window is created, set main page for this ability console.log("[Demo] MainAbility3 onWindowStageCreate") globalThis.ability3 = this.context - // windowStage.setUIContent(this.context, "testability/pages/index3", null) windowStage.loadContent('testability/pages/index3', (err, data) => { if (err.code) { diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility4/MainAbility4.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility4/MainAbility4.ts index 8fa1e199238e6810fac3ea74783b3e64261a0a72..124636a7f8d61a43dec228d1fe82989665fa65e7 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility4/MainAbility4.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility4/MainAbility4.ts @@ -102,7 +102,6 @@ export default class MainAbility4 extends Ability { } } globalThis.applicationContext4 = this.context.getApplicationContext(); - // let lifecycleid = globalThis.applicationContext4.registerAbilityLifecycleCallback(AbilityLifecycleCallback); let lifecycleid = globalThis.applicationContext4.on('abilityLifecycle', AbilityLifecycleCallback); console.log("[Demo] registerAbilityLifecycleCallback4 number: " + JSON.stringify(lifecycleid)); globalThis.callbackid4 = lifecycleid; @@ -120,7 +119,6 @@ export default class MainAbility4 extends Ability { // Main window is created, set main page for this ability console.log("[Demo] MainAbility4 onWindowStageCreate") globalThis.ability4 = this.context; - // windowStage.setUIContent(this.context, "testability/pages/index4", null) windowStage.loadContent('testability/pages/index4', (err, data) => { if (err.code) { diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility5/MainAbility5.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility5/MainAbility5.ts index b597a2456c4c7a905aabf2d9ae2ee53e59901cd0..d541f633afa369a16f1eadf98970a060e5afb68f 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility5/MainAbility5.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility5/MainAbility5.ts @@ -28,7 +28,6 @@ export default class MainAbility5 extends Ability { // Main window is created, set main page for this ability console.log("[Demo] MainAbility5 onWindowStageCreate") globalThis.ability5 = this.context; - // windowStage.setUIContent(this.context, "testability/pages/index5", null) windowStage.loadContent('testability/pages/index5', (err, data) => { if (err.code) { diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility6/MainAbility6.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility6/MainAbility6.ts index 2346dd4307b9f8d2da9ceadeec791d71586b8954..8cc601d59de65c32f366e22f62bd6923e4ccd627 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility6/MainAbility6.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility6/MainAbility6.ts @@ -28,7 +28,6 @@ export default class MainAbility6 extends Ability { // Main window is created, set main page for this ability console.log("[Demo] MainAbility6 onWindowStageCreate") globalThis.ability6 = this.context; - // windowStage.setUIContent(this.context, "testability/pages/index6", null) windowStage.loadContent('testability/pages/index6', (err, data) => { if (err.code) { @@ -130,7 +129,6 @@ export default class MainAbility6 extends Ability { } } globalThis.applicationContext6 = globalThis.ability6.getApplicationContext(); - // let lifecycleid = globalThis.applicationContext6.registerAbilityLifecycleCallback(AbilityLifecycleCallback); let lifecycleid = globalThis.applicationContext6.on('abilityLifecycle', AbilityLifecycleCallback); console.log("[Demo] registerAbilityLifecycleCallback6 number: " + JSON.stringify(lifecycleid)); setTimeout(function () { diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility7/MainAbility7.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility7/MainAbility7.ts index 66d8e94eb29d3aa5bda52552c30fbe7c6e1dd662..b52f5df41d40d18752a809c22cc336d25e71c96c 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility7/MainAbility7.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility7/MainAbility7.ts @@ -28,7 +28,6 @@ export default class MainAbility7 extends Ability { // Main window is created, set main page for this ability console.log("[Demo] MainAbility7 onWindowStageCreate") globalThis.ability7 = this.context; - // windowStage.setUIContent(this.context, "testability/pages/index7", null) windowStage.loadContent('testability/pages/index7', (err, data) => { if (err.code) { @@ -130,7 +129,6 @@ export default class MainAbility7 extends Ability { } } globalThis.applicationContext7 = this.context.getApplicationContext(); - // let lifecycleid = globalThis.applicationContext7.registerAbilityLifecycleCallback(AbilityLifecycleCallback); let lifecycleid = globalThis.applicationContext7.on('abilityLifecycle', AbilityLifecycleCallback); console.log("[Demo] AbilityLifecycleCallback7 number: " + JSON.stringify(lifecycleid)); setTimeout(function () { diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility8/MainAbility8.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility8/MainAbility8.ts index d3c722322eecbfa8178cdca7aa5719c638f89d8c..99ca094ad71c0a915d99f18252d29c3a1f96357b 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility8/MainAbility8.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility8/MainAbility8.ts @@ -28,7 +28,6 @@ export default class MainAbility8 extends Ability { // Main window is created, set main page for this ability console.log("[Demo] MainAbility8 onWindowStageCreate") globalThis.ability8 = this.context; - // windowStage.setUIContent(this.context, "testability/pages/index8", null) windowStage.loadContent('testability/pages/index8', (err, data) => { if (err.code) { @@ -129,7 +128,6 @@ export default class MainAbility8 extends Ability { } } globalThis.applicationContext8 = this.context.getApplicationContext(); - // let lifecycleid = globalThis.applicationContext8.registerAbilityLifecycleCallback(AbilityLifecycleCallback); let lifecycleid = globalThis.applicationContext8.on('abilityLifecycle', AbilityLifecycleCallback); console.log("[Demo] AbilityLifecycleCallback8 number: " + JSON.stringify(lifecycleid)); setTimeout(function () { diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility9/MainAbility9.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility9/MainAbility9.ts index a6b69b9d2a9e560a20ccaca74f07277762d0a8fc..ad26e7c885f2811ee9cdae0ea44c194772417511 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility9/MainAbility9.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MainAbility9/MainAbility9.ts @@ -28,8 +28,6 @@ export default class MainAbility9 extends Ability { // Main window is created, set main page for this ability console.log("[Demo] MainAbility9 onWindowStageCreate") - // windowStage.setUIContent(this.context, "testability/pages/index9", null) - windowStage.loadContent('testability/pages/index9', (err, data) => { if (err.code) { console.log('MainAbility9 loadContent error'); @@ -96,8 +94,6 @@ export default class MainAbility9 extends Ability { } } globalThis.applicationContext9 = this.context.getApplicationContext(); - // var callBackId = globalThis.applicationContext9 - // .registerAbilityLifecycleCallback(AbilityLifecycleCallback); var callBackId = globalThis.applicationContext9.on('abilityLifecycle', AbilityLifecycleCallback); console.log("callBackId is aaa :" + callBackId); diff --git a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MultiMainability1/MultiMainability1.ts b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MultiMainability1/MultiMainability1.ts index 69231793fe117613020c89dd0de4372de7368f31..e0f32aca3ec3b080cab5bcfeeb662e9fca7ed71b 100644 --- a/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MultiMainability1/MultiMainability1.ts +++ b/ability/crossplatform/ability_runtime/ActsLifeCycleEtsTest/src/main/ets/MultiMainability1/MultiMainability1.ts @@ -21,7 +21,6 @@ export default class MultiMainability1 extends Ability { console.log("[Demo] MultiMainability1 onCreate") globalThis.abilityWant1 = want; console.log("[Demo] MultiMainability1 context: " + JSON.stringify(this.context)); - // var listKey1 = []; let AbilityLifecycleCallback = { onAbilityCreate(ability) { console.log("[Demo] AbilityLifecycleCallback1 onAbilityCreate ability:" @@ -117,7 +116,6 @@ export default class MultiMainability1 extends Ability { // Main window is created, set main page for this ability console.log("[Demo] MultiMainability1 onWindowStageCreate") globalThis.ability1context = this.context; - // windowStage.setUIContent(this.context, "testability/pages/index1", null) windowStage.loadContent('testability/pages/index1', (err, data) => { if (err.code) { diff --git a/ability/crossplatform/ability_runtime/ActsUiAbilityEtsTest/BUILD.gn b/ability/crossplatform/ability_runtime/ActsUiAbilityEtsTest/BUILD.gn index 30ce8a7597b440149109c95566ba54849eb568c6..dbf21402de9b225740144d89acc6dcb8e12ad2d7 100644 --- a/ability/crossplatform/ability_runtime/ActsUiAbilityEtsTest/BUILD.gn +++ b/ability/crossplatform/ability_runtime/ActsUiAbilityEtsTest/BUILD.gn @@ -22,29 +22,19 @@ ohos_js_hap_suite("ActsUiAbilityEtsTest") { ets2abc = true certificate_profile = "./signature/openharmony_sx.p7b" - # hap_name: HAP的名字,可选,默认为目标名 hap_name = "ActsUiAbilityEtsTest" subsystem_name = "ability" part_name = "ability_runtime" } ohos_app_scope("windowStage_app_profile") { - # app_profile: HAP的AppScope中的app.json,只在Stage模型下使用 app_profile = "AppScope/app.json" - - # sources: 资源文件路径 sources = [ "AppScope/resources" ] } ohos_js_assets("windowStage_js_assets") { - # source_dir: js或ets代码路径,兼容FA模型的单ability配置到ability目录 source_dir = "src/main/ets" } ohos_resources("windowStage_resources") { - # sources: 资源文件路径 sources = [ "src/main/resources" ] - - # deps: 当前目标的依赖 deps = [ ":windowStage_app_profile" ] - - # hap_profile: HAP的config.json,Stage模型对应module.json hap_profile = "src/main/module.json" } diff --git a/ability/crossplatform/ability_runtime/ActsUiAbilityEtsTest/src/main/ets/MainAbility3/MainAbility3.ts b/ability/crossplatform/ability_runtime/ActsUiAbilityEtsTest/src/main/ets/MainAbility3/MainAbility3.ts index 8cebd446a4ab787baff1045b746c4d38d2ad5352..1268d0db1cbb477cb055ba7ada670f531b3dc752 100644 --- a/ability/crossplatform/ability_runtime/ActsUiAbilityEtsTest/src/main/ets/MainAbility3/MainAbility3.ts +++ b/ability/crossplatform/ability_runtime/ActsUiAbilityEtsTest/src/main/ets/MainAbility3/MainAbility3.ts @@ -56,15 +56,6 @@ export default class MainAbility3 extends Ability { onForeground() { console.log("[Demo] MainAbility3 onForeground") recordLife(globalThis.list3, abilityName, 'onForeground'); - // setTimeout(function () { - // console.log("[Demo] MainAbility3 onForeground after 1500ms") - // globalThis.ability3context.terminateSelf() - // .then((data) => { - // console.info('[Demo] MainAbility3 terminateself succeeded: ' + data); - // }).catch((error) => { - // console.error('[Demo] MainAbility3 terminateself failed. Cause: ' + error); - // }) - // }, 1500); } onBackground() { diff --git a/ability/crossplatform/ability_runtime/commonTestAbilityApp/BUILD.gn b/ability/crossplatform/ability_runtime/commonTestAbilityApp/BUILD.gn index ea005f55dfce0f39a6f9734d61bf78748866b3d7..1c54e6efaaffea9d9c0e64ec9bfb836866cbaf56 100644 --- a/ability/crossplatform/ability_runtime/commonTestAbilityApp/BUILD.gn +++ b/ability/crossplatform/ability_runtime/commonTestAbilityApp/BUILD.gn @@ -22,29 +22,19 @@ ohos_hap_assist_suite("commonTestAbilityApp") { ets2abc = true certificate_profile = "./signature/openharmony_sx.p7b" - # hap_name: HAP的名字,可选,默认为目标名 hap_name = "commonTestAbilityApp" subsystem_name = "ability" part_name = "ability_runtime" } ohos_app_scope("windowStage_app_profile") { - # app_profile: HAP的AppScope中的app.json,只在Stage模型下使用 app_profile = "AppScope/app.json" - - # sources: 资源文件路径 sources = [ "AppScope/resources" ] } ohos_js_assets("windowStage_js_assets") { - # source_dir: js或ets代码路径,兼容FA模型的单ability配置到ability目录 source_dir = "src/main/ets" } ohos_resources("windowStage_resources") { - # sources: 资源文件路径 sources = [ "src/main/resources" ] - - # deps: 当前目标的依赖 deps = [ ":windowStage_app_profile" ] - - # hap_profile: HAP的config.json,Stage模型对应module.json hap_profile = "src/main/module.json" }