commonUI/ASP: [SPC][PermissionDialog][Ability]: caller permision: ["ohos.permission.CAMERA"].
commonUI/ASP: [SPC][PermissionDialog][ViewModel]: group: CAMERA, title: 允许“xxxx”访问你的相机?, reason: 需要您同意使用相机,为您提供识别二维码、人脸识别、远程柜台、拍照、录像服务.
commonUI/ASP: [SPC][PermissionDialog][Model]: handle ClickIntent, grantState: ALLOW, group: CAMERA.
commonUI/ASP: [SPC][PermissionDialog][Model]: permission: ohos.permission.CAMERA, opt: GRANT, result: 1.
commonUI/PrivacyCenter_permissionGrant: {"PNAMEID":"com.huawei.hmos.security.privacycenter","PVERSIONID":"5.0.20.362","BUNDLE_NAME":"com.example","PERMISSION_GROUP":"CAMERA","REQUESTED_PERMISSION":["ohos.permission.CAMERA"],"NEW_GRANT_STATE":"ALLOW"} PERMISSION_GRANT_DIALOG
commonUI/PrivacyCenter_permissionGrant: HiSysEventUtil reportHiSysEvent PERMISSION_GRANT_DIALOG success.{"PNAMEID":"com.huawei.hmos.security.privacycenter","PVERSIONID":"5.0.20.362","BUNDLE_NAME":"com.example","PERMISSION_GROUP":"CAMERA","REQUESTED_PERMISSION":["ohos.permission.CAMERA"],"NEW_GRANT_STATE":"ALLOW"}
commonUI/ASP: [SPC][PermissionDialog][Model]: terminate session with result, resultCode: 1, reqPerms: [ohos.permission.CAMERA], result: [0]. E A00001/com.example/[Scan]: callback failed, code: 1000500001, message: Internal error. The width and height of viewcontrol do not match the width and height supported by the camera. E A00001/com.example/[Scan]: callback failed, code: 1000500001, message: Internal error. The width and height of viewcontrol do not match the width and height supported by the camera.
ViewControl的width和height需和XComponent的保持一致,start接口根据设置宽高值会匹配最接近相机分辨率,当未匹配到合适分辨率,接口会返回1000500001内部错误。如果传入的ViewControl宽高比例与相机分辨率不匹配,就会导致应用无法拉起相机实现扫一扫功能。
建议ViewControl设置的宽高比例和XComponent组件的宽高保持一致。可以参考自定义界面扫码开发步骤中第4步示例代码中initCamera方法对ViewControl的设置和build中对XComponent组件宽高的设置。