From b2a71d0099f8422ae6af2e5fe2555a27a2193092 Mon Sep 17 00:00:00 2001 From: zhouyongfei Date: Wed, 20 Oct 2021 14:56:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=BE=93=E5=85=A5=E6=B3=95?= =?UTF-8?q?=E5=81=B6=E5=B0=94=E7=99=BD=E5=B1=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhouyongfei --- .../src/input_method_ability.cpp | 2 ++ services/src/peruser_session.cpp | 6 +++--- services/src/peruser_setting.cpp | 16 +++++++++------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/frameworks/inputmethod_ability/src/input_method_ability.cpp b/frameworks/inputmethod_ability/src/input_method_ability.cpp index 3d7c395..c14fd5f 100644 --- a/frameworks/inputmethod_ability/src/input_method_ability.cpp +++ b/frameworks/inputmethod_ability/src/input_method_ability.cpp @@ -38,6 +38,8 @@ namespace MiscServices { InputMethodAbility::~InputMethodAbility() { + IMSA_HILOGI("InputMethodAbility::~InputMethodAbility"); + instance_ = nullptr; if (msgHandler != nullptr) { delete msgHandler; msgHandler = nullptr; diff --git a/services/src/peruser_session.cpp b/services/src/peruser_session.cpp index 7884b3c..e7c7de9 100644 --- a/services/src/peruser_session.cpp +++ b/services/src/peruser_session.cpp @@ -329,8 +329,8 @@ namespace MiscServices { IMSA_HILOGI("PerUserSession::AddClient"); ClientInfo *clientInfo = GetClientInfo(inputClient); if (clientInfo != nullptr) { - IMSA_HILOGE("PerUserSession::AddClient clientInfo is not nullptr"); - return ErrorCode::ERROR_CLIENT_DUPLICATED; + IMSA_HILOGE("PerUserSession::AddClient clientInfo is exist, not need add."); + return ErrorCode::NO_ERROR; } sptr obj = inputClient->AsObject(); @@ -1296,7 +1296,6 @@ namespace MiscServices { } if (imsCore[index] != nullptr) { IMSA_HILOGI("PerUserSession::onSetInputMethodCore End... Input Method Service has already been started ! "); - return; } imsCore[index] = core; int ret = StartInputMethod(index); @@ -1314,6 +1313,7 @@ namespace MiscServices { IMSA_HILOGI("PerUserSession::OnStartInput End...[%{public}d]\n", userId_); } } + IMSA_HILOGI("PerUserSession::OnStartInput End. currentClient is nullptr"); } /*! Stop input. Called by an input client. diff --git a/services/src/peruser_setting.cpp b/services/src/peruser_setting.cpp index 6b241c3..5dcdf45 100644 --- a/services/src/peruser_setting.cpp +++ b/services/src/peruser_setting.cpp @@ -117,13 +117,15 @@ namespace MiscServices { return ErrorCode::NO_ERROR; } - /*! Remove an input method engine. - \n It's called when a package is removed from the system. - \param packageName the package name of installed package. - \param[out] isSecurityIme check if the removed ime is a security ime. - \return ErrorCode::NO_ERROR The removed package is an IME package, and is removed from the input method management system - \return ErrorCode::ERROR_NOT_IME_PACKAGE The removed package is not an IME package. - */ + /** + * Remove an input method engine. + * It's called when a package is removed from the system. + * @param packageName the package name of installed package. + * @param isSecurityIme check if the removed ime is a security ime. + * @return ErrorCode::NO_ERROR The removed package is an IME package, + * and is removed from the input method management system + * ErrorCode::ERROR_NOT_IME_PACKAGE The removed package is not an IME package. + */ int PerUserSetting::OnPackageRemoved(std::u16string& packageName, bool isSecurityIme) { if (isSecurityIme) {