summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/commands/request_from_hmi.cc
diff options
context:
space:
mode:
authorJacob Keeler <jacob.keeler@livioradio.com>2019-02-26 12:53:56 -0500
committerGitHub <noreply@github.com>2019-02-26 12:53:56 -0500
commit45b9c2e8d109ed124c604c4b690b1847bc93c9c6 (patch)
treef1046afd8e311441bc7c7c8493563b4fa9f07a20 /src/components/application_manager/src/commands/request_from_hmi.cc
parentaa8ad39cc936c7de63818d4307d8ac6a4dff5530 (diff)
downloadsdl_core-45b9c2e8d109ed124c604c4b690b1847bc93c9c6.tar.gz
PerformAppServiceInteraction RPC (#2815)
* Add PerformAppServiceInteraction RPC * Add handling for `requestServiceActive` parameter * Fix style * Change PerformAppServiceInteraction class naming Clarify direction in class name
Diffstat (limited to 'src/components/application_manager/src/commands/request_from_hmi.cc')
-rw-r--r--src/components/application_manager/src/commands/request_from_hmi.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/components/application_manager/src/commands/request_from_hmi.cc b/src/components/application_manager/src/commands/request_from_hmi.cc
index d97694276e..823e93cb5e 100644
--- a/src/components/application_manager/src/commands/request_from_hmi.cc
+++ b/src/components/application_manager/src/commands/request_from_hmi.cc
@@ -33,6 +33,9 @@
#include "application_manager/commands/request_from_hmi.h"
#include "application_manager/application_manager.h"
#include "application_manager/rpc_service.h"
+#include "utils/helpers.h"
+
+#include "smart_objects/enum_schema_item.h"
#include "smart_objects/enum_schema_item.h"
@@ -163,13 +166,20 @@ void RequestFromHMI::SendProviderRequest(
const hmi_apis::FunctionID::eType& hmi_function_id,
const smart_objects::SmartObject* msg,
bool use_events) {
- std::string service_type =
- (*msg)[strings::msg_params][strings::service_type].asString();
-
+ LOG4CXX_AUTO_TRACE(logger_);
bool hmi_destination = false;
ApplicationSharedPtr app;
- application_manager_.GetAppServiceManager().GetProvider(
- service_type, app, hmi_destination);
+ if ((*msg)[strings::msg_params].keyExists(strings::service_type)) {
+ std::string service_type =
+ (*msg)[strings::msg_params][strings::service_type].asString();
+ application_manager_.GetAppServiceManager().GetProviderByType(
+ service_type, app, hmi_destination);
+ } else if ((*msg)[strings::msg_params].keyExists(strings::service_id)) {
+ std::string service_id =
+ (*msg)[strings::msg_params][strings::service_id].asString();
+ application_manager_.GetAppServiceManager().GetProviderByID(
+ service_id, app, hmi_destination);
+ }
if (hmi_destination) {
LOG4CXX_DEBUG(logger_, "Sending Request to HMI Provider");
@@ -181,6 +191,7 @@ void RequestFromHMI::SendProviderRequest(
LOG4CXX_DEBUG(logger_, "Invalid App Provider pointer");
return;
}
+
LOG4CXX_DEBUG(logger_, "Sending Request to Mobile Provider");
SendMobileRequest(
mobile_function_id, app, &(*msg)[strings::msg_params], use_events);