summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Keeler <jacob.keeler@livioradio.com>2018-09-07 11:00:29 -0400
committerGitHub <noreply@github.com>2018-09-07 11:00:29 -0400
commit28235f88a6733106a7e8a0d490dfb16a5f374a33 (patch)
tree74c2002e1f393a085660f36e8610522b758f8731
parent08e2e6ed06bbcd68c4e84f06e2c2f3b414cb8215 (diff)
parent922fd38b6fd9399bb9467d7f5b17dcd03f832afc (diff)
downloadsdl_core-fix/sdl_use_incorrect_url_on_system_request.tar.gz
Merge pull request #2583 from AByzhynar/fix/Set_SmartObject_print_in_DEBUG_build_mode_onlyfix/sdl_use_incorrect_url_on_system_request
Rework usage of PrintSmartObject function
-rw-r--r--src/components/application_manager/include/application_manager/message_helper.h8
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc2
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc7
-rw-r--r--src/components/application_manager/src/rpc_service_impl.cc3
4 files changed, 11 insertions, 9 deletions
diff --git a/src/components/application_manager/include/application_manager/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h
index 010816808c..609b240301 100644
--- a/src/components/application_manager/include/application_manager/message_helper.h
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -700,6 +700,14 @@ class MessageHelper {
ApplicationSharedPtr app,
int32_t function_id);
+ /**
+ * @brief Prints SmartObject contents to log file
+ * @param object - SmartObject to print
+ * @return always True as this function is used for internal debug purposes
+ * only
+ * @note Function prints SmartObject only in DEBUG build mode. There will not
+ * be any print in RELEASE build mode
+ */
static bool PrintSmartObject(const smart_objects::SmartObject& object);
template <typename From, typename To>
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 69040997fe..eaac84dcf2 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -1305,9 +1305,7 @@ bool ApplicationManagerImpl::StartNaviService(
return false;
} else if (!converted_params.empty()) {
LOG4CXX_INFO(logger_, "Sending video configuration params");
-#ifdef DEBUG
MessageHelper::PrintSmartObject(converted_params);
-#endif
bool request_sent =
application(app_id)->SetVideoConfig(service_type, converted_params);
if (request_sent) {
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 eb074327ab..a52cb52fbe 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -2221,11 +2221,7 @@ void MessageHelper::SendSystemRequestNotification(
commands::CommandImpl::protocol_version_;
content[strings::params][strings::connection_key] = connection_key;
-
-#ifdef DEBUG
PrintSmartObject(content);
-#endif
-
DCHECK(app_mngr.GetRPCService().ManageMobileCommand(
std::make_shared<smart_objects::SmartObject>(content),
commands::Command::SOURCE_SDL));
@@ -2876,11 +2872,12 @@ void MessageHelper::SubscribeApplicationToSoftButton(
}
bool MessageHelper::PrintSmartObject(const smart_objects::SmartObject& object) {
+#ifdef DEBUG
Json::Value tmp;
namespace Formatters = ns_smart_device_link::ns_json_handler::formatters;
Formatters::CFormatterJsonBase::objToJsonValue(object, tmp);
LOG4CXX_DEBUG(logger_, "SMART OBJECT: " << tmp.toStyledString());
-
+#endif
return true;
}
diff --git a/src/components/application_manager/src/rpc_service_impl.cc b/src/components/application_manager/src/rpc_service_impl.cc
index 217af091b5..7a68ae5779 100644
--- a/src/components/application_manager/src/rpc_service_impl.cc
+++ b/src/components/application_manager/src/rpc_service_impl.cc
@@ -71,9 +71,8 @@ bool RPCServiceImpl::ManageMobileCommand(
LOG4CXX_WARN(logger_, "Low Voltage is active");
return false;
}
-#ifdef DEBUG
+
MessageHelper::PrintSmartObject(*message);
-#endif
const uint32_t connection_key = static_cast<uint32_t>(
(*message)[strings::params][strings::connection_key].asUInt());