summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2019-04-08 17:13:17 -0400
committerJackLivio <jack@livio.io>2019-04-08 17:13:17 -0400
commit1b2435b7ad39cbb76eda3c86515b3ee410ba9a00 (patch)
treef9813c8563f92b0b09803be0926a290309f8fc09
parent18cac0a4ede64efd7ea1ac33c55a137638507352 (diff)
downloadsdl_core-1b2435b7ad39cbb76eda3c86515b3ee410ba9a00.tar.gz
Send unsupported_request in case of unknown function id and no pass through
-rw-r--r--src/components/application_manager/src/rpc_service_impl.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/components/application_manager/src/rpc_service_impl.cc b/src/components/application_manager/src/rpc_service_impl.cc
index 96882d472f..4dc649850b 100644
--- a/src/components/application_manager/src/rpc_service_impl.cc
+++ b/src/components/application_manager/src/rpc_service_impl.cc
@@ -126,7 +126,23 @@ bool RPCServiceImpl::ManageMobileCommand(
auto plugin =
app_manager_.GetPluginManager().FindPluginToProcess(function_id, source);
if (!plugin) {
- LOG4CXX_WARN(logger_, "Filed to find plugin : " << plugin.error());
+ int32_t message_type =
+ (*(message.get()))[strings::params][strings::message_type].asInt();
+ if ((source == commands::Command::CommandSource::SOURCE_MOBILE &&
+ kRequest == message_type) ||
+ (source == commands::Command::CommandSource::SOURCE_SDL &&
+ kResponse == message_type)) {
+ LOG4CXX_WARN(logger_, "Failed to find plugin : " << plugin.error());
+ smart_objects::SmartObjectSPtr response =
+ MessageHelper::CreateNegativeResponse(
+ connection_key,
+ static_cast<int32_t>(function_id),
+ correlation_id,
+ static_cast<int32_t>(mobile_apis::Result::UNSUPPORTED_REQUEST));
+ (*response)[strings::msg_params][strings::info] =
+ "Module does not recognize this function id";
+ SendMessageToMobile(response);
+ }
return false;
}
application_manager::CommandFactory& factory = (*plugin).GetCommandFactory();