diff options
Diffstat (limited to 'src/components/application_manager/src/message_helper/message_helper.cc')
-rw-r--r-- | src/components/application_manager/src/message_helper/message_helper.cc | 58 |
1 files changed, 50 insertions, 8 deletions
diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc index a764c574d0..ae4205d051 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -251,6 +251,25 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateHashUpdateNotification( return message; } +void MessageHelper::SendDecryptCertificateToHMI(const std::string& file_name, + ApplicationManager& app_mngr) { + using namespace smart_objects; + SmartObjectSPtr message = + CreateRequestObject(app_mngr.GetNextHMICorrelationID()); + DCHECK(message); + + SmartObject& object = *message; + object[strings::params][strings::function_id] = + hmi_apis::FunctionID::BasicCommunication_DecryptCertificate; + + SmartObject msg_params = SmartObject(SmartType_Map); + + msg_params[hmi_request::file_name] = file_name; + object[strings::msg_params] = msg_params; + + app_mngr.ManageHMICommand(message); +} + void MessageHelper::SendHashUpdateNotification(const uint32_t app_id, ApplicationManager& app_mngr) { LOG4CXX_AUTO_TRACE(logger_); @@ -1451,12 +1470,12 @@ void MessageHelper::SendSDLActivateAppResponse( GetPriorityCode(permissions.priority); } + app_mngr.ManageHMICommand(message); + // If application is revoked it should not be activated if (permissions.appRevoked || !permissions.isSDLAllowed) { return; } - - app_mngr.ManageHMICommand(message); } void MessageHelper::SendOnSDLConsentNeeded( @@ -1496,15 +1515,16 @@ void MessageHelper::SendPolicyUpdate(const std::string& file_path, } app_mngr.ManageHMICommand(message); } - void MessageHelper::SendGetUserFriendlyMessageResponse( const std::vector<policy::UserFriendlyMessage>& msg, - uint32_t correlation_id, + const uint32_t correlation_id, ApplicationManager& app_mngr) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr message = - utils::MakeShared<smart_objects::SmartObject>( - smart_objects::SmartType_Map); + new smart_objects::SmartObject(smart_objects::SmartType_Map); + if (!message) { + return; + } (*message)[strings::params][strings::function_id] = hmi_apis::FunctionID::SDL_GetUserFriendlyMessage; @@ -1524,9 +1544,14 @@ void MessageHelper::SendGetUserFriendlyMessageResponse( smart_objects::SmartObject& user_friendly_messages = (*message)[strings::msg_params][messages]; - +#ifdef EXTENDED_PROPRIETARY + const std::string tts = "ttsString"; + const std::string label = "label"; + const std::string line1 = "line1"; + const std::string line2 = "line2"; + const std::string textBody = "textBody"; +#endif // EXTENDED_PROPRIETARY const std::string message_code = "messageCode"; - std::vector<policy::UserFriendlyMessage>::const_iterator it = msg.begin(); std::vector<policy::UserFriendlyMessage>::const_iterator it_end = msg.end(); for (uint32_t index = 0; it != it_end; ++it, ++index) { @@ -1535,6 +1560,23 @@ void MessageHelper::SendGetUserFriendlyMessageResponse( smart_objects::SmartObject& obj = user_friendly_messages[index]; obj[message_code] = it->message_code; +#ifdef EXTENDED_PROPRIETARY + if (!it->tts.empty()) { + obj[tts] = it->tts; + } + if (!it->label.empty()) { + obj[label] = it->label; + } + if (!it->line1.empty()) { + obj[line1] = it->line1; + } + if (!it->line2.empty()) { + obj[line2] = it->line2; + } + if (!it->text_body.empty()) { + obj[textBody] = it->text_body; + } +#endif // EXTENDED_PROPRIETARY } app_mngr.ManageHMICommand(message); |