!1515 回退pr 1550

Merge pull request !1515 from wangdongqi/master
This commit is contained in:
openharmony_ci 2024-10-14 14:28:28 +00:00 committed by Gitee
commit 07c35149bb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -92,23 +92,15 @@ bool InputTypeManager::IsStarted()
bool InputTypeManager::IsSecurityImeStarted() bool InputTypeManager::IsSecurityImeStarted()
{ {
if (!IsStarted()) { std::lock_guard<std::mutex> lock(stateLock_);
return false; return isStarted_ && inputTypes_.find(InputType::SECURITY_INPUT) != inputTypes_.end() &&
}
std::lock_guard<std::mutex> lock(typesLock_);
return inputTypes_.find(InputType::SECURITY_INPUT) != inputTypes_.end() &&
inputTypes_[InputType::SECURITY_INPUT] == currentTypeIme_; inputTypes_[InputType::SECURITY_INPUT] == currentTypeIme_;
} }
bool InputTypeManager::IsCameraImeStarted() bool InputTypeManager::IsCameraImeStarted()
{ {
if (!IsStarted()) { std::lock_guard<std::mutex> lock(stateLock_);
return false; return isStarted_ && inputTypes_.find(InputType::CAMERA_INPUT) != inputTypes_.end() &&
}
std::lock_guard<std::mutex> lock(typesLock_);
return inputTypes_.find(InputType::CAMERA_INPUT) != inputTypes_.end() &&
inputTypes_[InputType::CAMERA_INPUT] == currentTypeIme_; inputTypes_[InputType::CAMERA_INPUT] == currentTypeIme_;
} }