diff --git a/services/src/input_method_system_ability.cpp b/services/src/input_method_system_ability.cpp index ba16250c..f7fc3ef9 100644 --- a/services/src/input_method_system_ability.cpp +++ b/services/src/input_method_system_ability.cpp @@ -754,36 +754,41 @@ void InputMethodSystemAbility::WorkThread() prctl(PR_SET_NAME, "IMSAWorkThread"); while (1) { Message *msg = MessageHandler::Instance()->GetMessage(); - if (msg != nullptr) { - switch (msg->msgId_) { - case MSG_ID_USER_START: { - OnUserStarted(msg); - break; - } - case MSG_ID_USER_REMOVED: { - OnUserRemoved(msg); - break; - } - case MSG_ID_PACKAGE_REMOVED: { - OnPackageRemoved(msg); - break; - } - case MSG_ID_HIDE_KEYBOARD_SELF: { - if (userSession_ != nullptr) { - userSession_->OnHideKeyboardSelf(false); - } - break; - } - case MSG_ID_START_INPUT_SERVICE: { - StartInputService(GetStartedIme(userId_)); - break; - } - default: { - break; - } + switch (msg->msgId_) { + case MSG_ID_USER_START: { + OnUserStarted(msg); + delete msg; + msg = nullptr; + break; + } + case MSG_ID_USER_REMOVED: { + OnUserRemoved(msg); + delete msg; + msg = nullptr; + break; + } + case MSG_ID_PACKAGE_REMOVED: { + OnPackageRemoved(msg); + delete msg; + msg = nullptr; + break; + } + case MSG_ID_HIDE_KEYBOARD_SELF: { + if (userSession_ != nullptr) { + userSession_->OnHideKeyboardSelf(false); + } + delete msg; + break; + } + case MSG_ID_START_INPUT_SERVICE: { + StartInputService(GetStartedIme(userId_)); + delete msg; + msg = nullptr; + break; + } + default: { + break; } - delete msg; - msg = nullptr; } } } diff --git a/test/fuzztest/perusersession_fuzzer/perusersession_fuzzer.cpp b/test/fuzztest/perusersession_fuzzer/perusersession_fuzzer.cpp index c47f89f4..30f4cbb8 100644 --- a/test/fuzztest/perusersession_fuzzer/perusersession_fuzzer.cpp +++ b/test/fuzztest/perusersession_fuzzer/perusersession_fuzzer.cpp @@ -67,7 +67,8 @@ bool FuzzPerUserSession(const uint8_t *rawData, size_t size) userSessions->GetCurrentSubProperty(); userSessions->SetCurrentSubProperty(subProperty); userSessions->StopInputService(str); - userSessions->OnHideKeyboardSelf(); + userSessions->OnHideKeyboardSelf(true); + userSessions->OnHideKeyboardSelf(false); userSessions->OnStartInput(client, isShowKeyboard); userSessions->OnStopInput(client); userSessions->OnReleaseInput(client);