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 #define MLOG_TAG "Media_Service"
17
18 #include "cloud_media_dfx_service.h"
19 #include "dfx_manager.h"
20
21 namespace OHOS::Media::CloudSync {
SyncStart(const std::string & taskId,const int32_t syncReason)22 void CloudMediaDfxService::SyncStart(const std::string& taskId, const int32_t syncReason)
23 {
24 DfxManager::GetInstance()->HandleSyncStart(taskId, syncReason);
25 }
26
UpdateMetaStat(uint32_t index,uint64_t diff,uint32_t syncType)27 void CloudMediaDfxService::UpdateMetaStat(uint32_t index, uint64_t diff, uint32_t syncType)
28 {
29 DfxManager::GetInstance()->HandleUpdateMetaStat(index, diff, syncType);
30 }
31
UpdateAttachmentStat(uint32_t index,uint64_t diff)32 void CloudMediaDfxService::UpdateAttachmentStat(uint32_t index, uint64_t diff)
33 {
34 DfxManager::GetInstance()->HandleUpdateAttachmentStat(index, diff);
35 }
36
UpdateAlbumStat(uint32_t index,uint64_t diff)37 void CloudMediaDfxService::UpdateAlbumStat(uint32_t index, uint64_t diff)
38 {
39 DfxManager::GetInstance()->HandleUpdateAlbumStat(index, diff);
40 }
41
UpdateUploadMetaStat(uint32_t index,uint64_t diff)42 void CloudMediaDfxService::UpdateUploadMetaStat(uint32_t index, uint64_t diff)
43 {
44 DfxManager::GetInstance()->HandleUpdateUploadMetaStat(index, diff);
45 }
46
UpdateUploadDetailError(int32_t error)47 void CloudMediaDfxService::UpdateUploadDetailError(int32_t error)
48 {
49 DfxManager::GetInstance()->HandleUpdateUploadDetailError(error);
50 }
51
SyncEnd(const int32_t stopReason)52 void CloudMediaDfxService::SyncEnd(const int32_t stopReason)
53 {
54 DfxManager::GetInstance()->HandleSyncEnd(stopReason);
55 }
56
ReportSyncFault(const std::string & funcName,const int lineNum,const SyncFaultEvent & event)57 void CloudMediaDfxService::ReportSyncFault(const std::string& funcName, const int lineNum, const SyncFaultEvent& event)
58 {
59 DfxManager::GetInstance()->HandleReportSyncFault(funcName + ":" + std::to_string(lineNum), event);
60 }
61 }