From 371ff0be01b79c7cbf66e9e240a1c3d496cd5729 Mon Sep 17 00:00:00 2001 From: zhouyongfei Date: Fri, 11 Mar 2022 09:11:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B4=A9=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhouyongfei --- .../js/napi/inputmethod/include/js_input_method_utils.h | 1 - services/src/peruser_session.cpp | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/interfaces/kits/js/napi/inputmethod/include/js_input_method_utils.h b/interfaces/kits/js/napi/inputmethod/include/js_input_method_utils.h index fa323542..5fee57ab 100644 --- a/interfaces/kits/js/napi/inputmethod/include/js_input_method_utils.h +++ b/interfaces/kits/js/napi/inputmethod/include/js_input_method_utils.h @@ -22,7 +22,6 @@ #include "js_input_method_setting.h" namespace OHOS { namespace MiscServices { -// class JsInputMethodSetting; NativeValue *CreateInputMethodSetting(NativeEngine& engine); NativeValue *CreateInputMethodController(NativeEngine& engine); } diff --git a/services/src/peruser_session.cpp b/services/src/peruser_session.cpp index 799bb79d..2e9c2b1f 100644 --- a/services/src/peruser_session.cpp +++ b/services/src/peruser_session.cpp @@ -1221,7 +1221,9 @@ namespace MiscServices { sptr client = new InputClientProxy(clientObject); sptr interface = client; int remainClientNum = 0; - imsCore[0]->SetClientState(false); + if(imsCore[0] != nullptr) { + imsCore[0]->SetClientState(false); + } HideKeyboard(client); int ret = RemoveClient(client, remainClientNum); if (ret != ErrorCode::NO_ERROR) { @@ -1241,7 +1243,9 @@ namespace MiscServices { MessageParcel *data = msg->msgContent_; sptr clientObject = data->ReadRemoteObject(); sptr client = new InputClientProxy(clientObject); - imsCore[0]->SetClientState(true); + if(imsCore[0] != nullptr) { + imsCore[0]->SetClientState(true); + } ShowKeyboard(client); } From 94fd40139a4db4ecc7cae1d6e471a6251610a976 Mon Sep 17 00:00:00 2001 From: zhouyongfei Date: Fri, 11 Mar 2022 10:33:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhouyongfei --- services/src/peruser_session.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/src/peruser_session.cpp b/services/src/peruser_session.cpp index 2e9c2b1f..1b6d18ac 100644 --- a/services/src/peruser_session.cpp +++ b/services/src/peruser_session.cpp @@ -1221,7 +1221,7 @@ namespace MiscServices { sptr client = new InputClientProxy(clientObject); sptr interface = client; int remainClientNum = 0; - if(imsCore[0] != nullptr) { + if (imsCore[0] != nullptr) { imsCore[0]->SetClientState(false); } HideKeyboard(client); @@ -1243,7 +1243,7 @@ namespace MiscServices { MessageParcel *data = msg->msgContent_; sptr clientObject = data->ReadRemoteObject(); sptr client = new InputClientProxy(clientObject); - if(imsCore[0] != nullptr) { + if (imsCore[0] != nullptr) { imsCore[0]->SetClientState(true); } ShowKeyboard(client);