Merge pull request !1211 from hemenghao/master
This commit is contained in:
openharmony_ci 2024-05-31 06:10:08 +00:00 committed by Gitee
commit 16004b72bc
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 18 additions and 2 deletions

View File

@ -44,7 +44,7 @@ constexpr double INVALID_CURSOR_VALUE = -1.0;
constexpr int32_t INVALID_SELECTION_VALUE = -1;
constexpr uint32_t FIND_PANEL_RETRY_INTERVAL = 10;
constexpr uint32_t MAX_RETRY_TIMES = 100;
constexpr int32_t START_INPUT_PROCESS_TIMEOUT = 1500;
constexpr int32_t START_INPUT_PROCESS_TIMEOUT = 500;
InputMethodAbility::InputMethodAbility() : msgHandler_(nullptr), stop_(false)
{
}

View File

@ -227,6 +227,16 @@ void PerUserSession::OnImeDied(const sptr<IInputMethodCore> &remote, ImeType typ
IMSA_HILOGI("type: %{public}d", type);
RemoveImeData(type, true);
InputTypeManager::GetInstance().Set(false);
auto currentImeInfo = ImeCfgManager::GetInstance().GetCurrentImeCfg(userId_);
if (currentImeInfo == nullptr) {
IMSA_HILOGE("currentImeInfo is nullptr");
return;
}
auto defaultImeInfo = ImeInfoInquirer::GetInstance().GetDefaultImeCfgProp();
if (defaultImeInfo == nullptr) {
IMSA_HILOGE("defaultImeInfo is nullptr");
return;
}
auto client = GetCurrentClient();
auto clientInfo = client != nullptr ? GetClientInfo(client->AsObject()) : nullptr;
if (clientInfo != nullptr && clientInfo->bindImeType == type) {
@ -234,8 +244,14 @@ void PerUserSession::OnImeDied(const sptr<IInputMethodCore> &remote, ImeType typ
if (type == ImeType::IME && !isSwitching_.load()) {
RestartIme();
}
} else {
if (type == ImeType::IME && !isSwitching_.load() && currentImeInfo->bundleName == defaultImeInfo->name) {
RestartIme();
}
}
if (!isSwitching_.load()) {
NotifyImeStopFinished();
}
NotifyImeStopFinished();
}
int32_t PerUserSession::RemoveIme(const sptr<IInputMethodCore> &core, ImeType type)