HarmonyOS 通过photopicker可以拉起相册了,为什么还有一个ACL权限ohos.permission.READ_IMAGEVIDEO

通过photopicker可以拉起相册了(参考下面代码,不需要申请任何权限),为啥还有一个ACL权限ohos.permission.READ_IMAGEVIDEO,这个读相册的ACL权限主要控制哪些方面逻辑?

import { BusinessError } from '@ohos.base';
import photoAccessHelper from '@ohos.file.photoAccessHelper';
@Entry
@Component
struct Index {
  build() {
    Button('访问手机相册').onClick(() => {
      try {
        let PhotoSelectOptions = new photoAccessHelper.PhotoSelectOptions();
        PhotoSelectOptions.MIMEType = photoAccessHelper.PhotoViewMIMETypes.IMAGE_TYPE;
        PhotoSelectOptions.maxSelectNumber = 5;
        let photoPicker = new photoAccessHelper.PhotoViewPicker();
        photoPicker.select(PhotoSelectOptions).then((PhotoSelectResult: photoAccessHelper.PhotoSelectResult) => {
          console.info('PhotoViewPicker.select successfully, PhotoSelectResult uri: ' +
          JSON.stringify(PhotoSelectResult));
        }).catch((err: BusinessError) => {
          console.error('PhotoViewPicker.select failed with err: ' + JSON.stringify(err));
        });
      } catch (error) {
        let err: BusinessError = error as BusinessError;
        console.error('PhotoViewPicker failed with err: ' + JSON.stringify(err));
      }
    })
  }
}
HarmonyOS
1天前
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
fox280

通过photopicker可以拉起相册了,用户可以感知到,此接口返回的PhotoSelectResult对象中的photoUris只能通过临时授权的方式调用photoAccessHelper.getAssets接口去使用:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-photoaccesshelper-V5#select

应用有ohos.permission.READ_IMAGEVIDEO权限可以直接访问相册用户无感知,但特殊场景与功能的应用才可以申请:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/restricted-permissions-V5#section397164718158

分享
微博
QQ
微信
回复
1天前
相关问题
HarmonyOS READ_IMAGEVIDEO权限问题
54浏览 • 1回复 待解决
HarmonyOS 关于ohos.permission.WRITE_IMAGEVIDEO
603浏览 • 1回复 待解决