summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShobhit Adlakha <adlakhashobhit@gmail.com>2019-04-25 15:08:12 -0400
committerShobhit Adlakha <adlakhashobhit@gmail.com>2019-04-25 15:08:12 -0400
commitb497c9d6a5c9a8952a45f4e3c1d740e8b44d799a (patch)
treeaec6b38c64437c1ccb3cf787efaf3a0620ab6729
parent55599d38ff290088623b6a2099ba2d584c4997da (diff)
downloadsdl_core-b497c9d6a5c9a8952a45f4e3c1d740e8b44d799a.tar.gz
Set return values for cloud app functions if CLOUD_APP_SUPPORT=OFF
-rw-r--r--src/components/policy/policy_external/src/cache_manager.cc4
-rw-r--r--src/components/policy/policy_regular/src/cache_manager.cc4
-rw-r--r--src/components/transport_manager/src/transport_manager_impl.cc5
3 files changed, 13 insertions, 0 deletions
diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc
index 4a738aa6ed..d332dc0e9d 100644
--- a/src/components/policy/policy_external/src/cache_manager.cc
+++ b/src/components/policy/policy_external/src/cache_manager.cc
@@ -1391,6 +1391,10 @@ const policy::VehicleInfo CacheManager::GetVehicleInfo() const {
void CacheManager::GetEnabledCloudApps(
std::vector<std::string>& enabled_apps) const {
+#if !defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+ enabled_apps.clear();
+ return;
+#endif
const policy_table::ApplicationPolicies& policies =
pt_->policy_table.app_policies_section.apps;
for (policy_table::ApplicationPolicies::const_iterator it = policies.begin();
diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc
index 991c6a1363..663ab6ac6b 100644
--- a/src/components/policy/policy_regular/src/cache_manager.cc
+++ b/src/components/policy/policy_regular/src/cache_manager.cc
@@ -684,6 +684,10 @@ const policy::VehicleInfo CacheManager::GetVehicleInfo() const {
void CacheManager::GetEnabledCloudApps(
std::vector<std::string>& enabled_apps) const {
+#if !defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+ enabled_apps.clear();
+ return;
+#endif
const policy_table::ApplicationPolicies& policies =
pt_->policy_table.app_policies_section.apps;
for (policy_table::ApplicationPolicies::const_iterator it = policies.begin();
diff --git a/src/components/transport_manager/src/transport_manager_impl.cc b/src/components/transport_manager/src/transport_manager_impl.cc
index 90969a132b..c6d6b15961 100644
--- a/src/components/transport_manager/src/transport_manager_impl.cc
+++ b/src/components/transport_manager/src/transport_manager_impl.cc
@@ -134,6 +134,7 @@ void TransportManagerImpl::AddCloudDevice(
const transport_manager::transport_adapter::CloudAppProperties&
cloud_properties) {
#if !defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+ LOG4CXX_TRACE(logger_,"Cloud app support is disabled. Exiting function");
return;
#endif
transport_adapter::DeviceType type = transport_adapter::DeviceType::UNKNOWN;
@@ -164,6 +165,10 @@ void TransportManagerImpl::AddCloudDevice(
}
void TransportManagerImpl::RemoveCloudDevice(const DeviceHandle device_handle) {
+#if !defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT)
+ LOG4CXX_TRACE(logger_,"Cloud app support is disabled. Exiting function");
+ return;
+#endif
DisconnectDevice(device_handle);
}