diff options
Diffstat (limited to 'src/components/application_manager/src/commands/mobile/register_app_interface_request.cc')
-rw-r--r-- | src/components/application_manager/src/commands/mobile/register_app_interface_request.cc | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc index d4c0e7afdb..50dde63c76 100644 --- a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc @@ -175,22 +175,14 @@ void RegisterAppInterfaceRequest::Run() { SendResponse(false, policy_result); return; } - policy::PolicyManager* policy_manager = - policy::PolicyHandler::instance()->policy_manager(); - if (!policy_manager) { - LOG4CXX_WARN(logger_, "The shared library of policy is not loaded"); - SendResponse(false, mobile_apis::Result::DISALLOWED); - return; - } - mobile_apis::Result::eType coincidence_result = - CheckCoincidence(); + mobile_apis::Result::eType coincidence_result = CheckCoincidence(); if (mobile_apis::Result::SUCCESS != coincidence_result) { LOG4CXX_ERROR_EXT(logger_, "Coincidence check failed."); if (mobile_apis::Result::DUPLICATE_NAME == coincidence_result) { usage_statistics::AppCounter count_of_rejections_duplicate_name( - policy_manager, mobile_app_id, + policy::PolicyHandler::instance()->policy_manager(), mobile_app_id, usage_statistics::REJECTIONS_DUPLICATE_NAME); ++count_of_rejections_duplicate_name; } @@ -577,21 +569,26 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckWithPolicyData() { // TODO(AOleynik): Check is necessary to allow register application in case // of disabled policy // Remove this check, when HMI will support policy - if (profile::Profile::instance()->policy_turn_off()) { + if (policy::PolicyHandler::instance()->PolicyEnabled()) { return mobile_apis::Result::WARNINGS; } smart_objects::SmartObject& message = *message_; policy::StringArray app_nicknames; - policy::StringArray app_hmi_types; + policy::StringArray app_hmi_types; + + if(!policy::PolicyHandler::instance()->PolicyEnabled()) { + return mobile_apis::Result::WARNINGS; + } // TODO(KKolodiy): need remove method policy_manager policy::PolicyManager* policy_manager = - policy::PolicyHandler::instance()->policy_manager(); + policy::PolicyHandler::instance()->policy_manager(); if (!policy_manager) { LOG4CXX_WARN(logger_, "The shared library of policy is not loaded"); return mobile_apis::Result::DISALLOWED; } + std::string mobile_app_id = message[strings::msg_params][strings::app_id].asString(); const bool init_result = policy_manager->GetInitialAppData(mobile_app_id, &app_nicknames, &app_hmi_types); |