summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/message_helper/message_helper.cc
diff options
context:
space:
mode:
authormked-luxoft <mked@luxoft.com>2019-08-23 14:42:15 +0300
committermked-luxoft <mked@luxoft.com>2019-08-29 17:56:41 +0300
commit2d53a14e603cce00709307797725c3cc595129d3 (patch)
tree87ae9bd406be0fad5e02d40e1ed2e4aa18f94a36 /src/components/application_manager/src/message_helper/message_helper.cc
parent3f86f3864ae18515c5d1a9ddaf9f7fcaf4d59c62 (diff)
downloadsdl_core-2d53a14e603cce00709307797725c3cc595129d3.tar.gz
Remove notification builder
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.cc51
1 files changed, 19 insertions, 32 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 5c9e0e80b1..31eaa54e5d 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -2234,45 +2234,32 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateNegativeResponse(
return std::make_shared<smart_objects::SmartObject>(response_data);
}
-MessageHelper::ServiceStatusUpdateNotificationBuilder::
- ServiceStatusUpdateNotificationBuilder(const ServiceType service_type,
- const ServiceEvent service_event) {
- notification_ = MessageHelper::CreateHMINotification(
+smart_objects::SmartObjectSPtr MessageHelper::CreateOnServiceUpdateNotification(
+ const hmi_apis::Common_ServiceType::eType service_type,
+ const hmi_apis::Common_ServiceEvent::eType service_event,
+ const hmi_apis::Common_ServiceStatusUpdateReason::eType
+ service_update_reason,
+ const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ auto notification = MessageHelper::CreateHMINotification(
hmi_apis::FunctionID::BasicCommunication_OnServiceUpdate);
- (*notification_)[strings::msg_params][hmi_notification::service_type] =
+ (*notification)[strings::msg_params][hmi_notification::service_type] =
service_type;
- (*notification_)[strings::msg_params][hmi_notification::service_event] =
+ (*notification)[strings::msg_params][hmi_notification::service_event] =
service_event;
-}
-
-MessageHelper::ServiceStatusUpdateNotificationBuilder
-MessageHelper::ServiceStatusUpdateNotificationBuilder::CreateBuilder(
- const ServiceType service_type, const ServiceEvent service_event) {
- MessageHelper::ServiceStatusUpdateNotificationBuilder builder{service_type,
- service_event};
- return builder;
-}
-
-MessageHelper::ServiceStatusUpdateNotificationBuilder&
-MessageHelper::ServiceStatusUpdateNotificationBuilder::AddAppID(
- const uint32_t app_id) {
- (*notification_)[strings::msg_params][strings::app_id] = app_id;
- return *this;
-}
+ if (0 != app_id) {
+ (*notification)[strings::msg_params][strings::app_id] = app_id;
+ }
-MessageHelper::ServiceStatusUpdateNotificationBuilder&
-MessageHelper::ServiceStatusUpdateNotificationBuilder::AddServiceUpdateReason(
- const ServiceStatusUpdateReason service_update_reason) {
- (*notification_)[strings::msg_params][hmi_notification::reason] =
- service_update_reason;
+ if (hmi_apis::Common_ServiceStatusUpdateReason::INVALID_ENUM !=
+ service_update_reason) {
+ (*notification)[strings::msg_params][hmi_notification::reason] =
+ service_update_reason;
+ }
- return *this;
-}
-smart_objects::SmartObjectSPtr
-MessageHelper::ServiceStatusUpdateNotificationBuilder::notification() const {
- return notification_;
+ return notification;
}
void MessageHelper::SendNaviSetVideoConfig(