summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/message_helper/message_helper.cc
diff options
context:
space:
mode:
authorAlexander Kutsan <AKutsan@luxoft.com>2016-11-18 18:12:45 +0200
committerAlexander Kutsan <AKutsan@luxoft.com>2016-12-05 09:33:20 +0200
commit16891012aadef1839f460ddae51d7ee71c2d6ff0 (patch)
treed5b385a0088605c4028b64218d8ecc339e5981a3 /src/components/application_manager/src/message_helper/message_helper.cc
parent84f3d3bcd54c1ae1b842e3660c905d9f78cf9d25 (diff)
downloadsdl_core-16891012aadef1839f460ddae51d7ee71c2d6ff0.tar.gz
Fix usages of policy in code
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.cc58
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);