114cf0368Sopenharmony_ci/* 214cf0368Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 314cf0368Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 414cf0368Sopenharmony_ci * you may not use this file except in compliance with the License. 514cf0368Sopenharmony_ci * You may obtain a copy of the License at 614cf0368Sopenharmony_ci * 714cf0368Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 814cf0368Sopenharmony_ci * 914cf0368Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1014cf0368Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1114cf0368Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1214cf0368Sopenharmony_ci * See the License for the specific language governing permissions and 1314cf0368Sopenharmony_ci * limitations under the License. 1414cf0368Sopenharmony_ci */ 1514cf0368Sopenharmony_ci 1614cf0368Sopenharmony_ci#ifndef UDMF_RADAR_REPORTER_H 1714cf0368Sopenharmony_ci#define UDMF_RADAR_REPORTER_H 1814cf0368Sopenharmony_ci 1914cf0368Sopenharmony_ci#include "hisysevent_c.h" 2014cf0368Sopenharmony_ci#include "visibility.h" 2114cf0368Sopenharmony_ci#include <string> 2214cf0368Sopenharmony_ci 2314cf0368Sopenharmony_cinamespace OHOS { 2414cf0368Sopenharmony_cinamespace UDMF { 2514cf0368Sopenharmony_cinamespace RadarReporter { 2614cf0368Sopenharmony_cienum BizScene : int32_t { 2714cf0368Sopenharmony_ci SET_DATA = 1, 2814cf0368Sopenharmony_ci SYNC_DATA = 2, 2914cf0368Sopenharmony_ci GET_DATA = 3, 3014cf0368Sopenharmony_ci UTD_REGISTER = 4 3114cf0368Sopenharmony_ci}; 3214cf0368Sopenharmony_ci 3314cf0368Sopenharmony_cienum SetDataStage : int32_t { 3414cf0368Sopenharmony_ci SET_DATA_BEGIN = 1, 3514cf0368Sopenharmony_ci VERIFY_SHARE_PERMISSIONS = 2, 3614cf0368Sopenharmony_ci GERERATE_DFS_URI = 3, 3714cf0368Sopenharmony_ci SET_DATA_END = 4 3814cf0368Sopenharmony_ci}; 3914cf0368Sopenharmony_ci 4014cf0368Sopenharmony_cienum SyncDataStage : int32_t { 4114cf0368Sopenharmony_ci SYNC_BEGIN = 1, 4214cf0368Sopenharmony_ci SYNC_END = 2 4314cf0368Sopenharmony_ci}; 4414cf0368Sopenharmony_ci 4514cf0368Sopenharmony_cienum GetDataStage : int32_t { 4614cf0368Sopenharmony_ci GET_DATA_BEGIN = 1, 4714cf0368Sopenharmony_ci VERIFY_PRIVILEGE = 2, 4814cf0368Sopenharmony_ci GRANT_URI_PERMISSION = 3, 4914cf0368Sopenharmony_ci GET_DATA_END = 4 5014cf0368Sopenharmony_ci}; 5114cf0368Sopenharmony_ci 5214cf0368Sopenharmony_cienum UtdRegisterStage : int32_t { 5314cf0368Sopenharmony_ci UTD_REGISTER_BEGIN = 1, 5414cf0368Sopenharmony_ci UTD_REGISTER_END = 2, 5514cf0368Sopenharmony_ci}; 5614cf0368Sopenharmony_ci 5714cf0368Sopenharmony_cienum StageRes : int32_t { 5814cf0368Sopenharmony_ci IDLE = 0, 5914cf0368Sopenharmony_ci SUCCESS = 1, 6014cf0368Sopenharmony_ci FAILED = 2, 6114cf0368Sopenharmony_ci CANCELLED = 3 6214cf0368Sopenharmony_ci}; 6314cf0368Sopenharmony_ci 6414cf0368Sopenharmony_cienum BizState : int32_t { 6514cf0368Sopenharmony_ci DFX_BEGIN = 0, 6614cf0368Sopenharmony_ci DFX_NORMAL_END = 1, 6714cf0368Sopenharmony_ci DFX_ABNORMAL_END = 2 6814cf0368Sopenharmony_ci}; 6914cf0368Sopenharmony_ciconst constexpr char DOMAIN[] = "DISTDATAMGR"; 7014cf0368Sopenharmony_ciconst constexpr char EVENT_NAME[] = "DISTRIBUTED_UDMF_BEHAVIOR"; 7114cf0368Sopenharmony_ciconst constexpr char ORG_PKG[] = "distributeddata"; 7214cf0368Sopenharmony_ci} // namespace RadarReporter 7314cf0368Sopenharmony_ci 7414cf0368Sopenharmony_ciclass API_EXPORT RadarReporterAdapter { 7514cf0368Sopenharmony_cipublic: 7614cf0368Sopenharmony_ci static void ReportNormal(const std::string &func, int32_t scene, int32_t stage, int32_t stageRes, int32_t state); 7714cf0368Sopenharmony_ci static void ReportFail( 7814cf0368Sopenharmony_ci const std::string &func, int32_t scene, int32_t stage, int32_t stageRes, int32_t errorCode, int32_t state); 7914cf0368Sopenharmony_ci static void ReportFail(const std::string &func, int32_t scene, int32_t stage, int32_t stageRes, int32_t errorCode); 8014cf0368Sopenharmony_ci}; 8114cf0368Sopenharmony_ci} // namespace UDMF 8214cf0368Sopenharmony_ci} // namespace OHOS 8314cf0368Sopenharmony_ci#endif // UDMF_RADAR_REPORTER_H