Signed-off-by: cy7717 <chenyu301@huawei.com>
This commit is contained in:
cy7717 2023-02-24 15:12:24 +08:00
parent 20405cf970
commit 6a864fee94
2 changed files with 36 additions and 30 deletions

View File

@ -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;
}
}
}

View File

@ -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);