Signed-off-by: byndyx <baiyanan2@huawei.com>
This commit is contained in:
byndyx
2023-10-11 16:04:00 +08:00
parent 16886e835e
commit 92ef54096e
6 changed files with 26 additions and 0 deletions
+1
View File
@@ -39,6 +39,7 @@
"c_utils",
"distributed_hardware_fwk",
"config_policy",
"hicollie",
"hisysevent",
"hitrace",
"graphic_2d",
+5
View File
@@ -1,3 +1,6 @@
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
*/
/*
* Copyright (c) 2021-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -84,6 +87,8 @@ namespace DistributedInput {
constexpr int32_t EPOLL_WAITTIME = 100;
constexpr uint64_t WATCHDOG_INTERVAL_TIME_MS = 20 * 1000;
/* The input device is a keyboard or has buttons. */
constexpr uint32_t INPUT_DEVICE_CLASS_KEYBOARD = 0x00000001;
+1
View File
@@ -55,6 +55,7 @@ ohos_shared_library("libdinput_sink_trans") {
"distributed_hardware_fwk:libdhfwk_sdk",
"dsoftbus:softbus_client",
"eventhandler:libeventhandler",
"hicollie:libhicollie",
"hitrace:hitrace_meter",
"ipc:ipc_core",
"safwk:system_ability_fwk",
@@ -1,3 +1,6 @@
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
*/
/*
* Copyright (c) 2021-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -31,6 +34,7 @@
#include "hidumper.h"
#include "session.h"
#include "softbus_bus_center.h"
#include "xcollie/watchdog.h"
#include "distributed_input_transport_base.h"
@@ -41,6 +45,11 @@ DistributedInputSinkTransport::DistributedInputSinkTransport() : mySessionName_(
{
std::shared_ptr<AppExecFwk::EventRunner> runner = AppExecFwk::EventRunner::Create(true);
eventHandler_ = std::make_shared<DistributedInputSinkTransport::DInputSinkEventHandler>(runner);
if (OHOS::HiviewDFX::Watchdog::GetInstance().AddThread("dinputwatchdog", eventHandler_,
WATCHDOG_INTERVAL_TIME_MS)) {
DHLOGE("HiviewDFX::Watchdog::GetInstance().AddThread() Failed.");
}
DHLOGI("DistributedInputSinkTransport ctor.");
}
+1
View File
@@ -109,6 +109,7 @@ ohos_shared_library("libdinput_source") {
"distributed_hardware_fwk:libdhfwk_sdk",
"dsoftbus:softbus_client",
"eventhandler:libeventhandler",
"hicollie:libhicollie",
"hisysevent:libhisysevent",
"hitrace:hitrace_meter",
"ipc:ipc_core",
@@ -1,3 +1,6 @@
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
*/
/*
* Copyright (c) 2021-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -36,6 +39,7 @@
#include "distributed_input_source_transport.h"
#include "distributed_input_transport_base.h"
#include "dinput_softbus_define.h"
#include "xcollie/watchdog.h"
#include "hisysevent_util.h"
#include "hidumper.h"
#include "input_check_param.h"
@@ -118,6 +122,11 @@ bool DistributedInputSourceManager::InitAuto()
DHLOGI("init success");
std::shared_ptr<AppExecFwk::EventRunner> runner = AppExecFwk::EventRunner::Create(true);
callBackHandler_ = std::make_shared<DInputSourceManagerEventHandler>(runner, this);
if (OHOS::HiviewDFX::Watchdog::GetInstance().AddThread("dinputsourcewatchdog", callBackHandler_,
WATCHDOG_INTERVAL_TIME_MS)) {
DHLOGE("HiviewDFX::Watchdog::GetInstance().AddThread() Failed.");
}
return true;
}