1bc03f14fSopenharmony_ci/* 2bc03f14fSopenharmony_ci * Copyright (C) 2024 Huawei Device Co., Ltd. 3bc03f14fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4bc03f14fSopenharmony_ci * you may not use this file except in compliance with the License. 5bc03f14fSopenharmony_ci * You may obtain a copy of the License at 6bc03f14fSopenharmony_ci * 7bc03f14fSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8bc03f14fSopenharmony_ci * 9bc03f14fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10bc03f14fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11bc03f14fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12bc03f14fSopenharmony_ci * See the License for the specific language governing permissions and 13bc03f14fSopenharmony_ci * limitations under the License. 14bc03f14fSopenharmony_ci */ 15bc03f14fSopenharmony_ci 16bc03f14fSopenharmony_ci#ifndef DISTRIBUTEDDATAMGR_PASTEBOARD_EVENT_UE_H 17bc03f14fSopenharmony_ci#define DISTRIBUTEDDATAMGR_PASTEBOARD_EVENT_UE_H 18bc03f14fSopenharmony_ci 19bc03f14fSopenharmony_ci#include "hisysevent.h" 20bc03f14fSopenharmony_ci 21bc03f14fSopenharmony_cinamespace OHOS { 22bc03f14fSopenharmony_cinamespace MiscServices { 23bc03f14fSopenharmony_cinamespace UeReporter { 24bc03f14fSopenharmony_ciusing namespace OHOS::HiviewDFX; 25bc03f14fSopenharmony_ciconstexpr const char *CROSS_FLAG = "IS_DISTRIBUTED_PASTEBOARD"; 26bc03f14fSopenharmony_ci 27bc03f14fSopenharmony_ciconstexpr HiviewDFX::HiSysEvent::EventType UE_OPERATION_TYPE = HiviewDFX::HiSysEvent::EventType::BEHAVIOR; 28bc03f14fSopenharmony_ciconstexpr HiviewDFX::HiSysEvent::EventType UE_STATUS_TYPE = HiviewDFX::HiSysEvent::EventType::STATISTIC; 29bc03f14fSopenharmony_ci 30bc03f14fSopenharmony_ciconstexpr const char *VERSION = "1.0"; 31bc03f14fSopenharmony_ci 32bc03f14fSopenharmony_ciconstexpr const char *UE_COPY = "DISTRIBUTED_PASTEBOARD_COPY"; 33bc03f14fSopenharmony_ciconstexpr const char *UE_PASTE = "DISTRIBUTED_PASTEBOARD_PASTE"; 34bc03f14fSopenharmony_ciconstexpr const char *UE_SWITCH_STATUS = "PASTEBOARD_SWITCH_STATUS"; 35bc03f14fSopenharmony_ciconstexpr const char *UE_SWITCH_OPERATION = "PASTEBOARD_SWITCH_OPERATION"; 36bc03f14fSopenharmony_ci 37bc03f14fSopenharmony_ciconstexpr const int32_t E_OK_OPERATION = 0; 38bc03f14fSopenharmony_ci 39bc03f14fSopenharmony_ciconstexpr char UE_DOMAIN[] = "PASTEBOARD_UE"; 40bc03f14fSopenharmony_ci 41bc03f14fSopenharmony_cienum SwitchStatus : std::int32_t { 42bc03f14fSopenharmony_ci SWITCH_CLOSE = 0, 43bc03f14fSopenharmony_ci SWITCH_OPEN = 1, 44bc03f14fSopenharmony_ci}; 45bc03f14fSopenharmony_ci 46bc03f14fSopenharmony_ci#define UE_SWITCH(eventName, eventType, switchStatus, ...) \ 47bc03f14fSopenharmony_ci ({ \ 48bc03f14fSopenharmony_ci HiSysEventWrite(UeReporter::UE_DOMAIN, eventName, eventType, "PNAMEID", "pasteboard_service", "PVERSIONID", \ 49bc03f14fSopenharmony_ci UeReporter::VERSION, "SWITCH_STATUS", switchStatus, ##__VA_ARGS__); \ 50bc03f14fSopenharmony_ci }) 51bc03f14fSopenharmony_ci 52bc03f14fSopenharmony_ci#define UE_REPORT(eventName, dataType, bundleName, pasteResult, deviceType, ...) \ 53bc03f14fSopenharmony_ci ({ \ 54bc03f14fSopenharmony_ci HiSysEventWrite(UeReporter::UE_DOMAIN, eventName, UeReporter::UE_OPERATION_TYPE, "PNAMEID", \ 55bc03f14fSopenharmony_ci "pasteboard_service", "PVERSIONID", UeReporter::VERSION, "PASTEDATA_TYPE", dataType, "BUNDLE_NAME", \ 56bc03f14fSopenharmony_ci bundleName, "PASTE_RESULT", pasteResult, "DEVICE_TYPE", deviceType, ##__VA_ARGS__); \ 57bc03f14fSopenharmony_ci }) 58bc03f14fSopenharmony_ci} // namespace UeReporter 59bc03f14fSopenharmony_ci} // namespace MiscServices 60bc03f14fSopenharmony_ci} // namespace OHOS 61bc03f14fSopenharmony_ci#endif //DISTRIBUTEDDATAMGR_PASTEBOARD_EVENT_UE_H