diff --git a/bundle.json b/bundle.json index 992ef26aff426406551069e222e81a770d0cf86c..b1da5cfc8c0849484de8bbf92b01a0fa207e59eb 100644 --- a/bundle.json +++ b/bundle.json @@ -57,7 +57,8 @@ "libwebsockets", "node", "jsoncpp", - "access_token" + "access_token", + "hiappevent" ] }, "build": { diff --git a/frameworks/js/napi/http/BUILD.gn b/frameworks/js/napi/http/BUILD.gn index ff57c883251e3cacc2c8004f8055ce11e7976f85..cd7314d13112613a4d0f5e0e38d5b630541a6e25 100644 --- a/frameworks/js/napi/http/BUILD.gn +++ b/frameworks/js/napi/http/BUILD.gn @@ -182,6 +182,9 @@ ohos_shared_library("http") { external_deps += [ "init:libbegetutil" ] } } + if (!build_ohos_sdk) { + external_deps += [ "hiappevent:hiappevent_innerapi" ] + } include_dirs += [ "$NETSTACK_DIR/utils/profiler_utils/include", "$NETSTACK_DIR/utils/tlv_utils/include", diff --git a/frameworks/js/napi/http/http_exec/src/http_exec.cpp b/frameworks/js/napi/http/http_exec/src/http_exec.cpp index 60f8b6f101ccfd370932035458ed80b8581c063f..f76782c885067f68c6ee4dbb367210ee34c901ed 100755 --- a/frameworks/js/napi/http/http_exec/src/http_exec.cpp +++ b/frameworks/js/napi/http/http_exec/src/http_exec.cpp @@ -67,6 +67,7 @@ #include "securec.h" #include "secure_char.h" #include "trace_events.h" +#include "hi_app_event_report.h" #define NETSTACK_CURL_EASY_SET_OPTION(handle, opt, data, asyncContext) \ do { \ @@ -573,7 +574,7 @@ void HttpExec::HandleCurlData(CURLMsg *msg) } } -bool HttpExec::ExecRequest(RequestContext *context) +static bool ExecRequestCheck(RequestContext *context) { if (!CommonUtils::HasInternetPermission()) { context->SetPermissionDenied(true); @@ -589,7 +590,17 @@ bool HttpExec::ExecRequest(RequestContext *context) context->SetCleartextNotPermitted(true); return false; } + return true; +} + +bool HttpExec::ExecRequest(RequestContext *context) +{ + HiAppEventReport hiAppEventReport("NetworkKit", "HttpRequest"); + if (!ExecRequestCheck(context)) { + return false; + } if (context->GetSharedManager()->IsEventDestroy()) { + hiAppEventReport.ReportSdkEvent(RESULT_SUCCESS, HTTP_UNKNOWN_OTHER_ERROR); return false; } context->options.SetRequestTime(HttpTime::GetNowTimeGMT()); @@ -606,6 +617,7 @@ bool HttpExec::ExecRequest(RequestContext *context) context->GetModuleId()); } } + hiAppEventReport.ReportSdkEvent(RESULT_SUCCESS, ERR_NONE); return true; } if (!RequestWithoutCache(context)) { @@ -621,8 +633,10 @@ bool HttpExec::ExecRequest(RequestContext *context) context->GetModuleId()); } } + hiAppEventReport.ReportSdkEvent(RESULT_SUCCESS, NapiUtils::NETSTACK_NAPI_INTERNAL_ERROR); return false; } + hiAppEventReport.ReportSdkEvent(RESULT_SUCCESS, ERR_NONE); return true; } diff --git a/frameworks/js/napi/http/http_module/src/http_module.cpp b/frameworks/js/napi/http/http_module/src/http_module.cpp index dfa8279ca315c8d01d037dc5051a658e003b84d6..70570e18e1de7b677b67ed7664008a60ba8d8181 100644 --- a/frameworks/js/napi/http/http_module/src/http_module.cpp +++ b/frameworks/js/napi/http/http_module/src/http_module.cpp @@ -25,6 +25,7 @@ #include "netstack_log.h" #include "netstack_common_utils.h" #include "trace_events.h" +#include "hi_app_event_report.h" #define DECLARE_RESPONSE_CODE(code) \ DECLARE_NAPI_STATIC_PROPERTY(#code, NapiUtils::CreateUint32(env, static_cast(ResponseCode::code))) @@ -306,6 +307,7 @@ napi_value HttpModuleExports::HttpRequest::RequestInStream(napi_env env, napi_ca napi_value HttpModuleExports::HttpRequest::Destroy(napi_env env, napi_callback_info info) { + HiAppEventReport hiAppEventReport("NetworkKit", "HttpDestroy"); napi_value thisVal = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVal, nullptr)); EventManagerWrapper *wrapper = nullptr; @@ -324,10 +326,12 @@ napi_value HttpModuleExports::HttpRequest::Destroy(napi_env env, napi_callback_i } if (manager->IsEventDestroy()) { NETSTACK_LOGD("js object has been destroyed"); + hiAppEventReport.ReportSdkEvent(RESULT_SUCCESS, HTTP_UNKNOWN_OTHER_ERROR); return NapiUtils::GetUndefined(env); } manager->SetEventDestroy(true); manager->DeleteEventReference(env); + hiAppEventReport.ReportSdkEvent(RESULT_SUCCESS, ERR_NONE); return NapiUtils::GetUndefined(env); } diff --git a/frameworks/js/napi/socket/BUILD.gn b/frameworks/js/napi/socket/BUILD.gn index 9f59ab31eeed5712dbc5c947b2554a14ba962ea3..c2754c7dcc0f8bb2072e15d04e2f5d4b8512dc74 100644 --- a/frameworks/js/napi/socket/BUILD.gn +++ b/frameworks/js/napi/socket/BUILD.gn @@ -145,6 +145,11 @@ ohos_shared_library("socket") { "openssl:libssl_shared", "samgr:samgr_proxy", ] + + if (!build_ohos_sdk) { + external_deps += [ "hiappevent:hiappevent_innerapi" ] + } + defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] if (defined(global_parts_info) && defined(global_parts_info.communication_netmanager_base) && diff --git a/frameworks/js/napi/tls/src/tlssocket_module.cpp b/frameworks/js/napi/tls/src/tlssocket_module.cpp index f7b2eb09c5e5aa4d4310fade67d6a277113fb783..9ec0fc1ddeff5bc3691ef1d992fb96f06b950558 100644 --- a/frameworks/js/napi/tls/src/tlssocket_module.cpp +++ b/frameworks/js/napi/tls/src/tlssocket_module.cpp @@ -32,6 +32,7 @@ #include "tls_send_context.h" #include "tls_init_context.h" #include "tlssocket_async_work.h" +#include "hi_app_event_report.h" namespace OHOS { namespace NetStack { @@ -185,6 +186,7 @@ void TLSSocketModuleExports::InitProtocol(napi_env env, napi_value exports) napi_value TLSSocketModuleExports::ConstructTLSSocketInstance(napi_env env, napi_callback_info info) { + HiAppEventReport hiAppEventReport("NetworkKit", "TLSSocketConstructTLSSocketInstance"); napi_value result = ModuleTemplate::NewInstanceWithSharedManager(env, info, INTERFACE_TLS_SOCKET, Finalize); if (result == nullptr) { return nullptr; @@ -226,6 +228,7 @@ napi_value TLSSocketModuleExports::ConstructTLSSocketInstance(napi_env env, napi } delete context; + hiAppEventReport.ReportSdkEvent(RESULT_SUCCESS, ERR_NONE); return result; } diff --git a/test/fuzztest/socket/fuzztest/socketexec_fuzzer/BUILD.gn b/test/fuzztest/socket/fuzztest/socketexec_fuzzer/BUILD.gn index 18ca049a7afcc6cb753d2f83fe5a897130cb48f3..119da3cad8f165857c608a71d378208ae8dd7d7c 100644 --- a/test/fuzztest/socket/fuzztest/socketexec_fuzzer/BUILD.gn +++ b/test/fuzztest/socket/fuzztest/socketexec_fuzzer/BUILD.gn @@ -140,6 +140,7 @@ ohos_fuzztest("SocketExecFuzzTest") { "openssl:libcrypto_shared", "openssl:libssl_shared", "samgr:samgr_proxy", + "hiappevent:hiappevent_innerapi", ] defines = [ diff --git a/test/fuzztest/socket/fuzztest/tlssocket_fuzzer/BUILD.gn b/test/fuzztest/socket/fuzztest/tlssocket_fuzzer/BUILD.gn index cf6c936f8cd21fb74b9ce7ec6bbb75c26c133768..f5f5126d3efa3721ed9a7912c9ab4d80dc286ca6 100644 --- a/test/fuzztest/socket/fuzztest/tlssocket_fuzzer/BUILD.gn +++ b/test/fuzztest/socket/fuzztest/tlssocket_fuzzer/BUILD.gn @@ -139,6 +139,7 @@ ohos_fuzztest("TlsSocketFuzzTest") { "openssl:libcrypto_shared", "openssl:libssl_shared", "samgr:samgr_proxy", + "hiappevent:hiappevent_innerapi", ] defines = [ diff --git a/test/unittest/socket/BUILD.gn b/test/unittest/socket/BUILD.gn index efaf577913f9567eb69c6437a0058ceaac1b35eb..6dd5567222bceb8d46630f8a792ffa310d837d16 100644 --- a/test/unittest/socket/BUILD.gn +++ b/test/unittest/socket/BUILD.gn @@ -140,6 +140,7 @@ ohos_unittest("socket_unittest") { "openssl:libcrypto_shared", "openssl:libssl_shared", "samgr:samgr_proxy", + "hiappevent:hiappevent_innerapi", ] defines = [ diff --git a/test/unittest/tlssocket/client/BUILD.gn b/test/unittest/tlssocket/client/BUILD.gn index 2ea275aad66c45fb86c6e4ce4f5c63b7b2da3ebf..6fab27015691a80cc44c2ea10d7d848554553c73 100644 --- a/test/unittest/tlssocket/client/BUILD.gn +++ b/test/unittest/tlssocket/client/BUILD.gn @@ -142,6 +142,7 @@ ohos_unittest("two_way_tls_socket_unittest") { "openssl:libcrypto_shared", "openssl:libssl_shared", "samgr:samgr_proxy", + "hiappevent:hiappevent_innerapi", ] defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] @@ -190,6 +191,7 @@ ohos_unittest("one_way_tls_socket_unittest") { "openssl:libcrypto_shared", "openssl:libssl_shared", "samgr:samgr_proxy", + "hiappevent:hiappevent_innerapi", ] defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] @@ -238,6 +240,7 @@ ohos_unittest("two_way_tls_socket_certchain_unittest") { "openssl:libcrypto_shared", "openssl:libssl_shared", "samgr:samgr_proxy", + "hiappevent:hiappevent_innerapi", ] defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] @@ -286,6 +289,7 @@ ohos_unittest("one_way_tls_socket_certchain_unittest") { "openssl:libcrypto_shared", "openssl:libssl_shared", "samgr:samgr_proxy", + "hiappevent:hiappevent_innerapi", ] defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] @@ -337,6 +341,7 @@ ohos_unittest("tls_socket_unilateral_connection") { "openssl:libcrypto_shared", "openssl:libssl_shared", "samgr:samgr_proxy", + "hiappevent:hiappevent_innerapi", ] defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] @@ -411,6 +416,7 @@ ohos_unittest("tls_key_test") { "openssl:libcrypto_shared", "openssl:libssl_shared", "samgr:samgr_proxy", + "hiappevent:hiappevent_innerapi", ] defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] @@ -458,6 +464,7 @@ ohos_unittest("tls_cert_test") { "openssl:libcrypto_shared", "openssl:libssl_shared", "samgr:samgr_proxy", + "hiappevent:hiappevent_innerapi", ] defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] @@ -505,6 +512,7 @@ ohos_unittest("tls_configuration_test") { "openssl:libcrypto_shared", "openssl:libssl_shared", "samgr:samgr_proxy", + "hiappevent:hiappevent_innerapi", ] defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] @@ -552,6 +560,7 @@ ohos_unittest("tls_context_test") { "openssl:libcrypto_shared", "openssl:libssl_shared", "samgr:samgr_proxy", + "hiappevent:hiappevent_innerapi", ] defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] @@ -599,6 +608,7 @@ ohos_unittest("socket_error_unittest") { "openssl:libcrypto_shared", "openssl:libssl_shared", "samgr:samgr_proxy", + "hiappevent:hiappevent_innerapi", ] defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] @@ -649,6 +659,7 @@ ohos_unittest("tls_socket_branch_test") { "openssl:libcrypto_shared", "openssl:libssl_shared", "samgr:samgr_proxy", + "hiappevent:hiappevent_innerapi", ] defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] diff --git a/test/unittest/tlssocket/core/BUILD.gn b/test/unittest/tlssocket/core/BUILD.gn index a285b794a5c4924d31cf5faf070b500dc7ce00f5..e04ff1b36f8153c95bad6fc596e9ba2539556b26 100644 --- a/test/unittest/tlssocket/core/BUILD.gn +++ b/test/unittest/tlssocket/core/BUILD.gn @@ -148,6 +148,7 @@ ohos_unittest("tls_socket_core_test") { "openssl:libcrypto_shared", "openssl:libssl_shared", "samgr:samgr_proxy", + "hiappevent:hiappevent_innerapi", ] defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] diff --git a/test/unittest/tlssocket/server/BUILD.gn b/test/unittest/tlssocket/server/BUILD.gn index ab1434e5bbb4b29ce59aa1f921279c6d490abf94..abbf69136d06e4b6d24c22d9aae3b2fc72bfcb49 100644 --- a/test/unittest/tlssocket/server/BUILD.gn +++ b/test/unittest/tlssocket/server/BUILD.gn @@ -144,6 +144,7 @@ ohos_unittest("two_way_tls_socket_server_unittest") { "openssl:libcrypto_shared", "openssl:libssl_shared", "samgr:samgr_proxy", + "hiappevent:hiappevent_innerapi", ] defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] diff --git a/test/unittest/utils/http_handover_handler/BUILD.gn b/test/unittest/utils/http_handover_handler/BUILD.gn index 66d77ad32664293ca229b14367a7c20ee2d020e4..f7f7023609caa9f8e788bbbba09f431f86f41afb 100644 --- a/test/unittest/utils/http_handover_handler/BUILD.gn +++ b/test/unittest/utils/http_handover_handler/BUILD.gn @@ -67,6 +67,7 @@ ohos_unittest("http_handover_handler_test") { "init:libbegetutil", "napi:ace_napi", "time_service:time_client", + "hiappevent:hiappevent_innerapi", ] sources = [ diff --git a/utils/napi_utils/BUILD.gn b/utils/napi_utils/BUILD.gn index f66457749c5eeed8bfb53bb75279ea1437304db8..604c836185ea3c1a5461480f0ab9df392bbd0836 100644 --- a/utils/napi_utils/BUILD.gn +++ b/utils/napi_utils/BUILD.gn @@ -41,6 +41,7 @@ ohos_static_library("napi_utils") { "src/napi_utils.cpp", "src/secure_char.cpp", "src/timing.cpp", + "src/hi_app_event_report.cpp", ] part_name = "netstack" @@ -55,6 +56,14 @@ ohos_static_library("napi_utils") { "napi:ace_napi", ] + if (!build_ohos_sdk) { + external_deps += [ + "hiappevent:hiappevent_innerapi", + "time_service:time_client", + "ability_runtime:wantagent_innerkits", + ] + } + if (defined(global_parts_info) && defined(global_parts_info.communication_netmanager_base) && global_parts_info.communication_netmanager_base && is_ohos && @@ -83,12 +92,22 @@ ohos_static_library("napi_utils_static") { "src/napi_utils.cpp", "src/secure_char.cpp", "src/timing.cpp", + "src/hi_app_event_report.cpp", ] + public_configs = [ ":napi_utils_public_config" ] external_deps = [ "cJSON:cjson" ] + if (!build_ohos_sdk) { + external_deps += [ + "hiappevent:hiappevent_innerapi", + "time_service:time_client", + "ability_runtime:wantagent_innerkits", + ] + } + if (defined(global_parts_info) && defined(global_parts_info.communication_netmanager_base) && global_parts_info.communication_netmanager_base && is_ohos && diff --git a/utils/napi_utils/include/hi_app_event_report.h b/utils/napi_utils/include/hi_app_event_report.h new file mode 100644 index 0000000000000000000000000000000000000000..7625c33b44ebb79c471088f1f554c361c6763f33 --- /dev/null +++ b/utils/napi_utils/include/hi_app_event_report.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2025-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef HI_SDK_REPORT +#define HI_SDK_REPORT + +#ifdef ENABLE_EVENT_HANDLER +#include "app_event.h" +#include "app_event_processor_mgr.h" +#endif + +#include +#include +#include + +namespace OHOS { +namespace NetStack { +static constexpr int RESULT_SUCCESS = 0; +static constexpr int RESULT_FAIL = 1; +static constexpr int ERR_NONE = 0; + +class HiAppEventReport { +public: + HiAppEventReport(std::string sdk, std::string api); + ~HiAppEventReport(); + void ReportSdkEvent(const int result, const int errCode); + +#ifdef ENABLE_EVENT_HANDLER +private: + int64_t AddProcessor(); + + int64_t beginTime_ = 0; + std::string transId_ = ""; + std::string apiName_ = ""; + std::string sdkName_ = ""; +#endif +}; +} // namespace NetStack +} // namespace OHOS +#endif //HI_SDK_REPORT diff --git a/utils/napi_utils/src/hi_app_event_report.cpp b/utils/napi_utils/src/hi_app_event_report.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a7d3ae3ca2a19ab85ce8311826e021a3b4444b3a --- /dev/null +++ b/utils/napi_utils/src/hi_app_event_report.cpp @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2025-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "hi_app_event_report.h" +#include +#ifdef ENABLE_EVENT_HANDLER +#include "time_service_client.h" +#undef LOG_DOMAIN +#undef LOG_TAG +#include "netstack_log.h" +#endif + +namespace OHOS { +namespace NetStack { +#ifdef ENABLE_EVENT_HANDLER +const int64_t TIMEOUT = 90; +const int64_t ROW = 30; +const int64_t MAXVALUE = 999999; +const int64_t PROCESSOR_ID_NOT_CREATE = -1; +static int64_t g_processorID = PROCESSOR_ID_NOT_CREATE; +#endif + +HiAppEventReport::HiAppEventReport(std::string sdk, std::string api) +{ +#ifdef ENABLE_EVENT_HANDLER + apiName_ = api; + sdkName_ = sdk; + std::random_device randSeed; + std::mt19937 gen(randSeed()); + std::uniform_int_distribution<> dis(0, MAXVALUE); + transId_ = std::string("transId_") + std::to_string(dis(gen)); + + beginTime_ = OHOS::MiscServices::TimeServiceClient::GetInstance()->GetBootTimeMs(); + if (g_processorID == PROCESSOR_ID_NOT_CREATE) { + g_processorID = AddProcessor(); + } +#endif +} + +HiAppEventReport::~HiAppEventReport() +{ +} + +void HiAppEventReport::ReportSdkEvent(const int result, const int errCode) +{ +#ifdef ENABLE_EVENT_HANDLER + int64_t endTime = OHOS::MiscServices::TimeServiceClient::GetInstance()->GetBootTimeMs(); + OHOS::HiviewDFX::HiAppEvent::Event event("api_diagnostic", "api_exec_end", OHOS::HiviewDFX::HiAppEvent::BEHAVIOR); + event.AddParam("trans_id", this->transId_); + event.AddParam("api_name", this->apiName_); + event.AddParam("sdk_name", this->sdkName_); + event.AddParam("begin_time", this->beginTime_); + event.AddParam("end_time", endTime); + event.AddParam("result", result); + event.AddParam("error_code", errCode); + int ret = Write(event); + NETSTACK_LOGD("transId:%{public}s, apiName:%{public}s, sdkName:%{public}s, " + "startTime:%{public}ld, endTime:%{public}ld, result:%{public}d, errCode:%{public}d, ret:%{public}d", + this->transId_.c_str(), this->apiName_.c_str(), this->sdkName_.c_str(), + this->beginTime_, endTime, result, errCode, ret); +#endif +} + +#ifdef ENABLE_EVENT_HANDLER +int64_t HiAppEventReport::AddProcessor() +{ + NETSTACK_LOGI("AddProcessor enter"); + OHOS::HiviewDFX::HiAppEvent::ReportConfig config; + config.name = "ha_app_event"; + config.appId = "com_hua" "wei_hmos_sdk_ocg"; + config.routeInfo = "AUTO"; + config.triggerCond.timeout = TIMEOUT; + config.triggerCond.row = ROW; + config.eventConfigs.clear(); + { + OHOS::HiviewDFX::HiAppEvent::EventConfig event; + event.domain = "api_diagnostic"; + event.name = "api_exec_end"; + event.isRealTime = false; + config.eventConfigs.push_back(event); + } + { + OHOS::HiviewDFX::HiAppEvent::EventConfig event2; + event2.domain = "api_diagnostic"; + event2.name = "api_called_stat"; + event2.isRealTime = true; + config.eventConfigs.push_back(event2); + } + { + OHOS::HiviewDFX::HiAppEvent::EventConfig event3; + event3.domain = "api_diagnostic"; + event3.name = "api_called_stat_cnt"; + event3.isRealTime = true; + config.eventConfigs.push_back(event3); + } + return OHOS::HiviewDFX::HiAppEvent::AppEventProcessorMgr::AddProcessor(config); +} +#endif +} // namespace NetStack +} // namespace OHOS diff --git a/utils/napi_utils/src/module_template.cpp b/utils/napi_utils/src/module_template.cpp index 1898ba32308374bb3b41a8b1e144e3928d4da943..2ffc55bef004f894468b8c6ca133aa07982eac8c 100644 --- a/utils/napi_utils/src/module_template.cpp +++ b/utils/napi_utils/src/module_template.cpp @@ -24,6 +24,7 @@ #include "event_manager.h" #include "netstack_log.h" +#include "hi_app_event_report.h" namespace OHOS::NetStack::ModuleTemplate { static constexpr const int EVENT_PARAM_NUM = 2; @@ -364,6 +365,7 @@ napi_value NewInstanceWithSharedManager(napi_env env, napi_callback_info info, c Finalizer finalizer) { NETSTACK_LOGD("create new instance for %{public}s", className.c_str()); + HiAppEventReport hiAppEventReport("NetworkKit", "WebsocketConstructLocalSocketInstance"); napi_value thisVal = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVal, nullptr)); @@ -404,6 +406,7 @@ napi_value NewInstanceWithSharedManager(napi_env env, napi_callback_info info, c nullptr, nullptr); napi_set_named_property(env, global, manager->className_.c_str(), result); napi_add_env_cleanup_hook(env, CleanUpWithSharedManager, reinterpret_cast(sharedManager)); + hiAppEventReport.ReportSdkEvent(RESULT_SUCCESS, ERR_NONE); return result; }