备忘录mediaLibrary废弃接口整改

Signed-off-by: zwx1126739 <zhanghong121@huawei.com>
This commit is contained in:
zwx1126739 2024-06-01 11:09:16 +08:00
parent 6de74e6c8d
commit 806536dadc
2 changed files with 5 additions and 2 deletions

View File

@ -14,7 +14,7 @@
*/
import {LogUtil} from '../baseUtil/LogUtil'
import MediaLib from '@ohos.multimedia.mediaLibrary';
import photoAccessHelper from '@ohos.file.photoAccessHelper';
const TAG = "MediaLibraryAccess"
export class MediaLibraryAccess {
@ -28,7 +28,7 @@ export class MediaLibraryAccess {
// 通过Uri拷贝图片到指定指定的包路径下
// 1、获取本地路径
let fileResult = await MediaLib.getMediaLibrary(context).getFileAssets(fetchOpt)
let fileResult = await photoAccessHelper.getPhotoAccessHelper(context).getAssets(fetchOpt)
if (fileResult != undefined) {
album.count = fileResult.getCount();
if (album.count <= 0) {

View File

@ -47,6 +47,9 @@
},
{
"name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND"
},
{
"name": "ohos.permission.READ_IMAGEVIDEO"
}
],
"deliveryWithInstall": true,