fix: modify event name

Signed-off-by: zhaolinglan <zhaolinglan@huawei.com>
This commit is contained in:
zhaolinglan 2023-08-24 10:54:38 +08:00
parent faa0c76269
commit 93a2325b28
5 changed files with 27 additions and 24 deletions

View File

@ -26,18 +26,18 @@
"ram": "1024KB",
"deps": {
"components": [
"init",
"napi",
"samgr",
"common_event_service",
"ipc",
"eventhandler",
"bundle_framework",
"ability_runtime",
"hilog",
"ability_base",
"safwk",
"input",
"init",
"napi",
"samgr",
"common_event_service",
"ipc",
"eventhandler",
"bundle_framework",
"ability_runtime",
"hilog",
"ability_base",
"safwk",
"input",
"c_utils",
"access_token",
"i18n",
@ -45,7 +45,8 @@
"os_account",
"hisysevent",
"hitrace",
"graphic_2d"
"graphic_2d",
"ffrt"
],
"third_party": [
"jsoncpp"

View File

@ -43,11 +43,18 @@ public:
{
std::unique_lock<std::mutex> lock(mutex_);
cv_.wait_for(lock, std::chrono::milliseconds(INTERVAL), [this]() { return isSet_; });
isTimeOut_ = !isSet_;
T data = data_;
return data;
}
bool GetValue(T &data)
{
std::unique_lock<std::mutex> lock(mutex_);
cv_.wait_for(lock, std::chrono::milliseconds(INTERVAL), [this]() { return isSet_; });
data = data_;
return isSet_;
}
void Clear(const T &invalid = T())
{
std::lock_guard<std::mutex> lock(mutex_);
@ -55,16 +62,10 @@ public:
data_ = invalid;
}
bool IsTimeOut()
{
return isTimeOut_;
}
private:
bool isSet_ = false;
const uint32_t INTERVAL;
T data_;
bool isTimeOut_{ false };
std::mutex mutex_;
std::condition_variable cv_;
};

View File

@ -24,3 +24,5 @@ windowmanager_path = "//foundation/window/window_manager"
bundllemanager_path = "//foundation/bundlemanager/bundle_framework"
multimodalinput_path = "//foundation/multimodalinput/input"
resourceschedule_ffrt_path = "//foundation/resourceschedule/ffrt"

View File

@ -18,7 +18,6 @@ config("inputmethod_client_native_config") {
visibility = [ ":*" ]
include_dirs = [
"include",
"${inputmethod_path}/common",
"${inputmethod_path}/frameworks/common",
"${inputmethod_path}/frameworks/native/inputmethod_controller/include",
"${inputmethod_path}/services/dfx/include",
@ -30,11 +29,13 @@ config("inputmethod_client_native_public_config") {
visibility = [ "./*" ]
include_dirs = [
"include",
"${inputmethod_path}/common",
"${inputmethod_path}/frameworks/common",
"${inputmethod_path}/frameworks/native/inputmethod_controller/include",
"${inputmethod_path}/frameworks/native/inputmethod_ability/include",
"${inputmethod_path}/services/include",
"${inputmethod_path}/services/dfx/include",
"${resourceschedule_ffrt_path}/interfaces/kits",
]
}
@ -72,6 +73,7 @@ ohos_shared_library("inputmethod_client") {
external_deps = [
"c_utils:utils",
"eventhandler:libeventhandler",
"ffrt:libffrt",
"hilog:libhilog",
"input:libmmi-client",
"ipc:ipc_single",
@ -110,7 +112,6 @@ ohos_static_library("inputmethod_client_static") {
external_deps = [
"c_utils:utils",
"eventhandler:libeventhandler",
"ffrt:libffrt",
"hilog:libhilog",
"input:libmmi-client",
"ipc:ipc_single",

View File

@ -52,8 +52,6 @@ void FuzzInputClientStub(const uint8_t *rawData, size_t size)
MessageOption option;
sptr<InputClientStub> mClient = new InputClientStub();
MessageHandler *handler = MessageHandler::Instance();
mClient->SetHandler(handler);
mClient->OnRemoteRequest(code, data, reply, option);
}