diff options
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc')
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc index 627056dce1..1487fd7915 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc @@ -56,6 +56,18 @@ void TTSGetLanguageResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); using namespace hmi_apis; + const Common_Result::eType result_code = static_cast<Common_Result::eType>( + (*message_)[strings::params][hmi_response::code].asInt()); + + hmi_capabilities_.UpdateRequestsRequiredForCapabilities( + hmi_apis::FunctionID::TTS_GetLanguage); + + if (Common_Result::SUCCESS != result_code) { + LOG4CXX_DEBUG(logger_, + "Request was not successful. Don't change HMI capabilities"); + return; + } + Common_Language::eType language = Common_Language::INVALID_ENUM; if ((*message_).keyExists(strings::msg_params) && @@ -66,6 +78,12 @@ void TTSGetLanguageResponse::Run() { hmi_capabilities_.set_active_tts_language(language); + std::vector<std::string> sections_to_update{hmi_response::language}; + if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( + hmi_interface::tts, sections_to_update, message_->getSchema())) { + LOG4CXX_DEBUG(logger_, "Failed to save TTS.GetLanguage response to cache"); + } + LOG4CXX_DEBUG(logger_, "Raising event for function_id " << function_id() << " and correlation_id " |