diff options
author | Collin <iCollin@users.noreply.github.com> | 2020-02-26 16:31:38 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-26 16:31:38 -0500 |
commit | d5994e8111f2fe46d8735ef2680d4235dada807f (patch) | |
tree | c34acae8ece7e901b9581120a2cb127a10b3c1a4 | |
parent | 2ed16e5905da8fb31fce894c6c84be22382e4c41 (diff) | |
download | sdl_core-d5994e8111f2fe46d8735ef2680d4235dada807f.tar.gz |
don't send onSystemRequest LOCK_SCREEN_ICON_URL to mobile if url is missing (#3257)
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc | 15 |
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(); |