mirror of
https://github.com/openharmony/miscservices_inputmethod.git
synced 2026-07-20 23:45:31 -04:00
@@ -47,8 +47,8 @@ namespace MiscServices {
|
||||
class InputMethodController : public RefBase {
|
||||
public:
|
||||
static sptr<InputMethodController> GetInstance();
|
||||
void Attach();
|
||||
void ShowTextInput(sptr<OnTextChangedListener> &listener);
|
||||
void Attach(sptr<OnTextChangedListener> &listener);
|
||||
void ShowTextInput();
|
||||
void HideTextInput();
|
||||
void Close();
|
||||
void OnRemoteSaDied(const wptr<IRemoteObject> &object);
|
||||
|
||||
@@ -151,15 +151,15 @@ using namespace MessageID;
|
||||
}
|
||||
}
|
||||
|
||||
void InputMethodController::Attach()
|
||||
void InputMethodController::Attach(sptr<OnTextChangedListener> &listener)
|
||||
{
|
||||
PrepareInput(0,mClient,mInputDataChannel,mAttribute);
|
||||
textListener=listener;
|
||||
}
|
||||
|
||||
void InputMethodController::ShowTextInput(sptr<OnTextChangedListener> &listener)
|
||||
void InputMethodController::ShowTextInput()
|
||||
{
|
||||
IMSA_HILOGI("InputMethodController::ShowTextInput");
|
||||
textListener=listener;
|
||||
StartInput(mClient);
|
||||
}
|
||||
|
||||
|
||||
@@ -146,6 +146,7 @@ namespace MiscServices {
|
||||
std::mutex mtx; // mutex to lock the operations among multi work threads
|
||||
sptr<AAFwk::AbilityConnectionProxy> connCallback;
|
||||
sptr<InputMethodAbility> inputMethodAbility_;
|
||||
int SLEEP_TIME = 300000;
|
||||
|
||||
PerUserSession(const PerUserSession&);
|
||||
PerUserSession& operator= (const PerUserSession&);
|
||||
|
||||
@@ -1324,6 +1324,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 +1394,15 @@ namespace MiscServices {
|
||||
} else {
|
||||
IMSA_HILOGI("PerUserSession::onSetInputMethodCore End...[%{public}d]\n", userId_);
|
||||
}
|
||||
if (currentClient != nullptr) {
|
||||
usleep(SLEEP_TIME);
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user