mirror of
https://github.com/openharmony/miscservices_inputmethod.git
synced 2026-07-22 00:15:21 -04:00
fix SwitchInputMethod error
Signed-off-by: zhaolinglan <zhaolinglan@huawei.com>
This commit is contained in:
@@ -290,9 +290,10 @@ namespace MiscServices {
|
||||
want.SetElementName(imeId.substr(0, pos), imeId.substr(pos + 1));
|
||||
int32_t result = abms->StartAbility(want);
|
||||
if (result) {
|
||||
IMSA_HILOGE("InputMethodSystemAbility::StartInputService fail. result = %{public}d", result);
|
||||
IMSA_HILOGE("InputMethodSystemAbility::StartInputService fail.");
|
||||
isStartSuccess = false;
|
||||
} else {
|
||||
IMSA_HILOGE("InputMethodSystemAbility::StartInputService success.");
|
||||
isStartSuccess = true;
|
||||
}
|
||||
}
|
||||
@@ -302,7 +303,7 @@ namespace MiscServices {
|
||||
auto callback = [this, imeId]() { StartInputService(imeId); };
|
||||
serviceHandler_->PostTask(callback, INIT_INTERVAL);
|
||||
}
|
||||
return isStartSuccess;
|
||||
return isStartSuccess;
|
||||
}
|
||||
|
||||
void InputMethodSystemAbility::StopInputService(std::string imeId)
|
||||
@@ -633,8 +634,7 @@ namespace MiscServices {
|
||||
MessageParcel *data = msg->msgContent_;
|
||||
int32_t userId = data->ReadInt32();
|
||||
InputMethodProperty *target = InputMethodProperty::Unmarshalling(*data);
|
||||
auto ret = OnSwitchInputMethod(userId, target);
|
||||
msg->msgReply_->WriteInt32(ret);
|
||||
OnSwitchInputMethod(userId, target);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@@ -990,7 +990,7 @@ namespace MiscServices {
|
||||
}
|
||||
|
||||
std::string defaultIme = ParaHandle::GetDefaultIme(userId_);
|
||||
std::string targetIme = "";
|
||||
std::string targetIme;
|
||||
std::string imeId = Str16ToStr8(target->mPackageName) + "/" + Str16ToStr8(target->mAbilityName);
|
||||
targetIme += imeId;
|
||||
IMSA_HILOGI("InputMethodSystemAbility::OnSwitchInputMethod DefaultIme : %{public}s, TargetIme : %{public}s",
|
||||
|
||||
Reference in New Issue
Block a user