Description:hisysevent

Match-id-2d40d31cf78d1173cad26bebaf9cf5050e43ce88
This commit is contained in:
xxxx
2022-06-16 17:07:35 +08:00
parent dcd14ccba4
commit bc5172c2d7
17 changed files with 443 additions and 1 deletions
+3
View File
@@ -31,6 +31,7 @@ ohos_shared_library("libdinput_sink_handler") {
"${fwk_common_path}/utils/include",
"${fwk_utils_path}/include/log",
"${fwk_utils_path}/include",
"${dfx_utils_path}/include",
]
sources = [
@@ -50,6 +51,7 @@ ohos_shared_library("libdinput_sink_handler") {
"${fwk_utils_path}:distributedhardwareutils",
"${innerkits_path}:libdinput_sdk",
"${services_sink_path}/sinkmanager:libdinput_sink",
"${dfx_utils_path}:libdinput_dfx_utils",
]
external_deps = [
@@ -57,6 +59,7 @@ ohos_shared_library("libdinput_sink_handler") {
"safwk:system_ability_fwk",
"hiviewdfx_hilog_native:libhilog",
"samgr_standard:samgr_proxy",
"hisysevent_native:libhisysevent",
]
cflags_cc = [ "-DHILOG_ENABLE" ]
@@ -18,6 +18,7 @@
#include "distributed_hardware_log.h"
#include "dinput_errcode.h"
#include "hisysevent_util.h"
#include "i_distributed_sink_input.h"
#include "load_d_input_sink_callback.h"
@@ -42,6 +43,8 @@ int32_t DistributedInputSinkHandler::InitSink(const std::string &params)
return ERR_DH_INPUT_SINK_HANDLER_INIT_SINK_SA_FAIL;
}
sptr<LoadDInputSinkCallback> loadCallback = new LoadDInputSinkCallback(params);
HisyseventUtil::GetInstance().SysEventWriteBehavior(DINPUT_INIT,
"dinput sink LoadSystemAbility call");
int32_t ret = samgr->LoadSystemAbility(DISTRIBUTED_HARDWARE_INPUT_SINK_SA_ID, loadCallback);
if (ret != ERR_OK) {
DHLOGE("Failed to Load systemAbility, systemAbilityId:%d, ret code:%d",
@@ -71,6 +74,8 @@ void DistributedInputSinkHandler::FinishStartSA(const std::string &params, const
int32_t DistributedInputSinkHandler::ReleaseSink()
{
HisyseventUtil::GetInstance().SysEventWriteBehavior(DINPUT_EXIT,
"dinput exit sink sa release.");
return DistributedInputClient::GetInstance().ReleaseSink();
}
@@ -16,6 +16,7 @@
#include "distributed_hardware_log.h"
#include "distributed_input_sink_handler.h"
#include "hisysevent_util.h"
#include "load_d_input_sink_callback.h"
namespace OHOS {
@@ -37,6 +38,8 @@ void LoadDInputSinkCallback::OnLoadSystemAbilitySuccess(
void LoadDInputSinkCallback::OnLoadSystemAbilityFail(int32_t systemAbilityId)
{
HisyseventUtil::GetInstance().SysEventWriteFault(DINPUT_INIT_FAIL,
"dinput sink LoadSystemAbility call failed.");
DHLOGE("load dinput SA failed, systemAbilityId:%d", systemAbilityId);
}
}
+3
View File
@@ -42,6 +42,7 @@ ohos_unittest("distributed_input_sink_handler_test") {
"${fwk_utils_path}/include/log",
"${fwk_utils_path}/include",
"//third_party/json/include",
"${dfx_utils_path}/include",
]
sources = [
@@ -71,6 +72,7 @@ ohos_unittest("distributed_input_sink_handler_test") {
"${fwk_utils_path}:distributedhardwareutils",
"${innerkits_path}:libdinput_sdk",
"${services_source_path}/sourcemanager:libdinput_source",
"${dfx_utils_path}:libdinput_dfx_utils",
]
external_deps = [
@@ -78,6 +80,7 @@ ohos_unittest("distributed_input_sink_handler_test") {
"safwk:system_ability_fwk",
"hiviewdfx_hilog_native:libhilog",
"samgr_standard:samgr_proxy",
"hisysevent_native:libhisysevent",
]
cflags_cc = [ "-DHILOG_ENABLE" ]