From 2460f4630e4ef8f6db643c60fd48f520ffea31b6 Mon Sep 17 00:00:00 2001 From: guojin31 Date: Tue, 17 Dec 2024 14:18:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8RequestHideInput=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=B8=8D=E5=88=B0imeData=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E4=BB=8D=E7=84=B6=E9=9C=80=E8=A6=81=E5=A4=84=E7=90=86client?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: guojin31 --- services/src/peruser_session.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/services/src/peruser_session.cpp b/services/src/peruser_session.cpp index 4619b27c..5bff75f0 100644 --- a/services/src/peruser_session.cpp +++ b/services/src/peruser_session.cpp @@ -400,16 +400,14 @@ int32_t PerUserSession::OnRequestHideInput() { IMSA_HILOGD("PerUserSession::OnRequestHideInput start."); auto data = GetReadyImeData(ImeType::IME); - if (data == nullptr) { - IMSA_HILOGE("ime: %{public}d doesn't exist!", ImeType::IME); - return ErrorCode::ERROR_IME_NOT_STARTED; + if (data != nullptr) { + auto ret = RequestIme(data, RequestType::REQUEST_HIDE, [&data] { return data->core->HideKeyboard(); }); + if (ret != ErrorCode::NO_ERROR) { + IMSA_HILOGE("failed to hide keyboard, ret: %{public}d!", ret); + return ErrorCode::ERROR_KBD_HIDE_FAILED; + } } - auto ret = RequestIme(data, RequestType::REQUEST_HIDE, [&data] { return data->core->HideKeyboard(); }); - if (ret != ErrorCode::NO_ERROR) { - IMSA_HILOGE("failed to hide keyboard, ret: %{public}d!", ret); - return ErrorCode::ERROR_KBD_HIDE_FAILED; - } auto currentClient = GetCurrentClient(); if (currentClient != nullptr) { UpdateClientInfo(currentClient->AsObject(), { { UpdateFlag::ISSHOWKEYBOARD, false } }); -- Gitee