mirror of
https://gitee.com/openharmony/applications_notes
synced 2024-11-26 17:20:25 +00:00
备忘录mediaLibrary废弃接口整改
Signed-off-by: zwx1126739 <zhanghong121@huawei.com>
This commit is contained in:
parent
6de74e6c8d
commit
806536dadc
@ -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) {
|
||||
|
@ -47,6 +47,9 @@
|
||||
},
|
||||
{
|
||||
"name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND"
|
||||
},
|
||||
{
|
||||
"name": "ohos.permission.READ_IMAGEVIDEO"
|
||||
}
|
||||
],
|
||||
"deliveryWithInstall": true,
|
||||
|
Loading…
Reference in New Issue
Block a user