Signed-off-by: wangdongqi <wangdongqi2@huawei.com>

Changes to be committed:
This commit is contained in:
wangdongqi 2024-10-14 22:36:41 +08:00
parent 07c35149bb
commit a0311739fe

View File

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