diff --git a/frameworks/native/inputmethod_controller/src/input_method_controller.cpp b/frameworks/native/inputmethod_controller/src/input_method_controller.cpp index 70a4a355..1ec4ddb5 100644 --- a/frameworks/native/inputmethod_controller/src/input_method_controller.cpp +++ b/frameworks/native/inputmethod_controller/src/input_method_controller.cpp @@ -688,6 +688,7 @@ int32_t InputMethodController::OnConfigurationChange(Configuration info) IMSA_HILOGD("not bound."); return ErrorCode::ERROR_CLIENT_NOT_BOUND; } + bool oldSecurityFlag = textConfig_.inputAttribute.GetSecurityFlag(); InputAttribute attribute; { std::lock_guard lock(textConfigLock_); @@ -701,6 +702,15 @@ int32_t InputMethodController::OnConfigurationChange(Configuration info) } IMSA_HILOGI("IMC enterKeyType: %{public}d, textInputType: %{public}d.", attribute.enterKeyType, attribute.inputPattern); + if (oldSecurityFlag != attribute.GetSecurityFlag()) { + GetTextConfig(clientInfo_.config); + sptr agent = nullptr; + int32_t ret = StartInput(clientInfo_, agent); + if (ret != ErrorCode::NO_ERROR) { + return ret; + } + OnInputReady(agent); + } auto agent = GetAgent(); if (agent == nullptr) { IMSA_HILOGE("agent is nullptr!"); diff --git a/services/src/peruser_session.cpp b/services/src/peruser_session.cpp index 324f9fb4..20e0c21a 100644 --- a/services/src/peruser_session.cpp +++ b/services/src/peruser_session.cpp @@ -260,11 +260,11 @@ void PerUserSession::OnImeDied(const sptr &remote, ImeType typ auto imeData = GetImeData(type); auto ime = InputTypeManager::GetInstance().GetCurrentIme(); if (ime.bundleName == imeData->ime.first) { + InputTypeManager::GetInstance().Set(false); } if (imeData != nullptr && imeData->imeStatus == ImeStatus::EXITING) { RemoveImeData(type, true); NotifyImeStopFinished(); - InputTypeManager::GetInstance().Set(false); IMSA_HILOGI("%{public}d not current imeData.", type); return; }