diff options
author | JackLivio <jack@livio.io> | 2019-02-01 09:50:45 -0500 |
---|---|---|
committer | JackLivio <jack@livio.io> | 2019-02-01 09:50:45 -0500 |
commit | 19b7312d7bef764e8362640165dd4f1e0b5e5c58 (patch) | |
tree | b6e162f7a1ad226a082d164852097474f01d99e6 /src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile | |
parent | 09c5a34c1d00ace9af5310aad08e04a077eff121 (diff) | |
parent | d85e7f2e5a844145149a480f8e5d2d8cdcc1a013 (diff) | |
download | sdl_core-19b7312d7bef764e8362640165dd4f1e0b5e5c58.tar.gz |
Merge remote-tracking branch 'origin/develop' into feature/base_app_services_implementation
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile')
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc | 36 |
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] = |