From 7841436120496ca9cfc5d998fa6d2a94188d1ff2 Mon Sep 17 00:00:00 2001 From: jiyong Date: Sat, 26 Feb 2022 00:17:19 -0800 Subject: [PATCH] add stage Signed-off-by: jiyong --- .../entry/src/main/ets/AbilityStage.ts | 16 +++++++++++++++- .../src/main/ets/MainAbility/MainAbility.ts | 14 ++++++++++++++ .../entry/src/main/ets/MainAbility/app.ets | 16 +++++++++++++++- .../src/main/ets/MainAbility/pages/index.ets | 16 +++++++++++++++- .../src/main/ets/MainAbility/pages/second.ets | 16 +++++++++++++++- .../main/ets/ServiceAbility/ServiceAbility.ts | 14 ++++++++++++++ .../entry/src/main/ets/ServiceAbility/service.ts | 16 +++++++++++++++- .../main/ets/ServiceAbility2/ServiceAbility2.ts | 14 ++++++++++++++ .../src/main/ets/ServiceAbility2/service.ts | 16 +++++++++++++++- .../src/main/ets/test/ExtensionTest.test.ets | 16 +++++++++++++++- 10 files changed, 147 insertions(+), 7 deletions(-) diff --git a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/AbilityStage.ts b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/AbilityStage.ts index 711b26a60..fd1f27a59 100755 --- a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/AbilityStage.ts +++ b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/AbilityStage.ts @@ -1,3 +1,17 @@ +/** + * Copyright (c) 2021 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 AbilityStage from "@ohos.application.AbilityStage" export default class MyAbilityStage extends AbilityStage { @@ -7,4 +21,4 @@ export default class MyAbilityStage extends AbilityStage { globalThis.stageContext = this.context; globalThis.lifeCycleList = []; } -} \ No newline at end of file +} diff --git a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/MainAbility.ts index 320da5445..ec696dd39 100755 --- a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/MainAbility.ts @@ -1,3 +1,17 @@ +/** + * Copyright (c) 2021 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 Ability from '@ohos.application.Ability' export default class MainAbility extends Ability { diff --git a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/app.ets b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/app.ets index b7a0995c8..8fa46789d 100755 --- a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/app.ets +++ b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/app.ets @@ -1,3 +1,17 @@ +/** + * Copyright (c) 2021 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. + */ export default { onCreate() { console.info('Application onCreate') @@ -5,4 +19,4 @@ export default { onDestroy() { console.info('Application onDestroy') }, -} \ No newline at end of file +} diff --git a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/pages/index.ets index d23792b1b..b31be6a50 100755 --- a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/pages/index.ets +++ b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/pages/index.ets @@ -1,3 +1,17 @@ +/** + * Copyright (c) 2021 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 file from '@system.file'; import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets" @@ -49,4 +63,4 @@ struct Index { .width('100%') .height('100%') } -} \ No newline at end of file +} diff --git a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/pages/second.ets b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/pages/second.ets index 4d58355c7..23efeed6e 100755 --- a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/pages/second.ets +++ b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/pages/second.ets @@ -1,3 +1,17 @@ +/** + * Copyright (c) 2021 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 router from '@system.router'; @Entry @@ -26,4 +40,4 @@ struct Second { .width('100%') .height('100%') } -} \ No newline at end of file +} diff --git a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility/ServiceAbility.ts index 34c79d8fb..058b3eb63 100755 --- a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility/ServiceAbility.ts @@ -1,3 +1,17 @@ +/** + * Copyright (c) 2021 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 ServiceExtension from "@ohos.application.ServiceExtension" export default class MyServiceAbility extends ServiceExtension { diff --git a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility/service.ts b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility/service.ts index 383f9f0eb..f4fcb0ca6 100755 --- a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility/service.ts +++ b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility/service.ts @@ -1,3 +1,17 @@ +/** + * Copyright (c) 2021 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. + */ export default { onStart() { console.info('ServiceAbility onStart'); @@ -8,4 +22,4 @@ export default { onCommand(want, startId) { console.info('ServiceAbility onCommand'); } -}; \ No newline at end of file +}; diff --git a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts index 67b276738..63a71d43a 100755 --- a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts +++ b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts @@ -1,3 +1,17 @@ +/** + * Copyright (c) 2021 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 ServiceExtension from "@ohos.application.ServiceExtension" export default class MyServiceAbility extends ServiceExtension { diff --git a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility2/service.ts b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility2/service.ts index 383f9f0eb..f4fcb0ca6 100755 --- a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility2/service.ts +++ b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility2/service.ts @@ -1,3 +1,17 @@ +/** + * Copyright (c) 2021 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. + */ export default { onStart() { console.info('ServiceAbility onStart'); @@ -8,4 +22,4 @@ export default { onCommand(want, startId) { console.info('ServiceAbility onCommand'); } -}; \ No newline at end of file +}; diff --git a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/test/ExtensionTest.test.ets b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/test/ExtensionTest.test.ets index 20ad652e3..536574dfd 100755 --- a/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/test/ExtensionTest.test.ets +++ b/aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/test/ExtensionTest.test.ets @@ -1,3 +1,17 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" export default function ExtensionTest(abilityContext) { @@ -896,4 +910,4 @@ export default function ExtensionTest(abilityContext) { } }) -} \ No newline at end of file +} -- GitLab