1 /* 2 * Copyright (C) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef MEDIA_NOTIFICATION_MARSHALLING_UTILS_H 17 #define MEDIA_NOTIFICATION_MARSHALLING_UTILS_H 18 19 #include <string> 20 #include <list> 21 #include <variant> 22 #include <sstream> 23 24 #include "parcel.h" 25 #include "media_log.h" 26 #include "data_ability_observer_interface.h" 27 #include "media_change_info.h" 28 #include "accurate_common_data.h" 29 #include "album_change_info.h" 30 #include "photo_asset_change_info.h" 31 32 namespace OHOS { 33 namespace Media { 34 using namespace Notification; 35 #define EXPORT __attribute__ ((visibility ("default"))) 36 class NotificationUtils { 37 public: 38 EXPORT static int32_t SendNotification(const sptr<AAFwk::IDataAbilityObserver> &dataObserver, 39 const std::shared_ptr<MediaChangeInfo> &mediaChangeInfo); 40 EXPORT static std::shared_ptr<MediaChangeInfo> UnmarshalInMultiMode(Parcel &parcel); 41 private: 42 EXPORT bool WriteToChangeInfo(const std::shared_ptr<MediaChangeInfo> &mediaChangeInfo, 43 std::vector<std::shared_ptr<AAFwk::ChangeInfo>> &changeInfos); 44 EXPORT bool Marshalling(const std::shared_ptr<MediaChangeInfo> &mediaChangeInfo, 45 std::vector<std::shared_ptr<Parcel>> &parcels); 46 }; 47 48 } 49 } 50 #endif // MEDIA_NOTIFICATION_MARSHALLING_UTILS_H