diff options
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc')
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc index f89baad737..293857f8d5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc @@ -59,20 +59,31 @@ OnTTSLanguageChangeNotification::~OnTTSLanguageChangeNotification() {} void OnTTSLanguageChangeNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); - HMICapabilities& hmi_capabilities = hmi_capabilities_; - - hmi_capabilities.set_active_tts_language( + hmi_capabilities_.set_active_tts_language( static_cast<hmi_apis::Common_Language::eType>( (*message_)[strings::msg_params][strings::language].asInt())); /* need to clarify, because unchanged VR cause WRONG_LANGUAGE on Register */ - hmi_capabilities.set_active_vr_language( + hmi_capabilities_.set_active_vr_language( static_cast<hmi_apis::Common_Language::eType>( (*message_)[strings::msg_params][strings::language].asInt())); + std::vector<std::string> sections_to_update{hmi_response::language}; + if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( + hmi_interface::tts, sections_to_update, message_->getSchema())) { + LOG4CXX_ERROR(logger_, + "Failed to save TTS.OnLanguageChange response to cache"); + } + + if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( + hmi_interface::vr, sections_to_update, message_->getSchema())) { + LOG4CXX_ERROR(logger_, + "Failed to save VR.OnLanguageChange response to cache"); + } + (*message_)[strings::msg_params][strings::hmi_display_language] = - hmi_capabilities.active_ui_language(); + hmi_capabilities_.active_ui_language(); (*message_)[strings::params][strings::function_id] = static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID); |