summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc36
1 files changed, 28 insertions, 8 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
index b78e541f17..10b0b41a58 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
@@ -36,6 +36,7 @@
#include "sdl_rpc_plugin/commands/mobile/on_system_request_notification.h"
#include "interfaces/MOBILE_API.h"
#include "utils/file_system.h"
+#include "utils/helpers.h"
#include "policy/policy_table/enums.h"
#include "application_manager/application_manager.h"
#include "application_manager/policies/policy_handler_interface.h"
@@ -65,6 +66,7 @@ void OnSystemRequestNotification::Run() {
LOG4CXX_AUTO_TRACE(logger_);
using namespace application_manager;
using namespace mobile_apis;
+ using namespace helpers;
ApplicationSharedPtr app = application_manager_.application(connection_key());
@@ -106,17 +108,33 @@ void OnSystemRequestNotification::Run() {
}
}
- if (mobile_apis::RequestType::PROPRIETARY == request_type) {
- /* According to requirements:
- "If the requestType = PROPRIETARY, add to mobile API fileType = JSON
- If the requestType = HTTP, add to mobile API fileType = BINARY"
- Also in Genivi SDL we don't save the PT to file - we put it directly in
- binary_data */
+ LOG4CXX_DEBUG(logger_,
+ "Processing Request type : " << stringified_request_type);
+
+ const bool binary_data_is_required =
+ Compare<mobile_apis::RequestType::eType, EQ, ONE>(
+ request_type,
+ mobile_apis::RequestType::PROPRIETARY,
+ mobile_apis::RequestType::OEM_SPECIFIC);
+ BinaryMessage binary_data;
+ if (binary_data_is_required) {
const std::string filename =
(*message_)[strings::msg_params][strings::file_name].asString();
- BinaryMessage binary_data;
file_system::ReadBinaryFile(filename, binary_data);
+ }
+
+ if (mobile_apis::RequestType::OEM_SPECIFIC == request_type) {
+ (*message_)[strings::params][strings::binary_data] = binary_data;
+ }
+
+ if (mobile_apis::RequestType::PROPRIETARY == request_type) {
+/* According to requirements:
+ "If the requestType = PROPRIETARY, add to mobile API fileType = JSON
+ If the requestType = HTTP, add to mobile API fileType = BINARY"
+ Also in Genivi SDL we don't save the PT to file - we put it directly in
+ binary_data */
+
#if defined(PROPRIETARY_MODE)
AddHeader(binary_data);
#endif // PROPRIETARY_MODE
@@ -126,7 +144,9 @@ void OnSystemRequestNotification::Run() {
#endif // PROPRIETARY_MODE
(*message_)[strings::msg_params][strings::file_type] = FileType::JSON;
- } else if (mobile_apis::RequestType::HTTP == request_type) {
+ }
+
+ if (mobile_apis::RequestType::HTTP == request_type) {
(*message_)[strings::msg_params][strings::file_type] = FileType::BINARY;
if ((*message_)[strings::msg_params].keyExists(strings::url)) {
(*message_)[strings::msg_params][strings::timeout] =