summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/commands
diff options
context:
space:
mode:
authorAndrey Oleynik <aoleynik@luxoft.com>2016-12-02 12:08:02 +0200
committerAndrey Oleynik <aoleynik@luxoft.com>2016-12-08 15:09:05 +0200
commit006378de7d248ee7baa2049c9bc708cc23b09cf1 (patch)
tree6787e28ba3ae35ea8f33b5cfb4f945250f6c0dd6 /src/components/application_manager/src/commands
parent02656619a433f4549632897d833adc694b88f80b (diff)
downloadsdl_core-006378de7d248ee7baa2049c9bc708cc23b09cf1.tar.gz
Fixes forwarding of OnSystemRequest via specific application
SDL must forward policy table update i.e. OnSystemRequest to application only in case device hosting the application is consented by user. Relates-to: APPLINK-30399
Diffstat (limited to 'src/components/application_manager/src/commands')
-rw-r--r--src/components/application_manager/src/commands/hmi/on_system_request_notification.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/components/application_manager/src/commands/hmi/on_system_request_notification.cc b/src/components/application_manager/src/commands/hmi/on_system_request_notification.cc
index b74f1b6799..ea91dca5f1 100644
--- a/src/components/application_manager/src/commands/hmi/on_system_request_notification.cc
+++ b/src/components/application_manager/src/commands/hmi/on_system_request_notification.cc
@@ -89,6 +89,22 @@ void OnSystemRequestNotification::Run() {
return;
}
+ std::string device_mac;
+ application_manager_.connection_handler()
+ .get_session_observer()
+ .GetDataOnDeviceID(app->device(), NULL, NULL, &device_mac, NULL);
+
+ if (policy::kDeviceAllowed !=
+ application_manager_.GetPolicyHandler().GetUserConsentForDevice(
+ device_mac)) {
+ LOG4CXX_WARN(logger_,
+ "Application "
+ << app->policy_app_id()
+ << " is registered from non-consented device."
+ "Can't forward notification to application.");
+ return;
+ }
+
LOG4CXX_DEBUG(logger_,
"Sending request with application id " << app->policy_app_id());