From 49c29364460faa527bc758d0fd6b108463f8d82d Mon Sep 17 00:00:00 2001 From: "Yaroslav Mamykin (GitHub)" <33784535+YarikMamykin@users.noreply.github.com> Date: Wed, 8 Jan 2020 18:36:21 +0200 Subject: Fix increment of 'count_of_rejections_duplicate_name' counter (#3147) In case of duplicated name of application SDL didn't increment 'count_of_rejections_duplicate_name' counter in policy db. Added incrementing of counter. --- .../commands/mobile/register_app_interface_request.cc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc index e08d2a3e0c..cbdaa713b8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc @@ -299,12 +299,6 @@ void RegisterAppInterfaceRequest::Run() { mobile_apis::Result::eType coincidence_result = CheckCoincidence(); - if (mobile_apis::Result::SUCCESS != coincidence_result) { - LOG4CXX_ERROR(logger_, "Coincidence check failed."); - SendResponse(false, coincidence_result); - return; - } - std::vector duplicate_apps; if (GetDuplicateNames(duplicate_apps)) { LOG4CXX_ERROR(logger_, @@ -319,6 +313,13 @@ void RegisterAppInterfaceRequest::Run() { // Retrieve hybrid app preference from registering app preference = app->hybrid_app_preference(); } else { + if (mobile_apis::Result::DUPLICATE_NAME == coincidence_result) { + usage_statistics::AppCounter count_of_rejections_duplicate_name( + GetPolicyHandler().GetStatisticManager(), + policy_app_id, + usage_statistics::REJECTIONS_DUPLICATE_NAME); + ++count_of_rejections_duplicate_name; + } // Search for the hybrid app preference in the duplicate app list for (auto duplicate_app : duplicate_apps) { if (duplicate_app->is_cloud_app()) { @@ -366,6 +367,12 @@ void RegisterAppInterfaceRequest::Run() { } } + if (mobile_apis::Result::SUCCESS != coincidence_result) { + LOG4CXX_ERROR(logger_, "Coincidence check failed."); + SendResponse(false, coincidence_result); + return; + } + if (IsWhiteSpaceExist()) { LOG4CXX_INFO(logger_, "Incoming register app interface has contains \t\n \\t \\n"); -- cgit v1.2.1