From b9d91a01a512955403b552e9dc90488aebd263f6 Mon Sep 17 00:00:00 2001 From: zwx1066281 Date: Fri, 11 Mar 2022 10:05:59 +0800 Subject: [PATCH] update PermissionManager.hap code Signed-off-by: zwx1066281 --- .../entry/src/main/config.json | 19 +- .../src/main/ets/MainAbility}/app.ets | 6 +- .../MainAbility/pages/index.ets} | 48 ++- .../pages/second.ets} | 22 +- .../ohos/permissionmanager/MyApplication.java | 25 -- .../main/resources/base/element/string.json | 2 +- .../entry/src/ohosTest/ets/default/app.ets | 26 -- .../src/ohosTest/ets/default/i18n/en-US.json | 8 - .../src/ohosTest/ets/default/i18n/zh-CN.json | 8 - .../ets/default/pages/index/index.ets | 64 --- .../ohosTest/ets/test/ExampleJsunit.test.ets | 27 -- .../entry/src/ohosTest/ets/test/List.test.ets | 20 - .../permissionmanager/ExampleOhosTest.java | 29 -- .../resources/base/element/string.json | 12 - .../ohosTest/resources/base/media/icon.png | Bin 6790 -> 0 bytes .../permissionmanager/src/main/config.json | 30 +- .../src/main/ets/GrantAbility}/app.ets | 0 .../common/components/dialog.ets | 91 +++-- .../common/model/bundle.ets | 0 .../common/model/permissionGroup.ets | 0 .../common/utils/constant.ets | 0 .../common/utils/utils.ets | 0 .../pages/dialogPlus.ets | 56 ++- .../main/ets/{default => MainAbility}/app.ets | 0 .../common/components/alphabeticalIndex.ets | 0 .../common/components/backBar.ets | 0 .../common/components/dialog.ets | 0 .../common/components/search.ets | 0 .../common/model/permissionGroup.ets | 36 +- .../common/utils/constant.ets | 31 +- .../common/utils/utils.ets | 0 .../pages/application-secondary.ets | 12 +- .../pages/application-tertiary.ets | 20 +- .../pages/authority-management.ets | 97 +++-- .../pages/authority-secondary.ets | 8 +- .../pages/authority-tertiary-groups.ets | 382 ++++++++++++++++++ .../pages/authority-tertiary.ets | 12 +- .../pages/other-permissions.ets | 8 +- .../resources/ar/properties/string.json | 0 .../resources/dark/properties/string.json | 0 .../resources/default/media/icon_actived.png | Bin .../resources/default/media/icon_normal.png | Bin .../resources/default/properties/string.json | 0 .../resources/en/properties/string.json | 0 .../resources/light/properties/string.json | 0 .../resources/zh/properties/string.json | 0 .../ohos/permissionmanager/MainAbility.java | 32 -- .../ohos/permissionmanager/MyApplication.java | 25 -- .../main/resources/base/element/string.json | 4 +- .../src/ohosTest/ets/default/app.ets | 26 -- .../src/ohosTest/ets/default/i18n/en-US.json | 8 - .../src/ohosTest/ets/default/i18n/zh-CN.json | 8 - .../ets/default/pages/index/index.ets | 64 --- .../ohosTest/ets/test/ExampleJsunit.test.ets | 27 -- .../src/ohosTest/ets/test/List.test.ets | 20 - .../permissionmanager/ExampleOhosTest.java | 29 -- .../resources/base/element/string.json | 12 - .../ohosTest/resources/base/media/icon.png | Bin 6790 -> 0 bytes 58 files changed, 690 insertions(+), 664 deletions(-) rename frameworks/com.ohos.permissionmanager/{permissionmanager/src/main/ets/dynamic => entry/src/main/ets/MainAbility}/app.ets (97%) rename frameworks/com.ohos.permissionmanager/entry/src/main/{java/com/ohos/permissionmanager/MainAbility.java => ets/MainAbility/pages/index.ets} (43%) rename frameworks/com.ohos.permissionmanager/entry/src/main/ets/{default/pages/index.ets => MainAbility/pages/second.ets} (68%) delete mode 100644 frameworks/com.ohos.permissionmanager/entry/src/main/java/com/ohos/permissionmanager/MyApplication.java delete mode 100644 frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/app.ets delete mode 100644 frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/i18n/en-US.json delete mode 100644 frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/i18n/zh-CN.json delete mode 100644 frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/pages/index/index.ets delete mode 100644 frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/test/ExampleJsunit.test.ets delete mode 100644 frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/test/List.test.ets delete mode 100644 frameworks/com.ohos.permissionmanager/entry/src/ohosTest/java/com/ohos/permissionmanager/ExampleOhosTest.java delete mode 100644 frameworks/com.ohos.permissionmanager/entry/src/ohosTest/resources/base/element/string.json delete mode 100644 frameworks/com.ohos.permissionmanager/entry/src/ohosTest/resources/base/media/icon.png rename frameworks/com.ohos.permissionmanager/{entry/src/main/ets/default => permissionmanager/src/main/ets/GrantAbility}/app.ets (100%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{dynamic => GrantAbility}/common/components/dialog.ets (75%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{dynamic => GrantAbility}/common/model/bundle.ets (100%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{dynamic => GrantAbility}/common/model/permissionGroup.ets (100%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{dynamic => GrantAbility}/common/utils/constant.ets (100%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{dynamic => GrantAbility}/common/utils/utils.ets (100%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{dynamic => GrantAbility}/pages/dialogPlus.ets (55%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/app.ets (100%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/common/components/alphabeticalIndex.ets (100%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/common/components/backBar.ets (100%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/common/components/dialog.ets (100%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/common/components/search.ets (100%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/common/model/permissionGroup.ets (97%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/common/utils/constant.ets (93%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/common/utils/utils.ets (100%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/pages/application-secondary.ets (97%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/pages/application-tertiary.ets (96%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/pages/authority-management.ets (89%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/pages/authority-secondary.ets (95%) create mode 100644 frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/authority-tertiary-groups.ets rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/pages/authority-tertiary.ets (97%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/pages/other-permissions.ets (95%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/resources/ar/properties/string.json (100%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/resources/dark/properties/string.json (100%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/resources/default/media/icon_actived.png (100%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/resources/default/media/icon_normal.png (100%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/resources/default/properties/string.json (100%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/resources/en/properties/string.json (100%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/resources/light/properties/string.json (100%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/resources/zh/properties/string.json (100%) delete mode 100644 frameworks/com.ohos.permissionmanager/permissionmanager/src/main/java/com/ohos/permissionmanager/MainAbility.java delete mode 100644 frameworks/com.ohos.permissionmanager/permissionmanager/src/main/java/com/ohos/permissionmanager/MyApplication.java delete mode 100644 frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/app.ets delete mode 100644 frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/i18n/en-US.json delete mode 100644 frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/i18n/zh-CN.json delete mode 100644 frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/pages/index/index.ets delete mode 100644 frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/test/ExampleJsunit.test.ets delete mode 100644 frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/test/List.test.ets delete mode 100644 frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/java/com/ohos/permissionmanager/ExampleOhosTest.java delete mode 100644 frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/resources/base/element/string.json delete mode 100644 frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/resources/base/media/icon.png diff --git a/frameworks/com.ohos.permissionmanager/entry/src/main/config.json b/frameworks/com.ohos.permissionmanager/entry/src/main/config.json index 165e0d3bd..fb8fc1e71 100644 --- a/frameworks/com.ohos.permissionmanager/entry/src/main/config.json +++ b/frameworks/com.ohos.permissionmanager/entry/src/main/config.json @@ -11,10 +11,10 @@ "module": { "package": "com.ohos.permissionmanager", "name": ".MyApplication", - "mainAbility": "com.ohos.permissionmanager.MainAbility", + "mainAbility": ".MainAbility", + "srcPath": "", "deviceType": [ - "phone", - "tablet" + "phone" ], "distro": { "deliveryWithInstall": true, @@ -34,10 +34,14 @@ ] } ], + "orientation": "unspecified", "visible": true, - "name": "com.ohos.permissionmanager.MainAbility", + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", "icon": "$media:icon", - "description": "$string:mainability_description", + "description": "$string:description_mainability", + "formsEnabled": false, "label": "$string:entry_MainAbility", "type": "page", "launchType": "standard" @@ -50,9 +54,10 @@ "type": "pageAbility" }, "pages": [ - "pages/index" + "pages/index", + "pages/second" ], - "name": "default", + "name": ".MainAbility", "window": { "designWidth": 720, "autoDesignWidth": false diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/app.ets b/frameworks/com.ohos.permissionmanager/entry/src/main/ets/MainAbility/app.ets similarity index 97% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/app.ets rename to frameworks/com.ohos.permissionmanager/entry/src/main/ets/MainAbility/app.ets index 9ae634daa..1007addd5 100644 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/app.ets +++ b/frameworks/com.ohos.permissionmanager/entry/src/main/ets/MainAbility/app.ets @@ -12,12 +12,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -export default { + + export default { onCreate() { console.info('Application onCreate') }, onDestroy() { console.info('Application onDestroy') }, -} +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/entry/src/main/java/com/ohos/permissionmanager/MainAbility.java b/frameworks/com.ohos.permissionmanager/entry/src/main/ets/MainAbility/pages/index.ets similarity index 43% rename from frameworks/com.ohos.permissionmanager/entry/src/main/java/com/ohos/permissionmanager/MainAbility.java rename to frameworks/com.ohos.permissionmanager/entry/src/main/ets/MainAbility/pages/index.ets index 4b7057089..a438be437 100644 --- a/frameworks/com.ohos.permissionmanager/entry/src/main/java/com/ohos/permissionmanager/MainAbility.java +++ b/frameworks/com.ohos.permissionmanager/entry/src/main/ets/MainAbility/pages/index.ets @@ -13,19 +13,41 @@ * limitations under the License. */ -package com.ohos.permissionmanager; +import router from '@system.router'; -import ohos.ace.ability.AceAbility; -import ohos.aafwk.content.Intent; - -public class MainAbility extends AceAbility { - @Override - public void onStart(Intent intent) { - super.onStart(intent); - } +async function routePage() { + let options = { + uri: 'pages/second' + } + try { + await router.push(options) + } catch (err) { + console.error(`fail callback, code: ${err.code}, msg: ${err.msg}`) + } +} - @Override - public void onStop() { - super.onStop(); +@Entry +@Component +struct Index { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World') + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(25) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + routePage() + }) } -} + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/entry/src/main/ets/default/pages/index.ets b/frameworks/com.ohos.permissionmanager/entry/src/main/ets/MainAbility/pages/second.ets similarity index 68% rename from frameworks/com.ohos.permissionmanager/entry/src/main/ets/default/pages/index.ets rename to frameworks/com.ohos.permissionmanager/entry/src/main/ets/MainAbility/pages/second.ets index 5e693e0f5..2a9a10d49 100644 --- a/frameworks/com.ohos.permissionmanager/entry/src/main/ets/default/pages/index.ets +++ b/frameworks/com.ohos.permissionmanager/entry/src/main/ets/MainAbility/pages/second.ets @@ -13,16 +13,32 @@ * limitations under the License. */ +import router from '@system.router'; + @Entry @Component -struct Index { +struct Second { + private content: string = "Second Page" + build() { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World') + Text(`${this.content}`) .fontSize(50) .fontWeight(FontWeight.Bold) + Button() { + Text('back to index') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) } .width('100%') .height('100%') } -} +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/entry/src/main/java/com/ohos/permissionmanager/MyApplication.java b/frameworks/com.ohos.permissionmanager/entry/src/main/java/com/ohos/permissionmanager/MyApplication.java deleted file mode 100644 index 6c8f0f649..000000000 --- a/frameworks/com.ohos.permissionmanager/entry/src/main/java/com/ohos/permissionmanager/MyApplication.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2021-2022 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. - */ - -package com.ohos.permissionmanager; - -import ohos.aafwk.ability.AbilityPackage; - -public class MyApplication extends AbilityPackage { - @Override - public void onInitialize() { - super.onInitialize(); - } -} diff --git a/frameworks/com.ohos.permissionmanager/entry/src/main/resources/base/element/string.json b/frameworks/com.ohos.permissionmanager/entry/src/main/resources/base/element/string.json index bc3df790e..b93f540e2 100644 --- a/frameworks/com.ohos.permissionmanager/entry/src/main/resources/base/element/string.json +++ b/frameworks/com.ohos.permissionmanager/entry/src/main/resources/base/element/string.json @@ -5,7 +5,7 @@ "value": "entry_MainAbility" }, { - "name": "mainability_description", + "name": "description_mainability", "value": "eTS_Empty Ability" } ] diff --git a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/app.ets b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/app.ets deleted file mode 100644 index 03748140d..000000000 --- a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/app.ets +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2021-2022 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') - }, - onShow() { - console.info('Application onShow') - }, - onDestroy() { - console.info('Application onDestroy') - }, -} diff --git a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/i18n/en-US.json b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/i18n/en-US.json deleted file mode 100644 index 55561b837..000000000 --- a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/i18n/zh-CN.json b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/i18n/zh-CN.json deleted file mode 100644 index cce1af067..000000000 --- a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/pages/index/index.ets b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/pages/index/index.ets deleted file mode 100644 index 61dc37aa5..000000000 --- a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/pages/index/index.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2021-2022 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 {Core, ExpectExtend, InstrumentLog} from "deccjsunit/index" -import testsuite from "../../../test/List.test.ets" -import featureAbility from "@ohos.ability.featureAbility" - -@Entry -@Component -struct MyComponent { - aboutToAppear() { - console.info("start run testcase!!!!") - featureAbility.getWant() - .then((Want) => { - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - const instrumentLog = new InstrumentLog({ - 'id': 'report', 'unity': 'true' - }) - core.addService('expect', expectExtend) - core.addService('report', instrumentLog) - core.init() - core.subscribeEvent('spec', instrumentLog) - core.subscribeEvent('suite', instrumentLog) - core.subscribeEvent('task', instrumentLog) - const configService = core.getDefaultService('config') - configService.setConfig(Want.parameters) - testsuite() - core.execute() - console.info('Operation successful. Data: ' + JSON.stringify(Want)); - }) - .catch((error) => { - console.error('Operation failed. Cause: ' + JSON.stringify(error)); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text('Hello World') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} diff --git a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/test/ExampleJsunit.test.ets b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/test/ExampleJsunit.test.ets deleted file mode 100644 index c76c23ebb..000000000 --- a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/test/ExampleJsunit.test.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2021-2022 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" -import app from '@system.app' - -export default function exampleJsunit() { - describe('appInfoTest', function () { - it('app_info_test_001', 0, function () { - var info = app.getInfo() - expect("1.0").assertEqual('1.0') - expect(info.versionCode).assertEqual('3') - }) - }) -} diff --git a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/test/List.test.ets b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 23005224d..000000000 --- a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2021-2022 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 exampleJsunit from "../test/ExampleJsunit.test.ets" - -export default function testsuite() { - exampleJsunit() -} diff --git a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/java/com/ohos/permissionmanager/ExampleOhosTest.java b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/java/com/ohos/permissionmanager/ExampleOhosTest.java deleted file mode 100644 index e0c56a5cd..000000000 --- a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/java/com/ohos/permissionmanager/ExampleOhosTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2021-2022 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. - */ - -package com.ohos.permissionmanager; - -import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; - -public class ExampleOhosTest { - @Test - public void testBundleName() { - final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName(); - assertEquals("com.ohos.permissionmanager", actualBundleName); - } -} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/resources/base/element/string.json b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index 998415d35..000000000 --- a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "finalApplication" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] -} diff --git a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/resources/base/media/icon.png b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x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SrD~EwK_DqI^7%3#p5)%T_od!t3SOmH9MyXeeGO2(UQL;ax|x?Ncixmeo1=$ z{-);Au{*tfzOG?KQ~K|ak8-HQ?`Pekhe2WM(8s{xv-p>Zmu_6{G!-oE$7$mY`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}y= this.grantGroups.length)) { this.controller.close() this.aboutToDisappear() return false } - if(this.grantGroups[this.count] == 0) { - this.result[this.count] = -1 - this.count ++ - return false - } - var acManager = abilityAccessCtrl.createAtManager() - var flag = await acManager.getPermissionFlags(this.accessTokenId, permission) - console.log("GrantAbility permission: " + permission + " flag : " + flag) - if(flag == this.userFixedFlag) { - console.log("GrantAbility permission has been fixed:" + permission) - var ret = await acManager.verifyAccessToken(this.accessTokenId, permission) - if (ret == 0) { - this.result[this.count] = 0 - } else { - this.result[this.count] = -1 - } - this.count ++ - return false - } - this.result[this.count] = -1 return true } getApplicationName(uid) { bundle.getNameForUid(uid).then((data) => { - console.log("GrantAbility getApplicationName bundleName:" + data) - console.log("GrantAbility getApplicationName userId:" + Math.floor(uid/200000)) + console.log(TAG + "GrantAbility getApplicationName bundleName:" + data) + console.log(TAG + "GrantAbility getApplicationName userId:" + Math.floor(uid/200000)) bundle.getApplicationInfo(data, BundleFlag.GET_BUNDLE_DEFAULT, Math.floor(uid/200000)).then(applicationInfo => { Resmgr.getResourceManager(data).then(item => { item.getString(applicationInfo.labelId, (err, value) => { @@ -149,47 +131,72 @@ export struct privacyDialog { } else { this.appName = value } - console.log("GrantAbility hap label:" + applicationInfo.label + ", value:"+this.appName) + console.log(TAG + "GrantAbility hap label:" + applicationInfo.label + ", value:"+this.appName) }) }) }).catch(err => { - console.log("GrantAbility applicationInfo error :" + err) + console.log(TAG + "GrantAbility applicationInfo error :" + err) this.initStatus = Constants.INIT_NEED_TO_TERMINATED }) }).catch(err => { - console.log("GrantAbility getNameForUid error :" + JSON.stringify(err)) + console.log(TAG + "GrantAbility getNameForUid error :" + JSON.stringify(err)) this.initStatus = Constants.INIT_NEED_TO_TERMINATED }) } + getgrantGroups() { + var acManager = abilityAccessCtrl.createAtManager() + var num =0 + this.reqPerms.forEach(async (permission, idx) => { + var flag = await acManager.getPermissionFlags(this.accessTokenId, permission) + if(flag == this.userFixedFlag) { + console.log(TAG + "GrantAbility permission has been fixed:" + permission) + var ret = await acManager.verifyAccessToken(this.accessTokenId, permission) + if(ret == abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED) { + this.result[idx] = abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED; + } + }else { + var group = getPermissionGroup(permission) + if(!group) { + console.log(TAG + "GrantAbility permission not find:" + permission) + }else { + var exist = this.grantGroups.find(grantGroup => grantGroup.name == group.name) + if(!exist) { + this.grantGroups.push(group) + } + } + } + num ++ + if(num == this.reqPerms.length) { + if(this.grantGroups.length == 0) { + this.initStatus = Constants.INIT_NEED_TO_TERMINATED + }else { + this.initStatus = Constants.INIT_NEED_TO_VERIFY + } + } + }) + } + aboutToAppear() { this.count = 0; this.initStatus = Constants.INIT_NEED_TO_WAIT this.result = [] featureAbility.getWant((err, want) => { if (err.code != 0) { - console.log("GrantAbility featureAbility.getWant err:" + err) + console.log(TAG + "GrantAbility featureAbility.getWant err:" + err) this.initStatus = Constants.INIT_NEED_TO_TERMINATED return } this.reqPerms = want.parameters['ohos.user.grant.permission'] this.accessTokenId = want.parameters['ohos.aafwk.param.callerToken'] if (this.reqPerms == undefined || this.accessTokenId == undefined || this.reqPerms.length == 0) { - console.log("GrantAbility invalid parameters") + console.log(TAG + "GrantAbility invalid parameters") this.initStatus = Constants.INIT_NEED_TO_TERMINATED return } - console.log("GrantAbility request permission=" + JSON.stringify(this.reqPerms) + ", tokenId = " + this.accessTokenId) - this.reqPerms.forEach(item => { - var group = getPermissionGroup(item) - if(!group) { - this.grantGroups.push(0) - console.log("GrantAbility permission not find:" + item) - }else { - this.grantGroups.push(group) - } - }) - this.initStatus = Constants.INIT_NEED_TO_VERIFY + console.log(TAG + "GrantAbility request permission=" + JSON.stringify(this.reqPerms) + ", tokenId = " + this.accessTokenId) + this.result = new Array(this.reqPerms.length).fill(-1); + this.getgrantGroups(); this.getApplicationName(want.parameters['ohos.aafwk.param.callerUid']) }) } @@ -199,7 +206,7 @@ export struct privacyDialog { if (this.initStatus == Constants.INIT_NEED_TO_TERMINATED) { ret = Constants.RESULT_FAILURE } - console.log("GrantAbility code:" + ret + ", result=" + JSON.stringify(this.result)) + console.log(TAG + "GrantAbility code:" + ret + ", result=" + JSON.stringify(this.result)) featureAbility.terminateSelfWithResult({ resultCode: ret, want: { diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/model/bundle.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/GrantAbility/common/model/bundle.ets similarity index 100% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/model/bundle.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/GrantAbility/common/model/bundle.ets diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/model/permissionGroup.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/GrantAbility/common/model/permissionGroup.ets similarity index 100% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/model/permissionGroup.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/GrantAbility/common/model/permissionGroup.ets diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/utils/constant.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/GrantAbility/common/utils/constant.ets similarity index 100% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/utils/constant.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/GrantAbility/common/utils/constant.ets diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/utils/utils.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/GrantAbility/common/utils/utils.ets similarity index 100% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/utils/utils.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/GrantAbility/common/utils/utils.ets diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/pages/dialogPlus.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/GrantAbility/pages/dialogPlus.ets similarity index 55% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/pages/dialogPlus.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/GrantAbility/pages/dialogPlus.ets index bb9996519..cb5c9c93d 100644 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/pages/dialogPlus.ets +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/GrantAbility/pages/dialogPlus.ets @@ -16,6 +16,8 @@ import { privacyDialog } from "../common/components/dialog.ets" import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +var TAG = "PermissionManager_GrantAbility" + @Entry @Component struct dialogPlusPage { @@ -28,49 +30,37 @@ struct dialogPlusPage { alignment: DialogAlignment.Center }) async privacyAccept(group, accessTokenId, permissionList, userFixedFlag) { - try { - var acManager = abilityAccessCtrl.createAtManager() - var num = 0 - group.permissions.forEach(async permission => { - console.log("GrantAbility grant permission:" + permission) - const result = await acManager.grantUserGrantedPermission(accessTokenId, permission, userFixedFlag) - num ++ - console.log("GrantAbility grant permission result:" + result) - var index = permissionList.indexOf(permission) - if (index == -1) { - console.log("GrantAbility grant permission index err:" + permission) - }else { - if (result == 0) { - this.result[index] = 0 - console.log("GrantAbility grant permission success:" + permission) - } else { - console.log("GrantAbility failed to grant permission:" + permission + " ret:" + result) + var acManager = abilityAccessCtrl.createAtManager() + var num = 0 + group.permissions.forEach(async permission => { + const result = await acManager.grantUserGrantedPermission(accessTokenId, permission, userFixedFlag) + num ++ + console.log(TAG + "GrantAbility grant permission result:" + result + "permission" + permission) + if (result == abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED) { + permissionList.forEach((req, idx) => { + if(req == permission) { + this.result[idx] = abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED; } - } - if(num == group.permissions.length) { - this.count ++ - } - }) - }catch { - this.count ++ - } + }) + console.log(TAG + "GrantAbility grant permission success:" + permission) + } else { + console.log(TAG + "GrantAbility failed to grant permission:" + permission + " ret:" + result) + } + if(num == group.permissions.length) { + this.count ++ + } + }) } async privacyCancel(group, accessTokenId, permissionList, userFixedFlag) { var acManager = abilityAccessCtrl.createAtManager() group.permissions.forEach(async permission => { - console.log("GrantAbility revoke permission:" + permission) const result = await acManager.revokeUserGrantedPermission(accessTokenId, permission, userFixedFlag) - console.log("GrantAbility revoke permission result:" + result) - var index = permissionList.indexOf(permission) - if (index != -1 && result == 0) { - this.result[index] = -1 - console.log("GrantAbility revoke permission:" + permission) - } + console.log(TAG + "GrantAbility revoke permission result:" + result + "permission" + permission); }) this.count ++ } privacyExist() { - console.info("exist") + console.info(TAG + "exist") } aboutToAppear() { this.privacyDialogController.open() diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/app.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/app.ets similarity index 100% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/app.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/app.ets diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/common/components/alphabeticalIndex.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/components/alphabeticalIndex.ets similarity index 100% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/common/components/alphabeticalIndex.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/components/alphabeticalIndex.ets diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/common/components/backBar.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/components/backBar.ets similarity index 100% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/common/components/backBar.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/components/backBar.ets diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/common/components/dialog.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/components/dialog.ets similarity index 100% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/common/components/dialog.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/components/dialog.ets diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/common/components/search.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/components/search.ets similarity index 100% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/common/components/search.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/components/search.ets diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/common/model/permissionGroup.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/model/permissionGroup.ets similarity index 97% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/common/model/permissionGroup.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/model/permissionGroup.ets index d5a3d0318..77a0fdd33 100644 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/common/model/permissionGroup.ets +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/model/permissionGroup.ets @@ -193,7 +193,8 @@ export const groups: any[] = [ "permissions": [ "ohos.permission.LOCATION_IN_BACKGROUND", "ohos.permission.LOCATION" - ] + ], + "isShow":true }, { "name": "CAMERA", @@ -202,7 +203,8 @@ export const groups: any[] = [ "description": "访问您的相机", "permissions": [ "ohos.permission.CAMERA" - ] + ], + "isShow":true }, { "name": "MICROPHONE", @@ -211,7 +213,8 @@ export const groups: any[] = [ "description": "访问您的麦克风", "permissions": [ "ohos.permission.MICROPHONE" - ] + ], + "isShow":true }, { "name": "PHONE", @@ -221,7 +224,8 @@ export const groups: any[] = [ "permissions": [ "ohos.permission.ANSWER_CALL", "ohos.permission.MANAGE_VOICEMAIL" - ] + ], + "isShow":false }, { "name": "SMS", @@ -235,7 +239,8 @@ export const groups: any[] = [ "ohos.permission.RECEIVE_SMS", "ohos.permission.RECEIVE_WAP_MESSAGES", "ohos.permission.SEND_MESSAGES" - ] + ], + "isShow":false }, { "name": "CONTACTS", @@ -245,7 +250,8 @@ export const groups: any[] = [ "permissions": [ "ohos.permission.READ_CONTACTS", "ohos.permission.WRITE_CONTACTS" - ] + ], + "isShow":false }, { "name": "CALL_LOG", @@ -255,7 +261,8 @@ export const groups: any[] = [ "permissions": [ "ohos.permission.READ_CALL_LOG", "ohos.permission.WRITE_CALL_LOG" - ] + ], + "isShow":false }, { "name": "MEDIA", @@ -266,7 +273,8 @@ export const groups: any[] = [ "ohos.permission.MEDIA_LOCATION", "ohos.permission.READ_MEDIA", "ohos.permission.WRITE_MEDIA" - ] + ], + "isShow":true }, { "name": "CALENDAR", @@ -276,7 +284,8 @@ export const groups: any[] = [ "permissions": [ "ohos.permission.READ_CALENDAR", "ohos.permission.WRITE_CALENDAR" - ] + ], + "isShow":true }, { "name": "SPORT", @@ -285,7 +294,8 @@ export const groups: any[] = [ "description": "访问您的运动状态", "permissions": [ "ohos.permission.ACTIVITY_MOTION" - ] + ], + "isShow":true }, { "name": "HEALTH", @@ -294,7 +304,8 @@ export const groups: any[] = [ "description": "访问您的健康数据", "permissions": [ "ohos.permission.READ_HEALTH_DATA" - ] + ], + "isShow":true }, { "name": "OTHER", @@ -303,7 +314,8 @@ export const groups: any[] = [ "description": "访问您的其它权限", "permissions": [ "ohos.permission.DISTRIBUTED_DATASYNC" - ] + ], + "isShow":false } ]; diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/common/utils/constant.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/utils/constant.ets similarity index 93% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/common/utils/constant.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/utils/constant.ets index bfcd8362c..cd7dceeae 100644 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/common/utils/constant.ets +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/utils/constant.ets @@ -57,29 +57,30 @@ export default class Constants { static TEXTINPUT_IMAGE_MARGIN_TOP = 12; // grid useSizeType + static GRID_MARGIN = '0vp'; static GUTTER = 0; - static LEFT_XS_SPAN = 1; + static LEFT_XS_SPAN = 0; static LEFT_XS_OFFSET = 0; - static LEFT_SM_SPAN = 1; + static LEFT_SM_SPAN = 0; static LEFT_SM_OFFSET = 0; - static LEFT_MD_SPAN = 1; + static LEFT_MD_SPAN = 0; static LEFT_MD_OFFSET = 0; static LEFT_LG_SPAN = 2; static LEFT_LG_OFFSET = 0; - static MIDDLE_XS_SPAN = 1; - static MIDDLE_XS_OFFSET = 1; - static MIDDLE_SM_SPAN = 2; - static MIDDLE_SM_OFFSET = 1; - static MIDDLE_MD_SPAN = 6; - static MIDDLE_MD_OFFSET = 1; + static MIDDLE_XS_SPAN = 2; + static MIDDLE_XS_OFFSET = 0; + static MIDDLE_SM_SPAN = 4; + static MIDDLE_SM_OFFSET = 0; + static MIDDLE_MD_SPAN = 8; + static MIDDLE_MD_OFFSET = 0; static MIDDLE_LG_SPAN = 8; static MIDDLE_LG_OFFSET = 2; - static RIGHT_XS_SPAN = 1; + static RIGHT_XS_SPAN = 0; static RIGHT_XS_OFFSET = 2; - static RIGHT_SM_SPAN = 1; - static RIGHT_SM_OFFSET = 3; - static RIGHT_MD_SPAN = 1; - static RIGHT_MD_OFFSET = 7; + static RIGHT_SM_SPAN = 0; + static RIGHT_SM_OFFSET = 4; + static RIGHT_MD_SPAN = 0; + static RIGHT_MD_OFFSET = 8; static RIGHT_LG_SPAN = 2; static RIGHT_LG_OFFSET = 10; @@ -170,6 +171,7 @@ export default class Constants { static MANAGEMENT_ROW_PADDING_RIGHT = 12; static MANAGEMENT_ROW_PADDING_TOP = 8; static MANAGEMENT_ROW_MARGIN_TOP = 12; + static MANAGEMENT_TRANSPARENCY = 0.8; static APPLICATION_IMAGE_WIDTH = 40; static APPLICATION_IMAGE_HEIGHT = 40; static APPLICATION_IMAGE_MARGIN_RIGHT = 16; @@ -197,6 +199,7 @@ export default class Constants { // setTimeout static DELAY_TIME = 1000; + static DELAY_TIME_MAX = 2000; // radio static RADIO_ALLOW_NAME = '允许'; diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/common/utils/utils.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/utils/utils.ets similarity index 100% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/common/utils/utils.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/common/utils/utils.ets diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/pages/application-secondary.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/application-secondary.ets similarity index 97% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/pages/application-secondary.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/application-secondary.ets index 0876bbb9b..4ec9944b5 100644 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/pages/application-secondary.ets +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/application-secondary.ets @@ -19,6 +19,8 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; import { groups } from "../common/model/permissionGroup.ets"; import Constants from '../common/utils/constant.ets'; +var TAG = 'PermissionManager_MainAbility:' + const allowedStatus = 0; // Status: Allowed const bannedStatus = 1; // Status: Banned class AllowedObj { @@ -177,7 +179,7 @@ struct appNamePlusPage { build() { Column(){ - GridContainer({ gutter: Constants.GUTTER }) { + GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) { Row({}) { Row() .useSizeType({ @@ -187,7 +189,6 @@ struct appNamePlusPage { lg: { span: Constants.LEFT_LG_SPAN, offset: Constants.LEFT_LG_OFFSET } }) .height(Constants.FULL_HEIGHT) - .backgroundColor(Color.White) Row() { Column() { Row() { @@ -285,7 +286,6 @@ struct appNamePlusPage { } .width(Constants.FULL_WIDTH) .height(Constants.FULL_HEIGHT) - .backgroundColor($r('app.color.background_color')) } .layoutWeight(Constants.LAYOUT_WEIGHT) } @@ -305,10 +305,12 @@ struct appNamePlusPage { lg: { span: Constants.RIGHT_LG_SPAN, offset: Constants.RIGHT_LG_OFFSET } }) .height(Constants.FULL_HEIGHT) - .backgroundColor(Color.White) } .height(Constants.FULL_HEIGHT) - }.backgroundColor(Color.White) + .width(Constants.FULL_WIDTH) + .backgroundColor($r("sys.color.ohos_id_color_sub_background")) + .opacity(Constants.MANAGEMENT_TRANSPARENCY) + } } } } diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/pages/application-tertiary.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/application-tertiary.ets similarity index 96% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/pages/application-tertiary.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/application-tertiary.ets index b1d7eab8c..8948b2462 100644 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/pages/application-tertiary.ets +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/application-tertiary.ets @@ -22,6 +22,8 @@ import { authorizeDialog } from "../common/components/dialog.ets"; import { permissionDescriptions, permissionGroups } from "../common/model/permissionGroup.ets"; import Constants from '../common/utils/constant.ets'; +var TAG = 'PermissionManager_MainAbility:' + let routerData = router.getParams().routerData; // Routing jump data let backTitle = router.getParams().backTitle; // return title name let status = router.getParams().status; // Status: Allowed, Forbidden @@ -73,7 +75,7 @@ class MediaListObj { struct mediaDocumentPage { build() { Column() { - GridContainer({ gutter: Constants.GUTTER }) { + GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) { Row() { Row() .useSizeType({ @@ -83,7 +85,6 @@ struct mediaDocumentPage { lg: { span: Constants.LEFT_LG_SPAN, offset: Constants.LEFT_LG_OFFSET } }) .height(Constants.FULL_HEIGHT) - .backgroundColor(Color.White) Row() { Column() { Row() { @@ -116,11 +117,13 @@ struct mediaDocumentPage { lg: { span: Constants.RIGHT_LG_SPAN, offset: Constants.RIGHT_LG_OFFSET } }) .height(Constants.FULL_HEIGHT) - .backgroundColor(Color.White) } .height(Constants.FULL_HEIGHT) + .width(Constants.FULL_WIDTH) + .backgroundColor($r("sys.color.ohos_id_color_sub_background")) + .opacity(Constants.MANAGEMENT_TRANSPARENCY) } - }.backgroundColor(Color.White) + } } } @@ -152,7 +155,7 @@ struct mediaDocumentItem { nowGrantResult = result; }) .catch((error) => { - console.error('grantUserGrantedPermission failed. Cause: ' + JSON.stringify(error)); + console.error(TAG + 'grantUserGrantedPermission failed. Cause: ' + JSON.stringify(error)); }) } @@ -167,7 +170,7 @@ struct mediaDocumentItem { nowRevokeResult = result; }) .catch((error) => { - console.error('revokeUserGrantedPermission failed. Cause: ' + JSON.stringify(error)); + console.error(TAG + 'revokeUserGrantedPermission failed. Cause: ' + JSON.stringify(error)); }) } @@ -202,7 +205,7 @@ struct mediaDocumentItem { ) ); }).catch((error) => { - console.error('bundle.getBundleInfo failed. Cause: ' + JSON.stringify(error)); + console.error(TAG + 'bundle.getBundleInfo failed. Cause: ' + JSON.stringify(error)); this.mediaListItem = new MediaListObj('', '', '', permissionDescription); this.mediaDocListItem.push( new MeidaDocObj(Constants.RADIO_ALLOW_NAME, Constants.RADIO_ALLOW_INDEX, @@ -379,8 +382,7 @@ struct mediaDocumentItem { }) .width(Constants.FULL_WIDTH) .height(Constants.FULL_HEIGHT) - .backgroundColor($r('app.color.background_color')) } - .backgroundColor($r('app.color.background_color')).width(Constants.FULL_WIDTH) + .width(Constants.FULL_WIDTH) } } diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/pages/authority-management.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/authority-management.ets similarity index 89% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/pages/authority-management.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/authority-management.ets index a1ee72c45..318e24e6a 100644 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/pages/authority-management.ets +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/authority-management.ets @@ -24,6 +24,8 @@ import { permissionGroups, permissionPermissionGroup, permissionGroupIds } from import { makePy } from "../common/utils/utils.ets"; import Constants from '../common/utils/constant.ets'; +var TAG = 'PermissionManager_MainAbility:' + @Extend(Image) function customizeImage(width: number, height: number) { .objectFit(ImageFit.Contain) .width(width) @@ -50,7 +52,8 @@ interface groupPermission { 'group': string, 'permissions': string[], 'groupName': string, - 'icon': string + 'icon': string, + 'isShow':boolean }; let bundleInfosList: any[] = []; // Permission information array @@ -92,24 +95,22 @@ struct authorityManagementPage { uri: 'pages/authority-secondary', params: { routerData: this.allPermissionApplications, backTitle: item.groupName } }) - } else { - if (item.permissions.length > 1) { - router.push({ - uri: 'pages/authority-secondary', - params: { routerData: this.allPermissionApplications, backTitle: item.groupName } - }) - } else { + }else if((item.groupName === '电话' || item.groupName === '通讯录' || item.groupName === '信息' + || item.groupName === '通话记录' || item.groupName === '日历')){ + router.push({ + uri: 'pages/authority-secondary', + params: { routerData: this.allPermissionApplications, backTitle: item.groupName } + }) + }else { + var dataList = this.allPermissionApplications.filter((ele) => { - return ele.permission === item.permissions[0] + return ele.groupName === item.group }) - var tertiaryLabel = permissionGroups.filter((ele) => { - return ele.permissionName === item.permissions[0] - })[0].label + router.push({ - uri: 'pages/authority-tertiary', - params: { routerData: dataList, backTitle: tertiaryLabel } + uri: 'pages/authority-tertiary-groups', + params: { routerData: dataList, backTitle: item.groupName } }) - } } }) } @@ -168,7 +169,7 @@ struct authorityManagementPage { const bundleInfos = res; var count = bundleInfos.length; if (count <= 0) { - console.info('bundle.getAllBundleInfo result.length less than or equal to zero'); + console.info(TAG + 'bundle.getAllBundleInfo result.length less than or equal to zero'); return; } var infoIndex = 0; @@ -203,7 +204,7 @@ struct authorityManagementPage { }) }) .catch((error) => { - console.error('bundle.getAllBundleInfo failed. Cause: ' + JSON.stringify(error)); + console.error(TAG + 'bundle.getAllBundleInfo failed. Cause: ' + JSON.stringify(error)); }) } @@ -259,22 +260,60 @@ struct authorityManagementPage { */ getAllGroupPermission() { const this_ = this; + var temp1 = []; + temp1 = ["LOCATION","CAMERA","MICROPHONE","MEDIA","CALENDAR","SPORT","HEALTH"]; + groups.forEach((item) => { + if (temp1.indexOf(item.name) > -1) { + var gp: groupPermission = { + "group": item.name, + "permissions": item.permissions, + 'groupName': item.groupName, + 'icon': item.icon, + 'isShow': item.isShow + }; + this_.allGroupPermission.push(gp); + } + }) + let temp2 = []; + groups.forEach((item) => { + if (item.isShow && temp1.indexOf(item.name) === -1) { + var gp: groupPermission = { + "group": item.name, + "permissions": item.permissions, + 'groupName': item.groupName, + 'icon': item.icon, + 'isShow': item.isShow + }; + temp2.push(item.name); + this_.allGroupPermission.push(gp); + } + }) for (let i = 0; i < this_.allPermissionApplications.length; i++) { - if (this_.allGroups.length > 0) { - if (this_.allGroups.indexOf(this_.allPermissionApplications[i].groupName) == -1) { + if (this_.allGroups.indexOf(this_.allPermissionApplications[i].groupName) == -1 + && temp1.indexOf(this_.allPermissionApplications[i].groupName) == -1) { this_.allGroups.push(this_.allPermissionApplications[i].groupName); } - } else { - this_.allGroups.push(this_.allPermissionApplications[i].groupName); - } } + // Permission layout + var temp = this_.allGroups; + temp = temp.filter(function(item) { + return temp1.indexOf(item) == -1 && temp2.indexOf(item) == -1; + }); + if (temp.indexOf("OTHER") > -1) { + temp.splice(temp.indexOf("OTHER"),1); + temp.push("OTHER"); + }else { + temp.push("OTHER"); + } + this_.allGroups = temp; for (let i = 0; i < this_.allGroups.length; i++) { var permissions: string[] = permissionGroupPermissions[this_.allGroups[i]]; var gp: groupPermission = { "group": this_.allGroups[i], "permissions": permissions, 'groupName': '', - 'icon': '' + 'icon': '', + 'isShow': false }; this_.allGroupPermission.push(gp); } @@ -283,6 +322,7 @@ struct authorityManagementPage { if (ele.group === item.name) { ele.groupName = item.groupName; ele.icon = item.icon; + ele.isShow = item.isShow; } }); }) @@ -349,7 +389,7 @@ struct authorityManagementPage { } }) }).catch(error => { - console.error('Resmgr.getResourceManager failed. Cause: ' + JSON.stringify(error)); + console.error(TAG + 'Resmgr.getResourceManager failed. Cause: ' + JSON.stringify(error)); }) } @@ -368,7 +408,7 @@ struct authorityManagementPage { info['iconId'] = value; }) }).catch(error => { - console.error('Resmgr.getResourceManager failed. Cause: ' + JSON.stringify(error)); + console.error(TAG + 'Resmgr.getResourceManager failed. Cause: ' + JSON.stringify(error)); }) } @@ -380,7 +420,7 @@ struct authorityManagementPage { } build() { - GridContainer({ gutter: Constants.GUTTER }) { + GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) { Row() { Row() .useSizeType({ @@ -423,7 +463,6 @@ struct authorityManagementPage { }) } }.width(Constants.FULL_WIDTH) - .backgroundColor($r('app.color.background_color')) } }.tabBar($r('app.string.authority')) TabContent() { @@ -433,7 +472,6 @@ struct authorityManagementPage { }) }.tabBar($r('app.string.application')) } - .backgroundColor($r('app.color.background_color')) .barWidth(Constants.BAR_WIDTH) .barMode(BarMode.Fixed) }.height(Constants.FULL_HEIGHT) @@ -460,6 +498,9 @@ struct authorityManagementPage { .height(Constants.FULL_HEIGHT) } .height(Constants.FULL_HEIGHT) + .width(Constants.FULL_WIDTH) + .backgroundColor($r("sys.color.ohos_id_color_sub_background")) + .opacity(Constants.MANAGEMENT_TRANSPARENCY) } } } diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/pages/authority-secondary.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/authority-secondary.ets similarity index 95% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/pages/authority-secondary.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/authority-secondary.ets index be6785d47..61df8d7fd 100644 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/pages/authority-secondary.ets +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/authority-secondary.ets @@ -18,6 +18,8 @@ import { permissionGroups, groups } from "../common/model/permissionGroup.ets"; import router from '@system.router'; import Constants from '../common/utils/constant.ets'; +var TAG = 'PermissionManager_MainAbility:' + class CalendarObj { permissionName: string groupName: string @@ -39,7 +41,7 @@ struct appNamePage { private backTitle = router.getParams().backTitle; // return title name build() { - GridContainer({ gutter: Constants.GUTTER }) { + GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) { Row() { Row() .useSizeType({ @@ -80,6 +82,9 @@ struct appNamePage { .height(Constants.FULL_HEIGHT) } .height(Constants.FULL_HEIGHT) + .width(Constants.FULL_WIDTH) + .backgroundColor($r("sys.color.ohos_id_color_sub_background")) + .opacity(Constants.MANAGEMENT_TRANSPARENCY) } } } @@ -166,7 +171,6 @@ struct appNameItem { } .width(Constants.FULL_WIDTH) .height(Constants.FULL_HEIGHT) - .backgroundColor($r('app.color.background_color')) } } } diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/authority-tertiary-groups.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/authority-tertiary-groups.ets new file mode 100644 index 000000000..b2dfa6ab7 --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/authority-tertiary-groups.ets @@ -0,0 +1,382 @@ +/* + * Copyright (c) 2021-2022 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 { backBar } from "../common/components/backBar.ets"; +import { alphabetIndexerComponent } from "../common/components/alphabeticalIndex.ets"; +import { textInput } from "../common/components/search.ets"; +import router from '@system.router'; +import bundle from "@ohos.bundle"; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import { getAppLabel, getAppIcon, verifyAccessToken} from "../common/utils/utils"; +import { makePy } from "../common/utils/utils.ets"; +import { authorizeDialog } from "../common/components/dialog.ets"; +import Constants from '../common/utils/constant.ets'; + +var TAG = 'PermissionManager_MainAbility:' + +@Extend(Image) function customizeImage(width: number, height: number) { + .objectFit(ImageFit.Contain) + .width(width) + .height(height) +} + +let routerData = router.getParams().routerData; // Routing jump data +let backTitle = router.getParams().backTitle; // return title name +let nowGrantResult = Constants.PERMISSION_NUM; // Authorization results now +let nowRevokeResult = Constants.PERMISSION_NUM; // Now deauthorize results +let GrantResultFlag = []; // Authorization result Flag +let RevokeResultFlag = []; // Cancel authorization result Flag + +class ApplicationObj { + labelId: string + iconId: string + index: number + accessTokenId: string + permission: string + alphabeticalIndex: string + constructor( + labelId: string, + iconId: string, + index: number, + accessTokenId: string, + permission: string, + alphabeticalIndex: string) { + this.labelId = labelId + this.iconId = iconId + this.index = index + this.accessTokenId = accessTokenId + this.permission = permission + this.alphabeticalIndex = alphabeticalIndex + } +} // application information + +@Entry +@Component +struct locationInfoPage { + build() { + GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) { + Row() { + Row() + .useSizeType({ + xs: { span: Constants.LEFT_XS_SPAN, offset: Constants.LEFT_XS_OFFSET }, + sm: { span: Constants.LEFT_SM_SPAN, offset: Constants.LEFT_SM_OFFSET }, + md: { span: Constants.LEFT_MD_SPAN, offset: Constants.LEFT_MD_OFFSET }, + lg: { span: Constants.LEFT_LG_SPAN, offset: Constants.LEFT_LG_OFFSET } + }) + .height(Constants.FULL_HEIGHT) + Row() { + Column() { + Row() { + backBar({ title: JSON.stringify(backTitle) }) + } + Row() { + Column() { + applicationItem() + + }.width(Constants.FULL_WIDTH) + } + .layoutWeight(Constants.LAYOUT_WEIGHT) + } + } + .useSizeType({ + xs: { span: Constants.MIDDLE_XS_SPAN, offset: Constants.MIDDLE_XS_OFFSET }, + sm: { span: Constants.MIDDLE_SM_SPAN, offset: Constants.MIDDLE_SM_OFFSET }, + md: { span: Constants.MIDDLE_MD_SPAN, offset: Constants.MIDDLE_MD_OFFSET }, + lg: { span: Constants.MIDDLE_LG_SPAN, offset: Constants.MIDDLE_LG_OFFSET } + }) + .height(Constants.FULL_HEIGHT) + Row() + .useSizeType({ + xs: { span: Constants.RIGHT_XS_SPAN, offset: Constants.RIGHT_XS_OFFSET }, + sm: { span: Constants.RIGHT_SM_SPAN, offset: Constants.RIGHT_SM_OFFSET }, + md: { span: Constants.RIGHT_MD_SPAN, offset: Constants.RIGHT_MD_OFFSET }, + lg: { span: Constants.RIGHT_LG_SPAN, offset: Constants.RIGHT_LG_OFFSET } + }) + .height(Constants.FULL_HEIGHT) + } + .height(Constants.FULL_HEIGHT) + .width(Constants.FULL_WIDTH) + .backgroundColor($r("sys.color.ohos_id_color_sub_background")) + .opacity(Constants.MANAGEMENT_TRANSPARENCY) + } + } +} + +@Component +struct applicationItem { + @State permissionNum: number = Constants.PERMISSION_NUM; // permission num + @State toggleIsOn: object = {}; // toggle switch state array + @State applicationList: ApplicationObj[] = []; // application info array + @State oldApplicationItem: ApplicationObj[] = []; // Original application information array + @State searchResult: boolean = true; // search results + + authorizeDialogController: CustomDialogController = new CustomDialogController({ + builder: authorizeDialog({ }), + autoCancel: true, + alignment: DialogAlignment.Center + }); + + @Builder ListItemLayout(item, index) { + ListItem() { + Row() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + Image(item.iconId) + .customizeImage(Constants.AUTHORITY_IMAGE_WIDTH, Constants.AUTHORITY_IMAGE_HEIGHT) + .margin({ right: Constants.AUTHORITY_IMAGE_MARGIN_RIGHT }) + Text(item.labelId) + .fontSize(Constants.TEXT_MIDDLE_FONT_SIZE) + .fontColor($r('app.color.text_color')) + .flexGrow(Constants.FLEX_GROW) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn[item.index] }) + .selectedColor($r('app.color.toggle_color')) + .width(Constants.AUTHORITY_TOGGLE_WIDTH) + .height(Constants.AUTHORITY_TOGGLE_HEIGHT) + .onChange((isOn: boolean) => { + if (item.accessTokenId === '' || item.permission === '') { + return; + } + let _this = this; + if (isOn) { + let promises = routerData.map(it => new Promise((resolve, reject) => { + _this.grantUserGrantedPermission(item.accessTokenId, it.permission, item.index, resolve); + })); + Promise.all(promises).then(function(results) { + if(results.indexOf(-1) != -1) { + _this.authorizeDialogController.open(); + _this.toggleIsOn[item.index] = false; + setTimeout(()=> { + _this.authorizeDialogController.close(); + }, Constants.DELAY_TIME) + } else { + _this.toggleIsOn[item.index] = true; + } + let num = Constants.PERMISSION_NUM; + for(let key in _this.toggleIsOn){ + if(_this.toggleIsOn[key]){ + num++; + } + } + _this.permissionNum = num; + }); + } else { + let promises = routerData.map(it => new Promise((resolve, reject) => { + _this.revokeUserGrantedPermission(item.accessTokenId, it.permission, item.index, resolve); + })); + Promise.all(promises).then(function(results) { + if(results.indexOf(-1) != -1) { + _this.authorizeDialogController.open(); + _this.toggleIsOn[item.index] = true; + setTimeout(()=> { + _this.authorizeDialogController.close(); + }, Constants.DELAY_TIME) + } else { + _this.toggleIsOn[item.index] = false; + } + let num = Constants.PERMISSION_NUM; + for(let key in _this.toggleIsOn){ + if(_this.toggleIsOn[key]){ + num++; + } + } + _this.permissionNum = num; + }); + } + }) + } + .width(Constants.FULL_WIDTH) + .height(Constants.AUTHORITY_ROW_HEIGHT) + .constraintSize({ minHeight: Constants.AUTHORITY_CONSTRAINTSIZE_MINHEIGHT }) + } + if (!index) { + Row() { + Column() + .backgroundColor($r('app.color.text_decoration_color')) + .width(Constants.AUTHORITY_TEXT_DECORATION_WIDTH) + .height(Constants.TEXT_DECORATION_HEIGHT) + .margin({ left: Constants.AUTHORITY_TEXT_DECORATION_MARGIN_LEFT }) + } + } + }.onClick(() => { + }) + } + }.padding({ left: Constants.LISTITEM_PADDING_LEFT, right: Constants.AUTHORITY_LISTITEM_PADDING_RIGHT }) + } + + /** + * Grant permissions to the app + * @param {Number} accessTokenId + * @param {String} permission permission name + * @param {Number} index Array index to modify permission status + */ + grantUserGrantedPermission(accessTokenId, permission, index, resolve) { + abilityAccessCtrl.createAtManager().grantUserGrantedPermission( + accessTokenId, permission, Constants.PERMISSION_FLAG).then(result => { + // result: 0 Authorization succeeded; result: -1 Authorization failed + resolve(result); + }).catch(error => { + resolve(-1); + console.error(TAG + 'abilityAccessCtrl.createAtManager.grantUserGrantedPermission failed. Cause: ' + JSON.stringify(error)); + }) + } + + /** + * Deauthorize the app + * @param {Number} accessTokenId + * @param {String} permission permission name + * @param {Number} index Array index to modify permission status + */ + revokeUserGrantedPermission(accessTokenId, permission, index, resolve) { + abilityAccessCtrl.createAtManager().revokeUserGrantedPermission( + accessTokenId, permission, Constants.PERMISSION_FLAG).then(result => { + // result: 0 successfully cancel the authorization; result: -1 cancel the authorization failed + resolve(result); + }).catch(error => { + resolve(-1); + console.error(TAG + 'abilityAccessCtrl.createAtManager.revokeUserGrantedPermission failed. Cause: ' + JSON.stringify(error)); + }) + } + + /** + * Lifecycle function, executed when the page is initialized + */ + aboutToAppear() { + for (let i = 0; i < routerData[0].bundleNames.length; i++) { + // Get BundleInfo based on bundle name + bundle.getBundleInfo(routerData[0].bundleNames[i], Constants.PARMETER_BUNDLE_FLAG).then(res => { + Promise.all([getAppLabel(res.appInfo.labelId, res.name), + getAppIcon(res.appInfo.iconId, res.name), + verifyAccessToken(res.appInfo.accessTokenId, routerData[0].permission) + ]) + .then((values) => { + this.applicationList.push( + new ApplicationObj( + String(values[0]), + String(values[1]), + i, + res.appInfo.accessTokenId, + routerData[0].permission, + makePy(values[0])[0].slice(0, 1)) // Get the first letter in the returned initials array + ); + this.oldApplicationItem.push( + new ApplicationObj( + String(values[0]), + String(values[1]), + i, + res.appInfo.accessTokenId, + routerData[0].permission, + makePy(values[0])[0].slice(0, 1)) // Get the first letter in the returned initials array + ); + this.applicationList.sort((a,b) => a.index - b.index) + this.oldApplicationItem.sort((a,b) => a.index - b.index) + }); + // 0: have permission; -1: no permission + var boole = true; + this.permissionNum++; + for (let j = 0; j < routerData.length; j++) { + verifyAccessToken(res.appInfo.accessTokenId, routerData[j].permission).then((access) => { + if (Number(access) === Constants.PERMISSION_INDEX) { + if(boole){ + this.toggleIsOn[i] = true; + } + } else { + if(boole){ + this.permissionNum-- + } + boole = false; + this.toggleIsOn[i] = false; + } + }); + } + }).catch(() => { + this.applicationList.push( + new ApplicationObj('', '', 0, '', '', '') + ); + this.oldApplicationItem.push( + new ApplicationObj('', '', 0, '', '', '') + ); + }) + + } + } + + build() { + Column() { + Row() { + textInput({ + placeholder: $r('app.string.textInput_placeholder'), + applicationItem: $applicationList, + oldApplicationItem: $oldApplicationItem, + searchResult: $searchResult + }) + }.padding({ + left: Constants.AUTHORITY_TEXTINPUT_PADDING_LEFT, + right: Constants.AUTHORITY_TEXTINPUT_PADDING_RIGHT + }) + Row() { + Flex({ alignItems:ItemAlign.Start, justifyContent: FlexAlign.Start }) { + Column() { + Flex({ justifyContent: FlexAlign.Start }) { + Text(this.permissionNum + '个应用获取此权限') + .fontSize(Constants.TEXT_SMAL_FONT_SIZE) + .fontColor($r('app.color.secondary_font_color')) + .margin({ top: Constants.AUTHORITY_TEXT_MARGIN_TOP, left: Constants.AUTHORITY_TEXT_MARGIN_LEFT }) + } + Scroll() { + Row() { + Column() { + if (!this.applicationList.length) { + if (this.searchResult) { + Row() { + }.margin({ top: Constants.AUTHORITY_ROW_MARGIN_TOP }) + } else { + Row() { + Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { + Image($r('app.media.searchnoresult')) + .customizeImage(Constants.SEARCHNORESULT_IMAGE_WIDTH, Constants.SEARCHNORESULT_IMAGE_HEIGHT) + } + }.margin({ top: Constants.AUTHORITY_ROW_MARGIN_TOP }) + } + } else { + Row() { + List() { + ForEach(this.applicationList.slice(Constants.SLICE_START, this.applicationList.length - 1), + (item) => { + this.ListItemLayout(item, Constants.SLICE_START_INDEX) + }, item => item.toString()) + ForEach(this.applicationList.slice(Constants.SLICE_END), (item, index) => { + this.ListItemLayout(item, Constants.SLICE_END_INDEX) + }, item => item.toString()) + } + .backgroundColor($r('app.color.default_background_color')) + .borderRadius(Constants.BORDER_RADIUS) + .padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM }) + }.margin({ top: Constants.AUTHORITY_ROW_MARGIN_TOP }) + } + }.width(Constants.FULL_WIDTH) + .height(Constants.AUTHORITY_COLUMN_HEIGHT) + } + } + }.padding({ left: Constants.AUTHORITY_LISTITEM_PADDING_LEFT }) + Column() { + alphabetIndexerComponent({ applicationItem: $applicationList, oldApplicationItem: $oldApplicationItem }) + }.width(Constants.AUTHORITY_ALPHABETINDEX_WIDTH) + .padding({ top: Constants.AUTHORITY_ALPHABETINDEX_PADDING_TOP }) + } + } + } + } +} diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/pages/authority-tertiary.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/authority-tertiary.ets similarity index 97% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/pages/authority-tertiary.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/authority-tertiary.ets index f0ef99c12..2f18b7b92 100644 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/pages/authority-tertiary.ets +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/authority-tertiary.ets @@ -24,6 +24,8 @@ import { makePy } from "../common/utils/utils.ets"; import { authorizeDialog } from "../common/components/dialog.ets"; import Constants from '../common/utils/constant.ets'; +var TAG = 'PermissionManager_MainAbility:' + @Extend(Image) function customizeImage(width: number, height: number) { .objectFit(ImageFit.Contain) .width(width) @@ -59,7 +61,7 @@ class ApplicationObj { @Component struct locationInfoPage { build() { - GridContainer({ gutter: Constants.GUTTER }) { + GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) { Row() { Row() .useSizeType({ @@ -100,6 +102,9 @@ struct locationInfoPage { .height(Constants.FULL_HEIGHT) } .height(Constants.FULL_HEIGHT) + .width(Constants.FULL_WIDTH) + .backgroundColor($r("sys.color.ohos_id_color_sub_background")) + .opacity(Constants.MANAGEMENT_TRANSPARENCY) } } } @@ -192,7 +197,7 @@ struct applicationItem { } this.permissionNum = num; }).catch(error => { - console.error('abilityAccessCtrl.createAtManager.grantUserGrantedPermission failed. Cause: ' + JSON.stringify(error)); + console.error(TAG + 'abilityAccessCtrl.createAtManager.grantUserGrantedPermission failed. Cause: ' + JSON.stringify(error)); }) } @@ -288,7 +293,6 @@ struct applicationItem { left: Constants.AUTHORITY_TEXTINPUT_PADDING_LEFT, right: Constants.AUTHORITY_TEXTINPUT_PADDING_RIGHT }) - .backgroundColor($r('app.color.background_color')) Row() { Flex({ alignItems:ItemAlign.Start, justifyContent: FlexAlign.Start }) { Column() { @@ -331,7 +335,6 @@ struct applicationItem { } }.width(Constants.FULL_WIDTH) .height(Constants.AUTHORITY_COLUMN_HEIGHT) - .backgroundColor($r('app.color.background_color')) } } }.padding({ left: Constants.AUTHORITY_LISTITEM_PADDING_LEFT }) @@ -341,7 +344,6 @@ struct applicationItem { .padding({ top: Constants.AUTHORITY_ALPHABETINDEX_PADDING_TOP }) } } - .backgroundColor($r('app.color.background_color')) } } } diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/pages/other-permissions.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/other-permissions.ets similarity index 95% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/pages/other-permissions.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/other-permissions.ets index 8f29466ad..fa6ff1e8a 100644 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/pages/other-permissions.ets +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/other-permissions.ets @@ -18,6 +18,8 @@ import router from '@system.router'; import Constants from '../common/utils/constant.ets'; import { otherPermissionsLabel } from '../common/model/permissionGroup.ets' +var TAG = 'PermissionManager_MainAbility:' + let routerData = router.getParams().routerData; // Routing jump data let backTitle = router.getParams().backTitle; // return title name let status = router.getParams().status; // Status: Allowed, Forbidden @@ -34,7 +36,7 @@ for (let i = 0; i < permissions.length; i++) { @Component struct appNamePage { build() { - GridContainer({ gutter: Constants.GUTTER }) { + GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) { Row() { Row() .useSizeType({ @@ -75,6 +77,9 @@ struct appNamePage { .height(Constants.FULL_HEIGHT) } .height(Constants.FULL_HEIGHT) + .width(Constants.FULL_WIDTH) + .backgroundColor($r("sys.color.ohos_id_color_sub_background")) + .opacity(Constants.MANAGEMENT_TRANSPARENCY) } } } @@ -142,7 +147,6 @@ struct appNameItem { } .width(Constants.FULL_WIDTH) .height(Constants.FULL_HEIGHT) - .backgroundColor($r('app.color.background_color')) } } } diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/resources/ar/properties/string.json b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/resources/ar/properties/string.json similarity index 100% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/resources/ar/properties/string.json rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/resources/ar/properties/string.json diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/resources/dark/properties/string.json b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/resources/dark/properties/string.json similarity index 100% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/resources/dark/properties/string.json rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/resources/dark/properties/string.json diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/resources/default/media/icon_actived.png b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/resources/default/media/icon_actived.png similarity index 100% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/resources/default/media/icon_actived.png rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/resources/default/media/icon_actived.png diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/resources/default/media/icon_normal.png b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/resources/default/media/icon_normal.png similarity index 100% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/resources/default/media/icon_normal.png rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/resources/default/media/icon_normal.png diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/resources/default/properties/string.json b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/resources/default/properties/string.json similarity index 100% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/resources/default/properties/string.json rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/resources/default/properties/string.json diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/resources/en/properties/string.json b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/resources/en/properties/string.json similarity index 100% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/resources/en/properties/string.json rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/resources/en/properties/string.json diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/resources/light/properties/string.json b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/resources/light/properties/string.json similarity index 100% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/resources/light/properties/string.json rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/resources/light/properties/string.json diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/resources/zh/properties/string.json b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/resources/zh/properties/string.json similarity index 100% rename from frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/resources/zh/properties/string.json rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/resources/zh/properties/string.json diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/java/com/ohos/permissionmanager/MainAbility.java b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/java/com/ohos/permissionmanager/MainAbility.java deleted file mode 100644 index a9467b0bf..000000000 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/java/com/ohos/permissionmanager/MainAbility.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021-2022 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. - */ - -package com.ohos.permissionmanager; - -import ohos.ace.ability.AceAbility; -import ohos.aafwk.content.Intent; - -public class MainAbility extends AceAbility { - @Override - public void onStart(Intent intent) { - setInstanceName("main_ability"); - super.onStart(intent); - } - - @Override - public void onStop() { - super.onStop(); - } -} diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/java/com/ohos/permissionmanager/MyApplication.java b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/java/com/ohos/permissionmanager/MyApplication.java deleted file mode 100644 index 6c8f0f649..000000000 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/java/com/ohos/permissionmanager/MyApplication.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2021-2022 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. - */ - -package com.ohos.permissionmanager; - -import ohos.aafwk.ability.AbilityPackage; - -public class MyApplication extends AbilityPackage { - @Override - public void onInitialize() { - super.onInitialize(); - } -} diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/element/string.json b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/element/string.json index db1d293a5..f505eefa0 100644 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/element/string.json +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/element/string.json @@ -5,7 +5,7 @@ "value": "permissionmanager_MainAbility" }, { - "name": "mainability_description", + "name": "description_mainability", "value": "eTS_Empty Ability" }, { @@ -81,7 +81,7 @@ "value": "系统定位服务开关开启时,已允许19个应用获取此设备的位置。" }, { - "name": "grantability_description", + "name": "description_grantability", "value": "eTS_Empty Ability" }, { diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/app.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/app.ets deleted file mode 100644 index 03748140d..000000000 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/app.ets +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2021-2022 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') - }, - onShow() { - console.info('Application onShow') - }, - onDestroy() { - console.info('Application onDestroy') - }, -} diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/i18n/en-US.json b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/i18n/en-US.json deleted file mode 100644 index 55561b837..000000000 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/i18n/zh-CN.json b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/i18n/zh-CN.json deleted file mode 100644 index cce1af067..000000000 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/pages/index/index.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/pages/index/index.ets deleted file mode 100644 index 61dc37aa5..000000000 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/pages/index/index.ets +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2021-2022 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 {Core, ExpectExtend, InstrumentLog} from "deccjsunit/index" -import testsuite from "../../../test/List.test.ets" -import featureAbility from "@ohos.ability.featureAbility" - -@Entry -@Component -struct MyComponent { - aboutToAppear() { - console.info("start run testcase!!!!") - featureAbility.getWant() - .then((Want) => { - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - const instrumentLog = new InstrumentLog({ - 'id': 'report', 'unity': 'true' - }) - core.addService('expect', expectExtend) - core.addService('report', instrumentLog) - core.init() - core.subscribeEvent('spec', instrumentLog) - core.subscribeEvent('suite', instrumentLog) - core.subscribeEvent('task', instrumentLog) - const configService = core.getDefaultService('config') - configService.setConfig(Want.parameters) - testsuite() - core.execute() - console.info('Operation successful. Data: ' + JSON.stringify(Want)); - }) - .catch((error) => { - console.error('Operation failed. Cause: ' + JSON.stringify(error)); - }) - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text('Hello World') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/test/ExampleJsunit.test.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/test/ExampleJsunit.test.ets deleted file mode 100644 index c76c23ebb..000000000 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/test/ExampleJsunit.test.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2021-2022 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" -import app from '@system.app' - -export default function exampleJsunit() { - describe('appInfoTest', function () { - it('app_info_test_001', 0, function () { - var info = app.getInfo() - expect("1.0").assertEqual('1.0') - expect(info.versionCode).assertEqual('3') - }) - }) -} diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/test/List.test.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 23005224d..000000000 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2021-2022 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 exampleJsunit from "../test/ExampleJsunit.test.ets" - -export default function testsuite() { - exampleJsunit() -} diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/java/com/ohos/permissionmanager/ExampleOhosTest.java b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/java/com/ohos/permissionmanager/ExampleOhosTest.java deleted file mode 100644 index e0c56a5cd..000000000 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/java/com/ohos/permissionmanager/ExampleOhosTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2021-2022 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. - */ - -package com.ohos.permissionmanager; - -import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; - -public class ExampleOhosTest { - @Test - public void testBundleName() { - final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName(); - assertEquals("com.ohos.permissionmanager", actualBundleName); - } -} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/resources/base/element/string.json b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index 0ad161e66..000000000 --- a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "PermissionManager" - }, - { - "name": "mainability_description", - "value": "hap sample empty page" - } - ] -} diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/resources/base/media/icon.png b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz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