summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaroslav Mamykin (GitHub) <ymamykin@luxoft.com>2019-11-27 19:50:31 +0200
committerYaroslav Mamykin (GitHub) <ymamykin@luxoft.com>2019-11-27 19:50:31 +0200
commit5fe0885de984babc60d8c03fd182cae75992fa47 (patch)
tree4d0aa4fd53dd98ab65d9c316e5340ebed352cc60
parente137556512215ded94228e33d21ab4c3e1af3017 (diff)
downloadsdl_core-fix/sdl_not_increment_dupl_name_counter.tar.gz
Fix increment of 'count_of_rejections_duplicate_name' counterfix/sdl_not_increment_dupl_name_counter
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 c2f4418b66..d625771549 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");