diff --git a/base_sdk/BUILD.gn b/base_sdk/BUILD.gn index 54001d0aabfc9a51500e12857bcf4c09efee2c19..3bb04c8ac0cd8a80cf0f90c7b700152805e288d1 100644 --- a/base_sdk/BUILD.gn +++ b/base_sdk/BUILD.gn @@ -51,6 +51,7 @@ generate_static_abc("base_transfer") { "./transfer/kitRegister/cameraKit.ets", "./transfer/kitRegister/pasteboard.ets", "./transfer/kitRegister/effectKit.ets", + "./transfer/kitRegister/mediaLibraryKit.ets", ] is_boot_abc = "True" device_dst_file = "/system/framework/base_transfer.abc" diff --git a/base_sdk/transfer/kitRegister/mediaLibraryKit.ets b/base_sdk/transfer/kitRegister/mediaLibraryKit.ets new file mode 100644 index 0000000000000000000000000000000000000000..4f1b7827c91cbe561565df272465627e4486dade --- /dev/null +++ b/base_sdk/transfer/kitRegister/mediaLibraryKit.ets @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { registerStaticCB, registerDynamicCB } from '../register.ets'; + +export function registerMediaLibraryKit() { + registerStaticCB('MediaLibraryKit.PhotoAsset', '@ohos.file.photoAccessHelper.photoAccessHelper', 'PhotoAssetHandle', 'transferStatic'); + registerDynamicCB('MediaLibraryKit.PhotoAsset', '@ohos.file.photoAccessHelper.photoAccessHelper', 'PhotoAssetHandle', 'transferDynamic'); + + registerStaticCB('MediaLibraryKit.Album', '@ohos.file.photoAccessHelper.photoAccessHelper', 'AlbumHandle', 'transferStatic'); + registerDynamicCB('MediaLibraryKit.Album', '@ohos.file.photoAccessHelper.photoAccessHelper', 'AlbumHandle', 'transferDynamic'); + + registerStaticCB('MediaLibraryKit.AbsAlbum', '@ohos.file.photoAccessHelper.photoAccessHelper', 'AlbumHandle', 'transferStatic'); + registerDynamicCB('MediaLibraryKit.AbsAlbum', '@ohos.file.photoAccessHelper.photoAccessHelper', 'AlbumHandle', 'transferDynamic'); + + registerStaticCB('MediaLibraryKit.FetchResult', '@ohos.file.photoAccessHelper.photoAccessHelper', 'FetchResultHandle', 'transferStatic'); + registerDynamicCB('MediaLibraryKit.FetchResult', '@ohos.file.photoAccessHelper.photoAccessHelper', 'FetchResultHandle', 'transferDynamic'); + + registerStaticCB('MediaLibraryKit.MovingPhoto', '@ohos.file.photoAccessHelper.photoAccessHelper', 'MovingPhotoHandle', 'transferStatic'); + registerDynamicCB('MediaLibraryKit.MovingPhoto', '@ohos.file.photoAccessHelper.photoAccessHelper', 'MovingPhotoHandle', 'transferDynamic'); +} \ No newline at end of file diff --git a/base_sdk/transfer/kitRegister/registerMain.ets b/base_sdk/transfer/kitRegister/registerMain.ets index 658a7884c52cb8efc71ea7c30523c20bd9b6fdbd..f7b322eb8b414ffc82905de8042ea6d40349a71c 100644 --- a/base_sdk/transfer/kitRegister/registerMain.ets +++ b/base_sdk/transfer/kitRegister/registerMain.ets @@ -27,6 +27,7 @@ import { registerImageKit } from './imageKit.ets'; import { registerCameraKit } from './cameraKit.ets'; import { registerPasteboard } from './pasteboard.ets'; import { registerEffectKit } from './effectKit.ets'; +import { registerMediaLibraryKit } from './mediaLibraryKit.ets' export function registerMain(){ registerArkTS(); @@ -43,4 +44,5 @@ export function registerMain(){ registerCameraKit(); registerPasteboard(); registerEffectKit(); + registerMediaLibraryKit(); } \ No newline at end of file