diff --git a/permissionmanager/src/main/ets/common/components/dialog.ets b/permissionmanager/src/main/ets/common/components/dialog.ets index 3d3f861470cd43e476527b5e3a5915f823e91794..02ca56f29b57caae274f691c4678da64823a346b 100644 --- a/permissionmanager/src/main/ets/common/components/dialog.ets +++ b/permissionmanager/src/main/ets/common/components/dialog.ets @@ -110,11 +110,10 @@ export struct globalDialog { confirm() { if(globalThis.currentPermissionGroup == 'CAMERA') { - camera.getCameraManager(globalThis.context).then(cameraManager => { - cameraManager.muteCamera(true) - this.globalIsOn = false - this.controller.close() - }) + let cameraManager = camera.getCameraManager(globalThis.context); + cameraManager.muteCamera(true); + this.globalIsOn = false; + this.controller.close(); }else { var audioManager = audio.getAudioManager(); let audioVolumeManager = audioManager.getVolumeManager(); diff --git a/permissionmanager/src/main/ets/pages/authority-management.ets b/permissionmanager/src/main/ets/pages/authority-management.ets index 75eb7c59519ba777dca3da0db5ea6fa2585fb219..617a214224a924cf8aa03b80f663156ebf34dd88 100644 --- a/permissionmanager/src/main/ets/pages/authority-management.ets +++ b/permissionmanager/src/main/ets/pages/authority-management.ets @@ -123,12 +123,11 @@ struct authorityManagementPage { }) }) }else { - camera.getCameraManager(globalThis.context).then(cameraManager => { - let mute = cameraManager.isCameraMuted() - router.pushUrl({ - url: 'pages/authority-tertiary-groups', - params: { routerData: dataList, backTitle: item.groupName, globalIsOn: !mute } - }) + let cameraManager = camera.getCameraManager(globalThis.context); + let mute = cameraManager.isCameraMuted(); + router.pushUrl({ + url: 'pages/authority-tertiary-groups', + params: { routerData: dataList, backTitle: item.groupName, globalIsOn: !mute } }) } } diff --git a/permissionmanager/src/main/ets/pages/authority-tertiary-groups.ets b/permissionmanager/src/main/ets/pages/authority-tertiary-groups.ets index bfd9dc2e29ad05f7cf59bad0c4dd5b772e02721f..5671abf0a6de554ad0dd47c993cd86afd44a50bf 100644 --- a/permissionmanager/src/main/ets/pages/authority-tertiary-groups.ets +++ b/permissionmanager/src/main/ets/pages/authority-tertiary-groups.ets @@ -436,10 +436,9 @@ struct applicationItem { .onChange((isOn: boolean) => { if(isOn) { if(globalThis.currentPermissionGroup == "CAMERA") { - camera.getCameraManager(globalThis.context).then(cameraManager => { - cameraManager.muteCamera(false) - this.globalIsOn = isOn - }) + let cameraManager = camera.getCameraManager(globalThis.context); + cameraManager.muteCamera(false); + this.globalIsOn = isOn; }else { var audioManager = audio.getAudioManager(); let audioVolumeManager = audioManager.getVolumeManager(); diff --git a/permissionmanager/src/main/ets/pages/globalSwitch.ets b/permissionmanager/src/main/ets/pages/globalSwitch.ets index 1d33016284c9511913167933db21d94e43e2a58f..e2ad71826b4a3ddcb1641237338ac4db66192608 100644 --- a/permissionmanager/src/main/ets/pages/globalSwitch.ets +++ b/permissionmanager/src/main/ets/pages/globalSwitch.ets @@ -117,20 +117,18 @@ struct globalDialog { }) }) }else if(globalThis.globalState == CAMERA) { - camera.getCameraManager(globalThis.globalContext).then(cameraManager => { - cameraManager.muteCamera(false) - globalThis.globalContext.terminateSelf() - }) + let cameraManager = camera.getCameraManager(globalThis.globalContext); + cameraManager.muteCamera(false); + globalThis.globalContext.terminateSelf(); }else { - camera.getCameraManager(globalThis.globalContext).then(cameraManager => { - cameraManager.muteCamera(false) - var audioManager = audio.getAudioManager(); - let audioVolumeManager = audioManager.getVolumeManager(); - let groupid = audio.DEFAULT_VOLUME_GROUP_ID; - audioVolumeManager.getVolumeGroupManager(groupid).then(audioVolumeGroupManager => { - audioVolumeGroupManager.setMicrophoneMute(false).then(() => { - globalThis.globalContext.terminateSelf() - }) + let cameraManager = camera.getCameraManager(globalThis.globalContext); + cameraManager.muteCamera(false); + var audioManager = audio.getAudioManager(); + let audioVolumeManager = audioManager.getVolumeManager(); + let groupid = audio.DEFAULT_VOLUME_GROUP_ID; + audioVolumeManager.getVolumeGroupManager(groupid).then(audioVolumeGroupManager => { + audioVolumeGroupManager.setMicrophoneMute(false).then(() => { + globalThis.globalContext.terminateSelf() }) }) }