diff options
author | Andrey Oleynik <aoleynik@luxoft.com> | 2017-01-04 17:49:21 +0200 |
---|---|---|
committer | Andrey Oleynik <aoleynik@luxoft.com> | 2017-01-04 17:49:21 +0200 |
commit | 555f6cc0f8cd1efdfca31e4548992bb9a0301927 (patch) | |
tree | 21575aecfd3ae4f224c15c1518d8c4ed58d2687d /src | |
parent | 2ce415eba2a5145cd884541bebb3cb75695ee268 (diff) | |
download | sdl_core-555f6cc0f8cd1efdfca31e4548992bb9a0301927.tar.gz |
Revert "Fix redundant obj creation in ProcessServiceURLs"
This reverts commit 0db7b21a5c908ab487460317af85287bc0a0a66b.
Diffstat (limited to 'src')
-rw-r--r-- | src/components/application_manager/src/commands/hmi/get_urls.cc | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/src/components/application_manager/src/commands/hmi/get_urls.cc b/src/components/application_manager/src/commands/hmi/get_urls.cc index a72325ef5f..3f383c1948 100644 --- a/src/components/application_manager/src/commands/hmi/get_urls.cc +++ b/src/components/application_manager/src/commands/hmi/get_urls.cc @@ -88,34 +88,31 @@ void GetUrls::ProcessServiceURLs(const policy::EndpointUrls& endpoints) { size_t index = 0; for (size_t e = 0; e < endpoints.size(); ++e) { - ApplicationSharedPtr app = - application_manager_.application_by_policy_id(endpoints[e].app_id); - -#ifdef EXTERNAL_PROPRIETARY_MODE - bool registered_not_default = false; - if (policy::kDefaultId != endpoints[e].app_id) { - if (!app) { - LOG4CXX_ERROR(logger_, - "Can't find application with policy id " - << endpoints[e].app_id - << " URLs adding for this application is skipped."); - continue; - } - registered_not_default = true; - } -#endif // EXTERNAL_PROPRIETARY_MODE for (size_t u = 0; u < endpoints[e].url.size(); ++u, ++index) { - const std::string& app_url = endpoints[e].url[u]; + const std::string app_url = endpoints[e].url[u]; + SmartObject& service_info = urls[index]; service_info[strings::url] = app_url; -#ifdef EXTERNAL_PROPRIETARY_MODE - if (registered_not_default) { + if (policy::kDefaultId != endpoints[e].app_id) { +#ifndef EXTERNAL_PROPRIETARY_MODE + service_info[hmi_response::policy_app_id] = endpoints[e].app_id; +#else // EXTERNAL_PROPRIETARY_MODE + ApplicationSharedPtr app = + application_manager_.application_by_policy_id(endpoints[e].app_id); + + if (!app) { + LOG4CXX_ERROR(logger_, + "Can't find application with policy id " + << endpoints[e].app_id + << " URLs adding for this appliation is skipped."); + index--; + continue; + } + service_info[strings::app_id] = app->hmi_app_id(); - } -#else - service_info[hmi_response::policy_app_id] = endpoints[e].app_id; #endif // EXTERNAL_PROPRIETARY_MODE + } } } SendResponseToHMI(Common_Result::SUCCESS); |