diff options
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc')
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc index 2a5c0ab016..e32dbf3c47 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc @@ -56,6 +56,17 @@ UIGetLanguageResponse::~UIGetLanguageResponse() {} void UIGetLanguageResponse::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::UI_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; @@ -67,6 +78,12 @@ void UIGetLanguageResponse::Run() { hmi_capabilities_.set_active_ui_language(language); + std::vector<std::string> sections_to_update{hmi_response::language}; + if (!hmi_capabilities_.SaveCachedCapabilitiesToFile( + hmi_interface::ui, sections_to_update, message_->getSchema())) { + LOG4CXX_ERROR(logger_, "Failed to save UI.GetLanguage response to cache"); + } + LOG4CXX_DEBUG(logger_, "Raising event for function_id " << function_id() << " and correlation_id " |