summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2017-09-22 14:49:15 -0400
committerjacobkeeler <jacob.keeler@livioradio.com>2017-09-25 10:58:39 -0400
commit6ef1e4b894ac5298c9b1b0c1e13f2ecf6c07f13d (patch)
tree2fb7dafc4c7a099f7fc94ccd3bf8f17aaf0d8e71 /src/components/application_manager/src
parent761523db24c1276311389f2500f92d945cedb25e (diff)
downloadsdl_core-6ef1e4b894ac5298c9b1b0c1e13f2ecf6c07f13d.tar.gz
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) {