summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaroslav Mamykin (GitHub) <33784535+YarikMamykin@users.noreply.github.com>2020-01-08 18:36:21 +0200
committerCollin <iCollin@users.noreply.github.com>2020-01-08 11:36:21 -0500
commit49c29364460faa527bc758d0fd6b108463f8d82d (patch)
tree6db5e2c6ed13151eaf955b4c8b19c046c2e621c1
parent0fff71bae9c5ef07ca5505ca81951c5951f6a988 (diff)
downloadsdl_core-49c29364460faa527bc758d0fd6b108463f8d82d.tar.gz
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.
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc19
1 files 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<ApplicationSharedPtr> 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");