diff options
author | JackLivio <jack@livio.io> | 2019-01-24 10:57:15 -0500 |
---|---|---|
committer | JackLivio <jack@livio.io> | 2019-01-24 10:57:15 -0500 |
commit | f1c9edcbcf2822cc93a38810a592bc6412070214 (patch) | |
tree | af9137e216d0552bc3255a039a2af0db261b534b /src/components/application_manager/rpc_plugins/app_service_rpc_plugin | |
parent | 55a14219ced574948a44ffa30f1c76acab7eafa3 (diff) | |
download | sdl_core-f1c9edcbcf2822cc93a38810a592bc6412070214.tar.gz |
OnAppServiceDataNotificationFromMobile check parameters
Diffstat (limited to 'src/components/application_manager/rpc_plugins/app_service_rpc_plugin')
-rw-r--r-- | src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification_from_mobile.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification_from_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification_from_mobile.cc index a7a8042fee..20036cc30a 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification_from_mobile.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification_from_mobile.cc @@ -67,6 +67,22 @@ void OnAppServiceDataNotificationFromMobile::Run() { LOG4CXX_AUTO_TRACE(logger_); LOG4CXX_DEBUG(logger_, "Received an OnAppServiceData"); MessageHelper::PrintSmartObject(*message_); + + std::string service_type = + (*message_)[strings::msg_params][strings::app_service_manifest] + [strings::service_type].asString(); + + ApplicationSharedPtr app = application_manager_.application(connection_key()); + + bool result = policy_handler_.CheckAppServiceParameters( + app->policy_app_id(), std::string(), service_type, {}); + + if (!result) { + LOG4CXX_DEBUG(logger_, + "Incorrect service type received in " + "OnAppServiceDataNotificationFromMobile"); + return; + } } } // namespace commands |