From 48e000828b16acc9276287ceb4b1d0a3f5c26d1f 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 | 27 ++++--- .../src/main/ets/GrantAbility}/app.ets | 0 .../common/components/dialog.ets | 71 ++++++++++-------- .../common/model/bundle.ets | 0 .../common/model/permissionGroup.ets | 0 .../common/utils/constant.ets | 0 .../common/utils/utils.ets | 0 .../pages/dialogPlus.ets | 52 +++++-------- .../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 | 0 .../common/utils/constant.ets | 30 ++++---- .../common/utils/utils.ets | 0 .../pages/application-secondary.ets | 10 +-- .../pages/application-tertiary.ets | 12 +-- .../pages/authority-management.ets | 7 +- .../pages/authority-secondary.ets | 6 +- .../pages/authority-tertiary.ets | 8 +- .../pages/other-permissions.ets | 6 +- .../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 57 files changed, 188 insertions(+), 612 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 (84%) 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 (58%) 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 (100%) 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 (98%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/pages/application-tertiary.ets (97%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/pages/authority-management.ets (98%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/pages/authority-secondary.ets (96%) rename frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/{default => MainAbility}/pages/authority-tertiary.ets (98%) 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 z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%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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 } @@ -162,6 +142,39 @@ export struct privacyDialog { }) } + 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("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("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 @@ -180,16 +193,8 @@ export struct privacyDialog { 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 + this.result = new Array(this.reqPerms.length).fill(-1); + this.getgrantGroups(); this.getApplicationName(want.parameters['ohos.aafwk.param.callerUid']) }) } 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 58% 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..e3d020a26 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 @@ -28,44 +28,32 @@ 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("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("GrantAbility grant permission success:" + permission) + } else { + console.log("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("GrantAbility revoke permission result:" + result + "permission" + permission); }) this.count ++ } 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 100% 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 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..4727e4470 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; 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 98% 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..2bc4508b8 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 @@ -177,7 +177,7 @@ struct appNamePlusPage { build() { Column(){ - GridContainer({ gutter: Constants.GUTTER }) { + GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) { Row({}) { Row() .useSizeType({ @@ -187,7 +187,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 +284,6 @@ struct appNamePlusPage { } .width(Constants.FULL_WIDTH) .height(Constants.FULL_HEIGHT) - .backgroundColor($r('app.color.background_color')) } .layoutWeight(Constants.LAYOUT_WEIGHT) } @@ -305,10 +303,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 97% 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..8ebddabed 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 @@ -73,7 +73,7 @@ class MediaListObj { struct mediaDocumentPage { build() { Column() { - GridContainer({ gutter: Constants.GUTTER }) { + GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) { Row() { Row() .useSizeType({ @@ -83,7 +83,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 +115,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) + } } } @@ -379,8 +380,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 98% 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..e1da67e6d 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 @@ -380,7 +380,7 @@ struct authorityManagementPage { } build() { - GridContainer({ gutter: Constants.GUTTER }) { + GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) { Row() { Row() .useSizeType({ @@ -423,7 +423,6 @@ struct authorityManagementPage { }) } }.width(Constants.FULL_WIDTH) - .backgroundColor($r('app.color.background_color')) } }.tabBar($r('app.string.authority')) TabContent() { @@ -433,7 +432,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 +458,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 96% 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..b4c0b4771 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 @@ -39,7 +39,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 +80,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 +169,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/pages/authority-tertiary.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/MainAbility/pages/authority-tertiary.ets similarity index 98% 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..d446a722b 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 @@ -59,7 +59,7 @@ class ApplicationObj { @Component struct locationInfoPage { build() { - GridContainer({ gutter: Constants.GUTTER }) { + GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) { Row() { Row() .useSizeType({ @@ -100,6 +100,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) } } } @@ -288,7 +291,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 +333,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 +342,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..fb9e791a3 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 @@ -34,7 +34,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 +75,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 +145,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_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4%CzIT zAm3CUtWSr1t4?h1kk#NBi{U|pJslvME{q|_eS^3En>SOqSxyuN1x;Is@8~m?*>}** znrRFArP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