1 /* 2 * Copyright (c) 2025-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 HI_SDK_REPORT 17 #define HI_SDK_REPORT 18 19 #ifdef ENABLE_EVENT_HANDLER 20 #include "app_event.h" 21 #include "app_event_processor_mgr.h" 22 #endif 23 24 #include <vector> 25 #include <cstdint> 26 #include <string> 27 28 namespace OHOS { 29 namespace NetStack { 30 static constexpr int RESULT_SUCCESS = 0; 31 static constexpr int RESULT_FAIL = 1; 32 static constexpr int ERR_NONE = 0; 33 34 class HiAppEventReport { 35 public: 36 HiAppEventReport(std::string sdk, std::string api); 37 ~HiAppEventReport(); 38 void ReportSdkEvent(const int result, const int errCode); 39 40 #ifdef ENABLE_EVENT_HANDLER 41 private: 42 int64_t AddProcessor(); 43 44 int64_t beginTime_ = 0; 45 std::string transId_ = ""; 46 std::string apiName_ = ""; 47 std::string sdkName_ = ""; 48 #endif 49 }; 50 } // namespace NetStack 51 } // namespace OHOS 52 #endif //HI_SDK_REPORT 53