summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2017-09-25 14:42:23 -0400
committerGitHub <noreply@github.com>2017-09-25 14:42:23 -0400
commitc38e85f34ae5ebad13bc5a6b3d87abb474583e90 (patch)
tree7da75ab4c7506c07aa4a3d6089d4ddc889a53c67 /src/components/application_manager/src
parented412e7c718f6981b7b399a7a3dee0fbad886f84 (diff)
parent6ef1e4b894ac5298c9b1b0c1e13f2ecf6c07f13d (diff)
downloadsdl_core-c38e85f34ae5ebad13bc5a6b3d87abb474583e90.tar.gz
Merge pull request #1776 from JackLivio/fix/haptic_data_nav_only
Require nav or projection app for SendHapticData
Diffstat (limited to 'src/components/application_manager/src')
-rw-r--r--src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc b/src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc
index cabfef15f6..569eba6c02 100644
--- a/src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc
+++ b/src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc
@@ -49,7 +49,22 @@ void SendHapticDataRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
- SendHMIRequest(hmi_apis::FunctionID::UI_SendHapticData, &msg_params, true);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (app->is_navi() || app->mobile_projection_enabled()) {
+ SendHMIRequest(hmi_apis::FunctionID::UI_SendHapticData, &msg_params, true);
+ } else {
+ SendResponse(false,
+ mobile_apis::Result::DISALLOWED,
+ "Application is not of type Navigation or Mobile Projection");
+ }
}
void SendHapticDataRequest::on_event(const event_engine::Event& event) {