diff --git a/frameworks/inputmethod_controller/include/input_method_controller.h b/frameworks/inputmethod_controller/include/input_method_controller.h index 31a4e059f9877ae280e86898fc224a5c49054ab8..832d7d531d2d8220a78a005dd68ea9d7b2da69b6 100644 --- a/frameworks/inputmethod_controller/include/input_method_controller.h +++ b/frameworks/inputmethod_controller/include/input_method_controller.h @@ -47,8 +47,8 @@ namespace MiscServices { class InputMethodController : public RefBase { public: static sptr GetInstance(); - void Attach(); - void ShowTextInput(sptr &listener); + void Attach(sptr &listener); + void ShowTextInput(); void HideTextInput(); void Close(); void OnRemoteSaDied(const wptr &object); diff --git a/frameworks/inputmethod_controller/src/input_method_controller.cpp b/frameworks/inputmethod_controller/src/input_method_controller.cpp index c2fd6ab72730a138ff9fd42e32c5e560b6e0c278..5d119db48f0f4c0a65b525f006edd9a1b61a751d 100644 --- a/frameworks/inputmethod_controller/src/input_method_controller.cpp +++ b/frameworks/inputmethod_controller/src/input_method_controller.cpp @@ -151,15 +151,15 @@ using namespace MessageID; } } - void InputMethodController::Attach() + void InputMethodController::Attach(sptr &listener) { PrepareInput(0,mClient,mInputDataChannel,mAttribute); + textListener=listener; } - void InputMethodController::ShowTextInput(sptr &listener) + void InputMethodController::ShowTextInput() { IMSA_HILOGI("InputMethodController::ShowTextInput"); - textListener=listener; StartInput(mClient); } diff --git a/services/src/peruser_session.cpp b/services/src/peruser_session.cpp index d9c51fe5f704372fd6a07c7e73ac07c03c14c5b5..555d248987139af7bdad694679191a319909b936 100644 --- a/services/src/peruser_session.cpp +++ b/services/src/peruser_session.cpp @@ -32,6 +32,7 @@ #include "input_control_channel_proxy.h" #include "ipc_skeleton.h" #include "input_method_core_proxy.h" +#include "unistd.h" namespace OHOS { namespace MiscServices { @@ -1324,6 +1325,7 @@ namespace MiscServices { IMSA_HILOGI("PerUserSession::OnPrepareInput BindInputAbility start"); BindInputAbility(); IMSA_HILOGI("PerUserSession::OnPrepareInput BindInputAbility end"); + currentClient = client; } /*! Release input. Called by an input client. @@ -1393,6 +1395,15 @@ namespace MiscServices { } else { IMSA_HILOGI("PerUserSession::onSetInputMethodCore End...[%{public}d]\n", userId_); } + if (currentClient != nullptr) { + usleep(300000); + ret = ShowKeyboard(currentClient); + if (ret != ErrorCode::NO_ERROR) { + IMSA_HILOGE("PerUserSession::OnStartInput Aborted! %{public}s", ErrorCode::ToString(ret)); + } else { + IMSA_HILOGI("PerUserSession::OnStartInput End...[%{public}d]\n", userId_); + } + } } /*! Stop input. Called by an input client.