diff --git a/permissionmanager/src/main/ets/GlobalExtAbility/GlobalExtAbility.ts b/permissionmanager/src/main/ets/GlobalExtAbility/GlobalExtAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..d933a492f3824e1f33dc6dad49b8c285cbc6e04e --- /dev/null +++ b/permissionmanager/src/main/ets/GlobalExtAbility/GlobalExtAbility.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) 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 extension from '@ohos.application.ServiceExtensionAbility'; +import window from '@ohos.window'; +import display from '@ohos.display'; + +var TAG = "PermissionManager_Log:"; +const BG_COLOR = '#00000000' + +export default class GlobalExtensionAbility extends extension { + /** + * Lifecycle function, called back when a service extension is started for initialization. + */ + onCreate(want) { + console.info(TAG + "ServiceExtensionAbility onCreate, ability name is " + want.abilityName); + + globalThis.globalContext = this.context; + globalThis.globalState = want.parameters['ohos.sensitive.resource'] + console.info(TAG + "want: " + JSON.stringify(want)) + + display.getDefaultDisplay().then(dis => { + let navigationBarRect = { + left: 0, + top: 0, + width: dis.width, + height: dis.height + } + this.createWindow("globalDialog", window.WindowType.TYPE_KEYGUARD, navigationBarRect) + }) + } + + /** + * Lifecycle function, called back when a service extension is started or recall. + */ + onRequest(want, startId) { + console.info(TAG + "ServiceExtensionAbility onRequest. start id is " + startId); + } + + /** + * Lifecycle function, called back before a service extension is destroyed. + */ + onDestroy() { + console.info(TAG + "ServiceExtensionAbility onDestroy."); + globalThis.globalWin.destroy() + } + + private async createWindow(name: string, windowType: number, rect) { + console.info(TAG + "create window") + try { + const win = await window.create(globalThis.globalContext, name, windowType) + globalThis.globalWin = win + await win.moveTo(rect.left, rect.top) + await win.resetSize(rect.width, rect.height) + await win.loadContent('pages/globalSwitch') + await win.setBackgroundColor(BG_COLOR) + await win.show() + } catch { + console.info(TAG + "window create failed!") + } + } +}; \ No newline at end of file diff --git a/permissionmanager/src/main/ets/common/components/dialog.ets b/permissionmanager/src/main/ets/common/components/dialog.ets index 8e86dd6ab1ad56d5e7c698305ad2f8ea837d2cd5..df940fd91396887c97647e3af64c8be4d94d3c55 100644 --- a/permissionmanager/src/main/ets/common/components/dialog.ets +++ b/permissionmanager/src/main/ets/common/components/dialog.ets @@ -14,6 +14,15 @@ */ import Constants from '../utils/constant'; +import audio from '@ohos.multimedia.audio' + +@Extend(Button) function customizeButton() { + .backgroundColor($r('app.color.default_background_color')) + .fontColor($r('app.color.button_color')) + .fontWeight(FontWeight.Medium) + .height(Constants.BUTTON_HEIGHT) + .width(Constants.BUTTON_WIDTH) +} @CustomDialog export struct authorizeDialog { @@ -38,3 +47,63 @@ export struct authorizeDialog { .width(Constants.DIALOG_WIDTH) } } + +@CustomDialog +export struct globalDialog { + @Link globalIsOn: boolean + controller: CustomDialogController; + + build() { + Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.End }) { + Column() { + Text(globalThis.currentPermissionGroup == 'CAMERA' ? $r('app.string.close_camera') : $r('app.string.close_microphone')) + .fontSize(Constants.TEXT_BIG_FONT_SIZE) + .fontColor($r('app.color.label_color')) + .lineHeight(Constants.TEXT_BIG_LINE_HEIGHT) + .height(Constants.ROW_HEIGHT) + .width(Constants.FULL_WIDTH) + .padding({ left: Constants.DIALOG_DESP_MARGIN_LEFT, right: Constants.DIALOG_DESP_MARGIN_RIGHT }) + Text(globalThis.currentPermissionGroup == 'CAMERA' ? $r('app.string.close_camera_desc') : $r('app.string.close_microphone_desc')) + .fontSize(Constants.TEXT_MIDDLE_FONT_SIZE) + .fontColor($r('app.color.label_color')) + .lineHeight(Constants.TEXT_LINE_HEIGHT) + .width(Constants.FULL_WIDTH) + .padding({ left: Constants.DIALOG_DESP_MARGIN_LEFT, right: Constants.DIALOG_DESP_MARGIN_RIGHT }) + .margin({ bottom: Constants.DIALOG_DESP_MARGIN_BOTTOM }) + Row() { + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Start }) { + Button($r('app.string.cancel')) + .fontSize(Constants.BUTTON_FONT_SIZE) + .onClick(() => { + this.cancel() + }).customizeButton().margin({ left: Constants.BUTTON_MARGIN_LEFT }) + Text('|').fontSize(Constants.BUTTON_DIVIDER_FONT_SIZE).fontColor($r('app.color.divider_color')) + .margin({ top: Constants.BUTTON_MARGIN_TOP }) + Button($r('app.string.close')) + .fontSize(Constants.BUTTON_FONT_SIZE) + .onClick(() => { + this.confirm() + }).customizeButton().margin({ right: Constants.BUTTON_MARGIN_RIGHT }) + }.height(Constants.ROW_HEIGHT) + } + } + .backgroundColor($r('app.color.default_background_color')) + .borderRadius(Constants.DIALOG_PRIVACY_BORDER_RADIUS) + .width(Constants.DIALOG_PRIVACY_WIDTH) + .margin({ bottom: Constants.DIALOG_MARGIN_BOTTOM }) + }.width(Constants.FULL_WIDTH) + .height(Constants.FULL_HEIGHT) + } + + confirm() { + var audioManager = audio.getAudioManager(); + audioManager.setMicrophoneMute(true).then(() => { + this.globalIsOn = false + this.controller.close() + }) + } + + cancel() { + this.controller.close() + } +} \ No newline at end of file diff --git a/permissionmanager/src/main/ets/common/model/permissionGroup.ets b/permissionmanager/src/main/ets/common/model/permissionGroup.ets index 5a1f71903ad612946b3dba37db4a4d0c2c922ddb..9e328969b4b8365c3e96f5f0c6cde8a5d838c31b 100644 --- a/permissionmanager/src/main/ets/common/model/permissionGroup.ets +++ b/permissionmanager/src/main/ets/common/model/permissionGroup.ets @@ -565,4 +565,8 @@ export const showSubpermissionsGrop: string[] = [ export const polymorphismGroup: string[] = [ "LOCATION" +] + +export const globalGroup: string[] = [ + "MICROPHONE" ] \ No newline at end of file diff --git a/permissionmanager/src/main/ets/common/utils/constant.ets b/permissionmanager/src/main/ets/common/utils/constant.ets index f40dab507e3d7ce094627167ff8768ae7917a63a..30751737a23d2464e6a705d9af0eb8c1e9133042 100644 --- a/permissionmanager/src/main/ets/common/utils/constant.ets +++ b/permissionmanager/src/main/ets/common/utils/constant.ets @@ -95,10 +95,12 @@ export default class Constants { static LAYOUT_WEIGHT = 1; static FLEX_GROW = 1; static TEXT_DECORATION_HEIGHT = 1; + static TEXT_BIG_FONT_SIZE = 20; static TEXT_MIDDLE_FONT_SIZE = 16; static TEXT_SMAL_FONT_SIZE = 14; static TEXT_SMALLER_FONT_SIZE = 12; static TEXT_LINE_HEIGHT = 22; + static TEXT_BIG_LINE_HEIGHT = 28; static TEXT_SMALL_LINE_HEIGHT = 19; static CONSTRAINTSIZE_MINHEIGHT = 48; static LISTITEM_ROW_HEIGHT = 48; @@ -128,6 +130,9 @@ export default class Constants { static TAB_DECORATION_POSITION_Y = 46; static DEFAULT_PADDING_START = 12; static DEFAULT_PADDING_END = 12; + static DEFAULT_SLIDER_WIDTH = 36; + static DEFAULT_SLIDER_HEIGHT = 20; + static OFFSET = 100; // application-secondary, authority-secondary static FLEX_MARGIN_TOP = 8; @@ -369,6 +374,10 @@ export default class Constants { static DYNAMIC_OPER = 1 static INVALID_OPER = 2 + //global dialog + static ROW_HEIGHT = 56 + static DIALOG_MARGIN_BOTTOM = 12 + // static INITIAL_INDEX = 10 static ACCESS_TOKEN = 'ohos.security.accesstoken.tokencallback' diff --git a/permissionmanager/src/main/ets/pages/authority-management.ets b/permissionmanager/src/main/ets/pages/authority-management.ets index 5acb5636766edf6b4fd96a51b65e21b4a0e18e12..c438a6467f5a34feb6ad0b4844c2b68439ca1b33 100644 --- a/permissionmanager/src/main/ets/pages/authority-management.ets +++ b/permissionmanager/src/main/ets/pages/authority-management.ets @@ -19,7 +19,8 @@ import { textInput } from "../common/components/search"; import router from '@system.router'; import bundle from "@ohos.bundle"; import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; -import { groups, userGrantPermissions, permissionGroupPermissions, noNeedDisplayApp } from "../common/model/permissionGroup"; +import audio from '@ohos.multimedia.audio' +import { groups, userGrantPermissions, permissionGroupPermissions, noNeedDisplayApp, globalGroup } from "../common/model/permissionGroup"; import { permissionGroups, permissionGroupIds } from "../common/model/permissionGroup"; import { makePy } from "../common/utils/utils"; import Constants from '../common/utils/constant'; @@ -105,10 +106,20 @@ struct authorityManagementPage { }) globalThis.currentPermissionGroup = item.group - router.push({ - uri: 'pages/authority-tertiary-groups', - params: { routerData: dataList, backTitle: item.groupName } - }) + if(globalGroup.indexOf(item.group) == -1) { + router.push({ + uri: 'pages/authority-tertiary-groups', + params: { routerData: dataList, backTitle: item.groupName } + }) + }else { + var audioManager = audio.getAudioManager(); + audioManager.isMicrophoneMute().then(value => { + router.push({ + uri: 'pages/authority-tertiary-groups', + params: { routerData: dataList, backTitle: item.groupName, globalIsOn: !value } + }) + }) + } } }) } @@ -301,9 +312,14 @@ struct authorityManagementPage { if (reqPermissionsLen > 0) { for (let j = 0; j < info.reqPermissions.length; j++) { var permission = info.reqPermissions[j]; - var flag = await acManager.getPermissionFlags(info.appInfo.accessTokenId, permission) - if(flag == Constants.PRE_AUTHORIZATION_NOT_MODIFIED) { - continue + try { + var flag = await acManager.getPermissionFlags(info.appInfo.accessTokenId, permission) + if(flag == Constants.PRE_AUTHORIZATION_NOT_MODIFIED) { + continue + } + } + catch(err) { + console.log(TAG + 'getPermissionFlags error: ' + JSON.stringify(err)) } if (userGrantPermissions.indexOf(permission) != -1) { reqUserPermissions.push(permission); @@ -379,6 +395,10 @@ struct authorityManagementPage { aboutToAppear() { console.log(TAG + 'on aboutToAppear, version 1.01'); this.getAllBundlePermissions(); + var acManager = abilityAccessCtrl.createAtManager() + bundle.getApplicationInfo(Constants.BUNDLE_NAME, 0).then(data => { + acManager.grantUserGrantedPermission(data.accessTokenId, "ohos.permission.MICROPHONE", 2) + }) globalThis.context.resourceManager.getString($r("app.string.textInput_placeholder").id).then(val => { textInput_placeholder = val }) diff --git a/permissionmanager/src/main/ets/pages/authority-tertiary-groups.ets b/permissionmanager/src/main/ets/pages/authority-tertiary-groups.ets index c2e1628f334a9c7ce6fff3516bac56e47cba5aef..f38ad6568ff06fa3cbfbf1d96f8fde337bfbcbd3 100644 --- a/permissionmanager/src/main/ets/pages/authority-tertiary-groups.ets +++ b/permissionmanager/src/main/ets/pages/authority-tertiary-groups.ets @@ -19,11 +19,12 @@ import { textInput } from "../common/components/search"; import router from '@system.router'; import bundle from "@ohos.bundle"; import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; +import audio from '@ohos.multimedia.audio' import { getAppLabel, getAppIcon, verifyAccessToken} from "../common/utils/utils"; import { makePy } from "../common/utils/utils"; -import { authorizeDialog } from "../common/components/dialog"; +import { authorizeDialog, globalDialog } from "../common/components/dialog"; import Constants from '../common/utils/constant'; -import { polymorphismGroup } from "../common/model/permissionGroup"; +import { polymorphismGroup, globalGroup } from "../common/model/permissionGroup"; var TAG = 'PermissionManager_MainAbility:' @@ -35,6 +36,7 @@ var TAG = 'PermissionManager_MainAbility:' let routerData: any = router.getParams().routerData; // Routing jump data let backTitle = router.getParams().backTitle; // return title name +let globalIsOn: any = router.getParams().globalIsOn; // return title name class ApplicationObj { labelId: string @@ -159,6 +161,14 @@ struct applicationItem { @State placeholder: string = '' @State bundleNameGroup: Array = [] @Link polymorphismIsOn: any + @State globalIsOn: boolean = true + + privacyDialogController: CustomDialogController = new CustomDialogController({ + builder: globalDialog({ globalIsOn: $globalIsOn }), + autoCancel: false, + alignment: DialogAlignment.Center, + customStyle: true + }) authorizeDialogController: CustomDialogController = new CustomDialogController({ builder: authorizeDialog({ }), @@ -404,6 +414,9 @@ struct applicationItem { console.log(TAG + bundleNames[i] + "getBundleInfo failed, cause: " + JSON.stringify(error)); }) } + if(globalGroup.indexOf(globalThis.currentPermissionGroup) !== -1) { + this.globalIsOn = globalIsOn + } } build() { @@ -422,15 +435,51 @@ struct applicationItem { Row() { Flex({ alignItems:ItemAlign.Start, justifyContent: FlexAlign.Start }) { Column() { + if(globalGroup.indexOf(globalThis.currentPermissionGroup) !== -1) { + Row() { + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { + Text(globalThis.currentPermissionGroup == "CAMERA" ? $r('app.string.camera') : $r('app.string.microphone')) + .fontSize(Constants.TEXT_MIDDLE_FONT_SIZE).fontColor($r('app.color.label_color')) + Row() { + Toggle({ type: ToggleType.Switch, isOn: this.globalIsOn }) + .selectedColor($r('app.color.button_color')) + .switchPointColor($r('app.color.selected_Color')) + .padding({ right: 0 }) + .onChange((isOn: boolean) => { + if(isOn) { + var audioManager = audio.getAudioManager(); + audioManager.setMicrophoneMute(false).then(() => { + this.globalIsOn = isOn + }) + } + }) + Row().onClick(() => { this.privacyDialogController.open() }) + .width(Constants.DEFAULT_SLIDER_WIDTH).height(Constants.DEFAULT_SLIDER_HEIGHT) + .position({ x: this.globalIsOn ? 0 : Constants.OFFSET, y: 0 }) + }.clip(true) + }.height(Constants.LISTITEM_ROW_HEIGHT) + .padding({ left: Constants.DEFAULT_PADDING_START, right: Constants.DEFAULT_PADDING_END }) + }.padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM }) + .backgroundColor($r('app.color.default_background_color')) + .borderRadius(Constants.BORDER_RADIUS) + .margin({ top: Constants.TERTIARY_ROW_MARGIN_TOP }) + } Flex({ justifyContent: FlexAlign.Start }) { - Text(String(this.getGrantApplicationNumber())) - .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 }) - Text($r('app.string.number_of_authorized_applications')) - .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 }) + if(this.globalIsOn) { + Text(String(this.getGrantApplicationNumber())) + .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 }) + Text($r('app.string.number_of_authorized_applications')) + .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 }) + }else { + Text(globalThis.currentPermissionGroup == "CAMERA" ? $r('app.string.camera_is_off') : $r('app.string.microphone_is_off')) + .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() { diff --git a/permissionmanager/src/main/ets/pages/globalSwitch.ets b/permissionmanager/src/main/ets/pages/globalSwitch.ets new file mode 100644 index 0000000000000000000000000000000000000000..b0c85d5cf0756e35bf5cb9e217c94b7b8bc52f85 --- /dev/null +++ b/permissionmanager/src/main/ets/pages/globalSwitch.ets @@ -0,0 +1,117 @@ +/* + * Copyright (c) 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 Constants from '../common/utils/constant'; +import audio from '@ohos.multimedia.audio' +import bundle from '@ohos.bundle'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; + +const MICROPHONE = 'microphone' +const CAMERA = 'camera' + +@Extend(Button) function customizeButton() { + .backgroundColor($r('app.color.default_background_color')) + .fontColor($r('app.color.button_color')) + .fontWeight(FontWeight.Medium) + .height(Constants.BUTTON_HEIGHT) + .width(Constants.BUTTON_WIDTH) +} + +@Entry +@Component +export struct globalSwitch { + privacyDialogController: CustomDialogController = new CustomDialogController({ + builder: globalDialog(), + autoCancel: false, + alignment: DialogAlignment.Center, + customStyle: true + }) + + build() {} + + aboutToAppear() { + this.privacyDialogController.open() + } +} + +@CustomDialog +struct globalDialog { + controller: CustomDialogController + + build() { + Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.End }) { + Column() { + Text(globalThis.globalState == MICROPHONE ? $r('app.string.global_title_microphone') : + globalThis.globalState == CAMERA ? $r('app.string.global_title_camera') : + $r('app.string.global_title_camera_and_microphone')) + .fontSize(Constants.TEXT_BIG_FONT_SIZE) + .fontColor($r('app.color.label_color')) + .lineHeight(Constants.TEXT_BIG_LINE_HEIGHT) + .height(Constants.ROW_HEIGHT) + .width(Constants.FULL_WIDTH) + .padding({ left: Constants.DIALOG_DESP_MARGIN_LEFT, right: Constants.DIALOG_DESP_MARGIN_RIGHT }) + Text(globalThis.globalState == MICROPHONE ? $r('app.string.global_desc_microphone') : + globalThis.globalState == CAMERA ? $r('app.string.global_desc_camera') : + $r('app.string.global_desc_camera_and_microphone')) + .fontSize(Constants.TEXT_MIDDLE_FONT_SIZE) + .fontColor($r('app.color.label_color')) + .lineHeight(Constants.TEXT_LINE_HEIGHT) + .width(Constants.FULL_WIDTH) + .padding({ left: Constants.DIALOG_DESP_MARGIN_LEFT, right: Constants.DIALOG_DESP_MARGIN_RIGHT }) + .margin({ bottom: Constants.DIALOG_DESP_MARGIN_BOTTOM }) + Row() { + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Start }) { + Button($r('app.string.cancel')) + .fontSize(Constants.BUTTON_FONT_SIZE) + .onClick(() => { + this.cancel() + }).customizeButton().margin({ left: Constants.BUTTON_MARGIN_LEFT }) + Text('|').fontSize(Constants.BUTTON_DIVIDER_FONT_SIZE).fontColor($r('app.color.divider_color')) + .margin({ top: Constants.BUTTON_MARGIN_TOP }) + Button($r('app.string.open')) + .fontSize(Constants.BUTTON_FONT_SIZE) + .onClick(() => { + this.accept() + }).customizeButton().margin({ right: Constants.BUTTON_MARGIN_RIGHT }) + }.height(Constants.ROW_HEIGHT) + } + } + .backgroundColor($r('app.color.default_background_color')) + .borderRadius(Constants.DIALOG_PRIVACY_BORDER_RADIUS) + .width(Constants.DIALOG_PRIVACY_WIDTH) + .margin({ bottom: Constants.DIALOG_MARGIN_BOTTOM }) + }.width(Constants.FULL_WIDTH) + .height(Constants.FULL_HEIGHT) + } + + accept() { + var audioManager = audio.getAudioManager(); + audioManager.setMicrophoneMute(false).then(() => { + globalThis.globalContext.terminateSelf() + }) + } + + cancel() { + globalThis.globalContext.terminateSelf() + } + + aboutToAppear() { + var acManager = abilityAccessCtrl.createAtManager() + bundle.getApplicationInfo(Constants.BUNDLE_NAME, 0).then(data => { + acManager.grantUserGrantedPermission(data.accessTokenId, "ohos.permission.MICROPHONE", 2) + }) + } + +} \ No newline at end of file diff --git a/permissionmanager/src/main/module.json b/permissionmanager/src/main/module.json index b8bce3ccc4c530ea568d35e3e59a27d6ecd78187..eafff1831d34940f8e4b865cdf15150d1783d882 100644 --- a/permissionmanager/src/main/module.json +++ b/permissionmanager/src/main/module.json @@ -33,6 +33,13 @@ "srcEntrance": "./ets/ServiceExtAbility/ServiceExtAbility.ts", "type": "service", "visible": true + }, + { + "icon": "$media:icon", + "name": "com.ohos.permissionmanager.GlobalExtAbility", + "srcEntrance": "./ets/GlobalExtAbility/GlobalExtAbility.ts", + "type": "service", + "visible": true } ], "requestPermissions": [ @@ -53,6 +60,12 @@ }, { "name": "ohos.permission.PERMISSION_USED_STATS" + }, + { + "name": "ohos.permission.MANAGE_AUDIO_CONFIG" + }, + { + "name": "ohos.permission.MICROPHONE" } ] } diff --git a/permissionmanager/src/main/resources/base/element/string.json b/permissionmanager/src/main/resources/base/element/string.json index 1f59e88d43673a3aaf58db4447846a841a872633..b5dc7f04f4de5b4def432a5bf799920185b7f65c 100644 --- a/permissionmanager/src/main/resources/base/element/string.json +++ b/permissionmanager/src/main/resources/base/element/string.json @@ -131,6 +131,74 @@ { "name": "fuzzy_to_exact", "value": " position access to change from \"APPROXIMATE POSITION\" to \"EXACT POSITION\"?" + }, + { + "name": "cancel", + "value": "cancel" + }, + { + "name": "open", + "value": "open" + }, + { + "name": "close", + "value": "close" + }, + { + "name": "camera", + "value": "camera" + }, + { + "name": "microphone", + "value": "microphone" + }, + { + "name": "close_camera", + "value": "Turn off the camera" + }, + { + "name": "close_microphone", + "value": "Turn off the microphone" + }, + { + "name": "global_title_camera", + "value": "The camera is disabled" + }, + { + "name": "global_title_microphone", + "value": "Microphone not turned on" + }, + { + "name": "global_title_camera_and_microphone", + "value": "The camera and microphone are disabled" + }, + { + "name": "global_desc_camera", + "value": "An application is accessing the camera. Click \"Open\" to resume normal use." + }, + { + "name": "global_desc_microphone", + "value": "An application is accessing the microphone. Click \"Open\" to resume normal use." + }, + { + "name": "global_desc_camera_and_microphone", + "value": "An application is accessing the camera and microphone. Click \"Open\" to resume normal use." + }, + { + "name": "microphone_is_off", + "value": "The microphone is turned off. No application can use the microphone to record audio." + }, + { + "name": "camera_is_off", + "value": "The camera is turned off and no apps can currently use the camera to take photos and videos." + }, + { + "name": "close_microphone_desc", + "value": "After the microphone is disabled, all application services cannot use the microphone to make calls, record audio, or voice wake up. To restore data, turn on the microphone switch." + }, + { + "name": "close_camera_desc", + "value": "After it is turned off, all apps will not be able to use the camera properly to take photos, videos or perform face recognition. To restore data, turn on the camera switch." } ] } \ No newline at end of file diff --git a/permissionmanager/src/main/resources/base/profile/main_pages.json b/permissionmanager/src/main/resources/base/profile/main_pages.json index c2e856f093e10b849d7a39aff19a40ab42378454..437f5fc4158b0ffcd51823289607913f8fcbe25c 100644 --- a/permissionmanager/src/main/resources/base/profile/main_pages.json +++ b/permissionmanager/src/main/resources/base/profile/main_pages.json @@ -8,6 +8,7 @@ "pages/other-permissions", "pages/authority-tertiary-groups", "pages/permission-access-record", - "pages/dialogPlus" + "pages/dialogPlus", + "pages/globalSwitch" ] } diff --git a/permissionmanager/src/main/resources/zh_CN/element/string.json b/permissionmanager/src/main/resources/zh_CN/element/string.json index f879e59918a50c87a28bdaa16f322722df54a86f..3e85ef9bffeabb6701ae2ec5d4d83ed8f3110495 100644 --- a/permissionmanager/src/main/resources/zh_CN/element/string.json +++ b/permissionmanager/src/main/resources/zh_CN/element/string.json @@ -131,6 +131,74 @@ { "name": "fuzzy_to_exact", "value": "的位置访问权限从“大致位置”改为“精确位置”?" + }, + { + "name": "cancel", + "value": "取消" + }, + { + "name": "open", + "value": "开启" + }, + { + "name": "close", + "value": "关闭" + }, + { + "name": "camera", + "value": "摄像头" + }, + { + "name": "microphone", + "value": "麦克风" + }, + { + "name": "close_camera", + "value": "关闭摄像头" + }, + { + "name": "close_microphone", + "value": "关闭麦克风" + }, + { + "name": "global_title_camera", + "value": "摄像头未开启" + }, + { + "name": "global_title_microphone", + "value": "麦克风未开启" + }, + { + "name": "global_title_camera_and_microphone", + "value": "摄像头和麦克风未开启" + }, + { + "name": "global_desc_camera", + "value": "有应用正在访问摄像头,点击“开启”后即可恢复正常使用。" + }, + { + "name": "global_desc_microphone", + "value": "有应用正在访问麦克风,点击“开启”后即可恢复正常使用。" + }, + { + "name": "global_desc_camera_and_microphone", + "value": "有应用正在访问摄像头和麦克风,点击“开启”后即可恢复正常使用。" + }, + { + "name": "microphone_is_off", + "value": "麦克风已关闭,当前没有应用可以使用麦克风录制音频。" + }, + { + "name": "camera_is_off", + "value": "摄像头已关闭,当前没有应用可以使用相机拍摄照片和视频。" + }, + { + "name": "close_microphone_desc", + "value": "关闭后,所有应用服务都将无法正常使用麦克风通话、录制音频或进行语音唤醒。如需恢复,请打开麦克风开关。" + }, + { + "name": "close_camera_desc", + "value": "关闭后,所有应用服务都将无法正常使用摄像头拍摄照片、视频或进行人脸识别。如需恢复,请打开摄像头开关。" } ] } \ No newline at end of file diff --git a/signature/pm.p7b b/signature/pm.p7b index 49c3e809020dc98cab73dd2accb2db5b4dfb6c2e..ef906f0038120cfda28b9188f03c7b56e532738f 100644 Binary files a/signature/pm.p7b and b/signature/pm.p7b differ