Signed-off-by: guojin31 <guojin31@huawei.com>
This commit is contained in:
guojin31 2024-04-20 17:45:15 +08:00
parent 39d61b3129
commit 7bd28e68e2
4 changed files with 6 additions and 7 deletions

View File

@ -149,7 +149,7 @@ private:
int32_t ShowPanel(const std::shared_ptr<InputMethodPanel> &inputMethodPanel, PanelFlag flag, Trigger trigger);
int32_t HidePanel(const std::shared_ptr<InputMethodPanel> &inputMethodPanel, PanelFlag flag, Trigger trigger);
int32_t NotifyIsShowSysPanel(const std::shared_ptr<InputMethodPanel> &inputMethodPanel, PanelFlag flag);
void SaveInputAttribute(const InputAttribute &inputAttribute);
void SetInputAttribute(const InputAttribute &inputAttribute);
InputAttribute GetInputAttribute();
void ClearInputAttribute();
void NotifyPanelStatusInfo(const PanelStatusInfo &info);

View File

@ -241,7 +241,7 @@ int32_t InputMethodAbility::StartInput(const InputClientInfo &clientInfo, bool i
"IMA isShowKeyboard: %{public}d, isBindFromClient: %{public}d", clientInfo.isShowKeyboard, isBindFromClient);
SetInputDataChannel(clientInfo.channel->AsObject());
isBindFromClient ? InvokeTextChangeCallback(clientInfo.config) : NotifyAllTextConfig();
SaveInputAttribute(clientInfo.config.inputAttribute);
SetInputAttribute(clientInfo.config.inputAttribute);
if (imeListener_ == nullptr) {
IMSA_HILOGE("imeListener is nullptr");
return ErrorCode::ERROR_IME;
@ -371,7 +371,7 @@ void InputMethodAbility::OnConfigurationChange(Message *msg)
attribute.inputPattern = data->ReadInt32();
IMSA_HILOGD("InputMethodAbility, enterKeyType: %{public}d, inputPattern: %{public}d", attribute.enterKeyType,
attribute.inputPattern);
SaveInputAttribute(attribute);
SetInputAttribute(attribute);
// add for mod inputPattern when panel show
auto panel = GetSoftKeyboardPanel();
if (panel != nullptr) {
@ -905,7 +905,7 @@ int32_t InputMethodAbility::NotifyIsShowSysPanel(
return systemChannel->NotifyIsShowSysPanel(isShow);
}
void InputMethodAbility::SaveInputAttribute(const InputAttribute &inputAttribute)
void InputMethodAbility::SetInputAttribute(const InputAttribute &inputAttribute)
{
std::lock_guard<std::mutex> lock(inputAttrLock_);
inputAttribute_ = inputAttribute;

View File

@ -45,7 +45,7 @@ int32_t SystemCmdChannelProxy::SendRequest(int code, ParcelHandler input, Parcel
IMSA_HILOGD("SystemCmdChannelProxy run in, code = %{public}d", code);
MessageParcel data;
MessageParcel reply;
MessageOption option{ MessageOption::TF_SYNC };
MessageOption option{ MessageOption::TF_ASYNC };
if (!data.WriteInterfaceToken(GetDescriptor())) {
IMSA_HILOGE("SystemCmdChannelProxy::write interface token failed");
return ErrorCode::ERROR_EX_ILLEGAL_ARGUMENT;

View File

@ -482,14 +482,13 @@ int32_t PerUserSession::OnStartInput(const InputClientInfo &inputClientInfo, spt
InputClientInfo infoTemp = *clientInfo;
infoTemp.isShowKeyboard = inputClientInfo.isShowKeyboard;
infoTemp.isNotifyInputStart = inputClientInfo.isNotifyInputStart;
infoTemp.config = inputClientInfo.config;
auto imeType = IsProxyImeEnable() ? ImeType::PROXY_IME : ImeType::IME;
int32_t ret = BindClientWithIme(std::make_shared<InputClientInfo>(infoTemp), imeType, true);
if (ret != ErrorCode::NO_ERROR) {
IMSA_HILOGE("bind failed, ret: %{public}d", ret);
return ret;
}
auto data = GetImeData(imeType);
auto data = GetImeData(imeType);
if (data == nullptr || data->agent == nullptr) {
IMSA_HILOGE("data or agent is nullptr.");
return ErrorCode::ERROR_IME_NOT_STARTED;