mirror of
https://gitee.com/openharmony/applications_permission_manager
synced 2024-11-23 11:19:46 +00:00
相机监听
Signed-off-by: fanchenxuan <fanchenxuan@huawei.com>
This commit is contained in:
parent
9808a337a8
commit
49b52708aa
@ -135,9 +135,20 @@ struct appNamePlusPage {
|
||||
resourceManager.getString(info.labelId, (error, value) => {
|
||||
info.label = value;
|
||||
})
|
||||
resourceManager.getMediaBase64(info.iconId, (error, value) => {
|
||||
info.icon = value;
|
||||
})
|
||||
|
||||
try {
|
||||
let iconDescriptor = resourceManager.getDrawableDescriptor(info.iconId);
|
||||
info.icon = iconDescriptor?.getPixelMap();
|
||||
} catch (error) {
|
||||
console.error(`getDrawableDescriptor failed, error code: ${error.code}, message: ${error.message}.`);
|
||||
}
|
||||
if (!info.icon) {
|
||||
info.icon = await resourceManager.getMediaContentBase64(info.iconId);
|
||||
}
|
||||
if (!info.icon) {
|
||||
info.icon = $r('app.media.icon');
|
||||
}
|
||||
|
||||
var reqUserPermissions: string[] = [];
|
||||
var acManager = abilityAccessCtrl.createAtManager();
|
||||
if (info.permissions.length > 0) {
|
||||
|
@ -411,7 +411,8 @@ struct applicationItem {
|
||||
this.globalIsOn = globalIsOn;
|
||||
if (globalThis.currentPermissionGroup == "CAMERA") {
|
||||
let cameraManager = camera.getCameraManager(globalThis.context);
|
||||
cameraManager.on('cameraMute', curMuted => {
|
||||
cameraManager.on('cameraMute', (err, curMuted) => {
|
||||
console.log(TAG + 'curMuted: ' + JSON.stringify(curMuted) + ' err: ' + JSON.stringify(err));
|
||||
this.globalIsOn = !curMuted;
|
||||
})
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user