fix SwitchInputMethod error

Signed-off-by: zhaolinglan <zhaolinglan@huawei.com>
This commit is contained in:
zhaolinglan
2022-07-19 11:55:12 +08:00
parent fc938defff
commit 9ff3ca2202
12 changed files with 64 additions and 63 deletions
+5 -5
View File
@@ -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",