summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcollin <collin@livio.io>2020-02-25 16:27:15 -0500
committercollin <collin@livio.io>2020-02-25 16:27:15 -0500
commitc08fc07e062b50f204e263ee315468008c354a44 (patch)
tree11de17d03cebc354cc1ae9e05d65d4dc75a986cc
parent8b166c146e3b3af1f7d8f9c38e63299d36293c3f (diff)
downloadsdl_core-fix/issue_2932.tar.gz
don't send onSystemRequest LOCK_SCREEN_ICON_URL to mobile if url is missingfix/issue_2932
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc15
1 files changed, 9 insertions, 6 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 fc99bb323c..b340055c50 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
@@ -126,9 +126,7 @@ void OnSystemRequestNotification::Run() {
if (mobile_apis::RequestType::OEM_SPECIFIC == request_type) {
(*message_)[strings::params][strings::binary_data] = binary_data;
- }
-
- if (mobile_apis::RequestType::PROPRIETARY == request_type) {
+ } else 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"
@@ -144,14 +142,19 @@ void OnSystemRequestNotification::Run() {
#endif // PROPRIETARY_MODE
(*message_)[strings::msg_params][strings::file_type] = FileType::JSON;
- }
-
- if (mobile_apis::RequestType::HTTP == request_type) {
+ } else 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] =
policy_handler.TimeoutExchangeSec();
}
+ } else if (mobile_apis::RequestType::LOCK_SCREEN_ICON_URL == request_type) {
+ if (!(*message_)[strings::msg_params].keyExists(strings::url) ||
+ (*message_)[strings::msg_params][strings::url].empty()) {
+ LOG4CXX_ERROR(logger_,
+ "discarding LOCK_SCREEN_ICON_URL request without URL");
+ return;
+ }
}
SendNotification();