summaryrefslogtreecommitdiff
path: root/src/components/policy
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/policy')
-rw-r--r--src/components/policy/policy_external/CMakeLists.txt5
-rw-r--r--src/components/policy/policy_external/include/policy/policy_manager_impl.h9
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/types.h6
-rw-r--r--src/components/policy/policy_external/include/policy/sql_pt_representation.h2
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc17
-rw-r--r--src/components/policy/policy_external/src/policy_table/enums.cc2
-rw-r--r--src/components/policy/policy_external/src/policy_table/types.cc17
-rw-r--r--src/components/policy/policy_external/src/policy_table/validation.cc6
-rw-r--r--src/components/policy/policy_external/src/sql_pt_representation.cc8
-rw-r--r--src/components/policy/policy_external/test/CMakeLists.txt6
-rw-r--r--src/components/policy/policy_regular/CMakeLists.txt5
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_manager_impl.h16
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/types.h6
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_representation.h2
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc43
-rw-r--r--src/components/policy/policy_regular/src/policy_table/enums.cc2
-rw-r--r--src/components/policy/policy_regular/src/policy_table/types.cc16
-rw-r--r--src/components/policy/policy_regular/src/policy_table/validation.cc6
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_representation.cc9
-rw-r--r--src/components/policy/policy_regular/test/CMakeLists.txt5
-rw-r--r--src/components/policy/policy_regular/test/policy_manager_impl_test.cc8
21 files changed, 30 insertions, 166 deletions
diff --git a/src/components/policy/policy_external/CMakeLists.txt b/src/components/policy/policy_external/CMakeLists.txt
index 8d04f20470..c66313240f 100644
--- a/src/components/policy/policy_external/CMakeLists.txt
+++ b/src/components/policy/policy_external/CMakeLists.txt
@@ -55,13 +55,10 @@ set(SOURCES
${POLICY_PATH}/src/update_status_manager.cc
${POLICY_PATH}/src/status.cc
${POLICY_PATH}/src/cache_manager.cc
+ ${POLICY_PATH}/src/access_remote_impl.cc
${COMPONENTS_DIR}/rpc_base/src/rpc_base/rpc_base.cc
)
-if (REMOTE_CONTROL)
- list(APPEND SOURCES ${POLICY_PATH}/src/access_remote_impl.cc)
-endif()
-
list(APPEND SOURCES
${POLICY_PATH}/src/sql_pt_ext_queries.cc
${POLICY_PATH}/src/sql_pt_ext_representation.cc
diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h
index fcd9c9f69a..67756c053d 100644
--- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h
+++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h
@@ -42,11 +42,8 @@
#include "policy/update_status_manager.h"
#include "policy/policy_table/functions.h"
#include "policy/usage_statistics/statistics_manager.h"
-
-#ifdef SDL_REMOTE_CONTROL
#include "policy/access_remote.h"
#include "policy/access_remote_impl.h"
-#endif // SDL_REMOTE_CONTROL
namespace policy_table = rpc::policy_table_interface_base;
@@ -454,7 +451,6 @@ class PolicyManagerImpl : public PolicyManager {
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) OVERRIDE;
-#ifdef SDL_REMOTE_CONTROL
/**
* @brief Assigns new HMI types for specified application
* @param application_id Unique application id
@@ -489,7 +485,6 @@ class PolicyManagerImpl : public PolicyManager {
* @param application_id Unique id of application
*/
void OnPrimaryGroupsChanged(const std::string& application_id);
-#endif // SDL_REMOTE_CONTROL
/**
* @brief Removes consent for application functional group
@@ -868,7 +863,6 @@ class PolicyManagerImpl : public PolicyManager {
bool IsPTValid(utils::SharedPtr<policy_table::Table> policy_table,
policy_table::PolicyTableType type) const;
-#ifdef SDL_REMOTE_CONTROL
/**
* @brief Get resulting RPCs permissions for application which started on
* specific device
@@ -905,7 +899,6 @@ class PolicyManagerImpl : public PolicyManager {
*/
bool GetModuleTypes(const std::string& policy_app_id,
std::vector<std::string>* modules) const OVERRIDE;
-#endif // SDL_REMOTE_CONTROL
/**
* @brief Notify application about its permissions changes by preparing and
@@ -1021,12 +1014,10 @@ class PolicyManagerImpl : public PolicyManager {
* @brief pointer to CacheManagerInterface instance for getting policy data
*/
CacheManagerInterfaceSPtr cache_;
-#ifdef SDL_REMOTE_CONTROL
/**
* @brief pointer to AccessRemote instance for working with RC applications
*/
utils::SharedPtr<AccessRemote> access_remote_;
-#endif
/**
* @brief lock guard for protecting applications list access
diff --git a/src/components/policy/policy_external/include/policy/policy_table/types.h b/src/components/policy/policy_external/include/policy/policy_table/types.h
index 1b1419365d..b062fa0966 100644
--- a/src/components/policy/policy_external/include/policy/policy_table/types.h
+++ b/src/components/policy/policy_external/include/policy/policy_table/types.h
@@ -104,11 +104,9 @@ typedef Array<Enum<RequestType>, 0, 255> RequestsTypeArray;
typedef Strings RequestSubTypes;
-#ifdef SDL_REMOTE_CONTROL
typedef Map<Strings, 0, 255> RemoteRpcs;
typedef Map<RemoteRpcs, 0, 255> AccessModules;
typedef Array<Enum<ModuleType>, 0, 255> ModuleTypes;
-#endif // SDL_REMOTE_CONTROL
typedef AppHMIType AppHmiType;
typedef std::vector<AppHMIType> AppHmiTypes;
@@ -178,9 +176,7 @@ struct ApplicationParams : PolicyBase {
Optional<RequestSubTypes> RequestSubType;
Optional<Integer<uint16_t, 0, 65225> > memory_kb;
Optional<Integer<uint32_t, 0, UINT_MAX> > heart_beat_timeout_ms;
-#ifdef SDL_REMOTE_CONTROL
mutable Optional<ModuleTypes> moduleType;
-#endif // SDL_REMOTE_CONTROL
public:
ApplicationParams();
@@ -200,9 +196,7 @@ struct ApplicationParams : PolicyBase {
private:
bool Validate() const;
-#ifdef SDL_REMOTE_CONTROL
bool ValidateModuleTypes() const;
-#endif // SDL_REMOTE_CONTROL
};
struct ApplicationPoliciesSection : CompositeType {
diff --git a/src/components/policy/policy_external/include/policy/sql_pt_representation.h b/src/components/policy/policy_external/include/policy/sql_pt_representation.h
index c32e3205ef..d56f6aeba2 100644
--- a/src/components/policy/policy_external/include/policy/sql_pt_representation.h
+++ b/src/components/policy/policy_external/include/policy/sql_pt_representation.h
@@ -98,7 +98,6 @@ class SQLPTRepresentation : public virtual PTRepresentation {
}
#endif // BUILD_TESTS
protected:
-#ifdef SDL_REMOTE_CONTROL
enum TypeAccess { kAllowed, kManual };
bool GatherModuleType(const std::string& app_id,
policy_table::ModuleTypes* module_types) const;
@@ -113,7 +112,6 @@ class SQLPTRepresentation : public virtual PTRepresentation {
bool SaveAccessModule(TypeAccess access,
const policy_table::AccessModules& modules);
bool SaveRemoteRpc(int module_id, const policy_table::RemoteRpcs& rpcs);
-#endif // SDL_REMOTE_CONTROL
virtual void GatherModuleMeta(policy_table::ModuleMeta* meta) const;
virtual void GatherModuleConfig(policy_table::ModuleConfig* config) const;
diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc
index 172e218e0e..4ac66c0d53 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -50,11 +50,8 @@
#include "policy/update_status_manager.h"
#include "config_profile/profile.h"
#include "utils/make_shared.h"
-
-#ifdef SDL_REMOTE_CONTROL
#include "policy/access_remote.h"
#include "policy/access_remote_impl.h"
-#endif // SDL_REMOTE_CONTROL
policy::PolicyManager* CreateManager() {
return new policy::PolicyManagerImpl();
@@ -216,32 +213,26 @@ PolicyManagerImpl::PolicyManagerImpl()
: PolicyManager()
, listener_(NULL)
, cache_(new CacheManager)
-#ifdef SDL_REMOTE_CONTROL
, access_remote_(new AccessRemoteImpl(
CacheManagerInterfaceSPtr::static_pointer_cast<CacheManager>(cache_)))
-#endif // SDL_REMOTE_CONTROL
, retry_sequence_timeout_(60)
, retry_sequence_index_(0)
, ignition_check(true)
- , retry_sequence_url_(0, 0, "") {
-}
+ , retry_sequence_url_(0, 0, "") {}
PolicyManagerImpl::PolicyManagerImpl(bool in_memory)
: PolicyManager()
, listener_(NULL)
, cache_(new CacheManager(in_memory))
-#ifdef SDL_REMOTE_CONTROL
, access_remote_(new AccessRemoteImpl(
CacheManagerInterfaceSPtr::static_pointer_cast<CacheManager>(cache_)))
-#endif // SDL_REMOTE_CONTROL
, retry_sequence_timeout_(60)
, retry_sequence_index_(0)
, ignition_check(true)
, retry_sequence_url_(0, 0, "")
, wrong_ptu_update_received_(false)
, send_on_update_sent_out_(false)
- , trigger_ptu_(false) {
-}
+ , trigger_ptu_(false) {}
void PolicyManagerImpl::set_listener(PolicyListener* listener) {
listener_ = listener;
@@ -792,13 +783,11 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
LOG4CXX_INFO(logger_,
"Send notification for application_id:" << application_id);
-#ifdef SDL_REMOTE_CONTROL
const ApplicationOnDevice who = {device_id, application_id};
if (access_remote_->IsAppRemoteControl(who)) {
listener()->OnPermissionsUpdated(application_id, notification_data);
return;
}
-#endif // SDL_REMOTE_CONTROL
std::string default_hmi;
GetDefaultHmi(application_id, &default_hmi);
@@ -1933,7 +1922,6 @@ std::ostream& operator<<(std::ostream& output,
return output;
}
-#ifdef SDL_REMOTE_CONTROL
void PolicyManagerImpl::SetDefaultHmiTypes(const std::string& application_id,
const std::vector<int>& hmi_types) {
LOG4CXX_INFO(logger_, "SetDefaultHmiTypes");
@@ -2039,6 +2027,5 @@ void PolicyManagerImpl::set_access_remote(
utils::SharedPtr<AccessRemote> access_remote) {
access_remote_ = access_remote;
}
-#endif // SDL_REMOTE_CONTROL
} // namespace policy
diff --git a/src/components/policy/policy_external/src/policy_table/enums.cc b/src/components/policy/policy_external/src/policy_table/enums.cc
index 881ae8cbf9..5a9e403053 100644
--- a/src/components/policy/policy_external/src/policy_table/enums.cc
+++ b/src/components/policy/policy_external/src/policy_table/enums.cc
@@ -758,7 +758,6 @@ bool EnumFromJsonString(const std::string& literal, RequestType* result) {
}
}
-#ifdef SDL_REMOTE_CONTROL
bool IsValidEnum(ModuleType val) {
switch (val) {
case MT_CLIMATE:
@@ -791,7 +790,6 @@ bool EnumFromJsonString(const std::string& literal, ModuleType* result) {
return false;
}
}
-#endif // SDL_REMOTE_CONTROL
const std::string kDefaultApp = "default";
const std::string kPreDataConsentApp = "pre_DataConsent";
diff --git a/src/components/policy/policy_external/src/policy_table/types.cc b/src/components/policy/policy_external/src/policy_table/types.cc
index 6d0bc9d697..8c4f454dfa 100644
--- a/src/components/policy/policy_external/src/policy_table/types.cc
+++ b/src/components/policy/policy_external/src/policy_table/types.cc
@@ -241,11 +241,7 @@ ApplicationParams::ApplicationParams(const Json::Value* value__)
, RequestSubType(impl::ValueMember(value__, "RequestSubType"))
, memory_kb(impl::ValueMember(value__, "memory_kb"), 0)
, heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms"))
-#ifdef SDL_REMOTE_CONTROL
- , moduleType(impl::ValueMember(value__, "moduleType"))
-#endif // SDL_REMOTE_CONTROL
-{
-}
+ , moduleType(impl::ValueMember(value__, "moduleType")) {}
Json::Value ApplicationParams::ToJsonValue() const {
Json::Value result__(PolicyBase::ToJsonValue());
@@ -256,9 +252,7 @@ Json::Value ApplicationParams::ToJsonValue() const {
impl::WriteJsonField("memory_kb", memory_kb, &result__);
impl::WriteJsonField(
"heart_beat_timeout_ms", heart_beat_timeout_ms, &result__);
-#ifdef SDL_REMOTE_CONTROL
impl::WriteJsonField("moduleType", moduleType, &result__);
-#endif // SDL_REMOTE_CONTROL
return result__;
}
@@ -280,11 +274,9 @@ bool ApplicationParams::is_valid() const {
if (!heart_beat_timeout_ms.is_valid()) {
return false;
}
-#ifdef SDL_REMOTE_CONTROL
if (!moduleType.is_valid()) {
return false;
}
-#endif // SDL_REMOTE_CONTROL
return Validate();
}
@@ -314,11 +306,9 @@ bool ApplicationParams::struct_empty() const {
if (heart_beat_timeout_ms.is_initialized()) {
return false;
}
-#ifdef SDL_REMOTE_CONTROL
if (moduleType.is_initialized()) {
return false;
}
-#endif // SDL_REMOTE_CONTROL
return true;
}
@@ -364,12 +354,9 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
heart_beat_timeout_ms.ReportErrors(
&report__->ReportSubobject("heart_beat_timeout_ms"));
}
-
-#ifdef SDL_REMOTE_CONTROL
if (!moduleType.is_valid()) {
moduleType.ReportErrors(&report__->ReportSubobject("moduleType"));
}
-#endif // SDL_REMOTE_CONTROL
}
void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
@@ -379,9 +366,7 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
RequestSubType.SetPolicyTableType(pt_type);
memory_kb.SetPolicyTableType(pt_type);
heart_beat_timeout_ms.SetPolicyTableType(pt_type);
-#ifdef SDL_REMOTE_CONTROL
moduleType.SetPolicyTableType(pt_type);
-#endif // SDL_REMOTE_CONTROL
}
// RpcParameters methods
diff --git a/src/components/policy/policy_external/src/policy_table/validation.cc b/src/components/policy/policy_external/src/policy_table/validation.cc
index 6936948c84..9b227615d8 100644
--- a/src/components/policy/policy_external/src/policy_table/validation.cc
+++ b/src/components/policy/policy_external/src/policy_table/validation.cc
@@ -164,7 +164,6 @@ bool ApplicationPoliciesSection::Validate() const {
return true;
}
-#ifdef SDL_REMOTE_CONTROL
bool ApplicationParams::ValidateModuleTypes() const {
// moduleType is optional so see Optional<T>::is_valid()
bool is_initialized = moduleType->is_initialized();
@@ -194,7 +193,6 @@ bool ApplicationParams::ValidateModuleTypes() const {
}
return true;
}
-#endif // SDL_REMOTE_CONTROL
bool ApplicationParams::Validate() const {
if (is_initialized()) {
@@ -206,11 +204,7 @@ bool ApplicationParams::Validate() const {
}
}
}
-#ifdef SDL_REMOTE_CONTROL
return ValidateModuleTypes();
-#else // SDL_REMOTE_CONTROL
- return true;
-#endif // SDL_REMOTE_CONTROL
}
bool RpcParameters::Validate() const {
diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc
index b05716dc3f..3cd7388672 100644
--- a/src/components/policy/policy_external/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_external/src/sql_pt_representation.cc
@@ -765,7 +765,6 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
return false;
}
-#ifdef SDL_REMOTE_CONTROL
bool denied = false;
if (!GatherRemoteControlDenied(app_id, &denied)) {
return false;
@@ -775,7 +774,6 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
return false;
}
}
-#endif // SDL_REMOTE_CONTROL
if (!GatherNickName(app_id, &*params.nicknames)) {
return false;
@@ -1051,14 +1049,11 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy(
return false;
}
-#ifdef SDL_REMOTE_CONTROL
-
bool denied = !app.second.moduleType->is_initialized();
if (!SaveRemoteControlDenied(app.first, denied) ||
!SaveModuleType(app.first, *app.second.moduleType)) {
return false;
}
-#endif // SDL_REMOTE_CONTROL
if (!SaveNickname(app.first, *app.second.nicknames)) {
return false;
@@ -1714,8 +1709,6 @@ bool SQLPTRepresentation::GatherAppGroup(
return true;
}
-#ifdef SDL_REMOTE_CONTROL
-
bool SQLPTRepresentation::GatherRemoteControlDenied(const std::string& app_id,
bool* denied) const {
LOG4CXX_AUTO_TRACE(logger_);
@@ -1905,7 +1898,6 @@ bool SQLPTRepresentation::GatherRemoteRpc(
}
return true;
}
-#endif // SDL_REMOTE_CONTROL
bool SQLPTRepresentation::SaveApplicationCustomData(const std::string& app_id,
bool is_revoked,
diff --git a/src/components/policy/policy_external/test/CMakeLists.txt b/src/components/policy/policy_external/test/CMakeLists.txt
index a455d43b91..8b77c90dd2 100644
--- a/src/components/policy/policy_external/test/CMakeLists.txt
+++ b/src/components/policy/policy_external/test/CMakeLists.txt
@@ -55,12 +55,6 @@ file (GLOB POLICY_TEST_SOURCES
list (REMOVE_ITEM POLICY_TEST_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/policy_manager_impl_stress_test.cc)
-if (REMOTE_CONTROL)
- list (APPEND testSources
- access_remote_impl_test.cc
- )
-endif ()
-
create_test("policy_test" "${POLICY_TEST_SOURCES}" "${testLibraries}")
#Additional test files (json)
diff --git a/src/components/policy/policy_regular/CMakeLists.txt b/src/components/policy/policy_regular/CMakeLists.txt
index c7b9c068b9..225e99329a 100644
--- a/src/components/policy/policy_regular/CMakeLists.txt
+++ b/src/components/policy/policy_regular/CMakeLists.txt
@@ -71,11 +71,6 @@ set(PATHS
)
collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
-if (NOT REMOTE_CONTROL)
- list(REMOVE_ITEM SOURCES
- ${CMAKE_CURRENT_SOURCE_DIR}/src/access_remote_impl.cc)
-endif()
-
set(LIBRARIES
ConfigProfile
policy_struct
diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
index 8379cf4d82..c162d73011 100644
--- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
+++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
@@ -47,10 +47,8 @@
#include "policy/usage_statistics/statistics_manager.h"
#include "policy/policy_helper.h"
#include "utils/timer.h"
-#ifdef SDL_REMOTE_CONTROL
#include "policy/access_remote.h"
#include "policy/access_remote_impl.h"
-#endif // SDL_REMOTE_CONTROL
namespace policy_table = rpc::policy_table_interface_base;
@@ -448,7 +446,6 @@ class PolicyManagerImpl : public PolicyManager {
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) OVERRIDE;
-#ifdef SDL_REMOTE_CONTROL
/**
* @brief Assigns new HMI types for specified application
* @param application_id Unique application id
@@ -483,7 +480,6 @@ class PolicyManagerImpl : public PolicyManager {
* @param application_id Unique id of application
*/
void OnPrimaryGroupsChanged(const std::string& application_id);
-#endif // SDL_REMOTE_CONTROL
/**
* @brief Removes consent for application functional group
@@ -816,7 +812,6 @@ class PolicyManagerImpl : public PolicyManager {
void RetrySequence();
private:
-#ifdef SDL_REMOTE_CONTROL
/**
* @brief Get resulting RPCs permissions for application which started on
* specific device
@@ -853,10 +848,10 @@ class PolicyManagerImpl : public PolicyManager {
*/
bool GetModuleTypes(const std::string& policy_app_id,
std::vector<std::string>* modules) const OVERRIDE;
-#endif // SDL_REMOTE_CONTROL
- /**
- * @brief pointer to policy table listener for callbacks
- */
+
+ /**
+ * @brief pointer to policy table listener for callbacks
+ */
PolicyListener* listener_;
/**
@@ -868,12 +863,11 @@ class PolicyManagerImpl : public PolicyManager {
* @brief pointer to CacheManagerInterface instance for getting policy data
*/
CacheManagerInterfaceSPtr cache_;
-#ifdef SDL_REMOTE_CONTROL
+
/**
* @brief pointer to AccessRemote instance for working with RC applications
*/
utils::SharedPtr<AccessRemote> access_remote_;
-#endif
/**
* @brief lock guard for protecting applications list access
diff --git a/src/components/policy/policy_regular/include/policy/policy_table/types.h b/src/components/policy/policy_regular/include/policy/policy_table/types.h
index 8197247907..ebfbb7f29f 100644
--- a/src/components/policy/policy_regular/include/policy/policy_table/types.h
+++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h
@@ -98,11 +98,9 @@ typedef Array<Enum<RequestType>, 0, 255> RequestTypes;
typedef Strings RequestSubTypes;
-#ifdef SDL_REMOTE_CONTROL
typedef Map<Strings, 0, 255> RemoteRpcs;
typedef Map<RemoteRpcs, 0, 255> AccessModules;
typedef Array<Enum<ModuleType>, 0, 255> ModuleTypes;
-#endif // SDL_REMOTE_CONTROL
typedef AppHMIType AppHmiType;
typedef std::vector<AppHMIType> AppHmiTypes;
@@ -145,9 +143,7 @@ struct ApplicationParams : PolicyBase {
Optional<Integer<uint16_t, 0, 65225> > memory_kb;
Optional<Integer<uint32_t, 0, UINT_MAX> > heart_beat_timeout_ms;
Optional<String<0, 255> > certificate;
-#ifdef SDL_REMOTE_CONTROL
mutable Optional<ModuleTypes> moduleType;
-#endif // SDL_REMOTE_CONTROL
public:
ApplicationParams();
@@ -163,9 +159,7 @@ struct ApplicationParams : PolicyBase {
private:
bool Validate() const;
-#ifdef SDL_REMOTE_CONTROL
bool ValidateModuleTypes() const;
-#endif // SDL_REMOTE_CONTROL
};
struct ApplicationPoliciesSection : CompositeType {
diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h
index e39e0d5873..b26b2c9ede 100644
--- a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h
+++ b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h
@@ -97,7 +97,6 @@ class SQLPTRepresentation : public virtual PTRepresentation {
}
#endif // BUILD_TESTS
protected:
-#ifdef SDL_REMOTE_CONTROL
enum TypeAccess { kAllowed, kManual };
bool GatherModuleType(const std::string& app_id,
policy_table::ModuleTypes* module_types) const;
@@ -112,7 +111,6 @@ class SQLPTRepresentation : public virtual PTRepresentation {
bool SaveAccessModule(TypeAccess access,
const policy_table::AccessModules& modules);
bool SaveRemoteRpc(int module_id, const policy_table::RemoteRpcs& rpcs);
-#endif // SDL_REMOTE_CONTROL
virtual void GatherModuleMeta(policy_table::ModuleMeta* meta) const;
virtual void GatherModuleConfig(policy_table::ModuleConfig* config) const;
diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc
index 8687501b2f..d01631a2a2 100644
--- a/src/components/policy/policy_regular/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc
@@ -50,11 +50,8 @@
#include "config_profile/profile.h"
#include "utils/timer_task_impl.h"
#include "utils/make_shared.h"
-
-#ifdef SDL_REMOTE_CONTROL
#include "policy/access_remote.h"
#include "policy/access_remote_impl.h"
-#endif // SDL_REMOTE_CONTROL
policy::PolicyManager* CreateManager() {
return new policy::PolicyManagerImpl();
@@ -76,10 +73,8 @@ PolicyManagerImpl::PolicyManagerImpl()
: PolicyManager()
, listener_(NULL)
, cache_(new CacheManager)
-#ifdef SDL_REMOTE_CONTROL
, access_remote_(new AccessRemoteImpl(
CacheManagerInterfaceSPtr::static_pointer_cast<CacheManager>(cache_)))
-#endif // SDL_REMOTE_CONTROL
, retry_sequence_timeout_(kDefaultRetryTimeoutInMSec)
, retry_sequence_index_(0)
, timer_retry_sequence_("Retry sequence timer",
@@ -89,8 +84,7 @@ PolicyManagerImpl::PolicyManagerImpl()
, retry_sequence_url_(0, 0, "")
, wrong_ptu_update_received_(false)
, send_on_update_sent_out_(false)
- , trigger_ptu_(false) {
-}
+ , trigger_ptu_(false) {}
void PolicyManagerImpl::set_listener(PolicyListener* listener) {
listener_ = listener;
@@ -423,12 +417,16 @@ void PolicyManagerImpl::CheckPermissions(const PTString& device_id,
"CheckPermissions for " << app_id << " and rpc " << rpc
<< " for " << hmi_level << " level.");
-#ifdef SDL_REMOTE_CONTROL
ApplicationOnDevice who = {device_id, app_id};
- const policy_table::Strings& groups = access_remote_->GetGroups(who);
-#else // SDL_REMOTE_CONTROL
- const policy_table::Strings& groups = cache_->GetGroups(app_id);
-#endif // SDL_REMOTE_CONTROL
+ policy_table::Strings groups;
+ if (access_remote_->IsAppRemoteControl(who)) {
+ groups = access_remote_->GetGroups(who);
+ LOG4CXX_INFO(logger_,
+ "CheckPermissions for " << app_id << " and rpc " << rpc
+ << " for " << hmi_level << " level.");
+ } else {
+ groups = cache_->GetGroups(app_id);
+ }
cache_->CheckPermissions(groups, hmi_level, rpc, result);
if (cache_->IsApplicationRevoked(app_id)) {
@@ -484,13 +482,11 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
std::string default_hmi;
default_hmi = "NONE";
-#ifdef SDL_REMOTE_CONTROL
const ApplicationOnDevice who = {device_id, application_id};
if (access_remote_->IsAppRemoteControl(who)) {
listener()->OnPermissionsUpdated(application_id, notification_data);
return;
}
-#endif // SDL_REMOTE_CONTROL
listener()->OnPermissionsUpdated(
application_id, notification_data, default_hmi);
@@ -728,14 +724,15 @@ void PolicyManagerImpl::GetPermissionsForApp(
}
FunctionalIdType group_types;
-#ifdef SDL_REMOTE_CONTROL
- allowed_by_default = false;
- bool ret = access_remote_->GetPermissionsForApp(
- device_id, policy_app_id, group_types);
-#else
- bool ret =
- cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types);
-#endif // REMOTE_CONTROL
+ const ApplicationOnDevice who = {device_id, app_id_to_check};
+ bool ret = false;
+ if (access_remote_->IsAppRemoteControl(who)) {
+ allowed_by_default = false;
+ ret = access_remote_->GetPermissionsForApp(
+ device_id, policy_app_id, group_types);
+ } else {
+ ret = cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types);
+ }
if (!ret) {
LOG4CXX_WARN(logger_,
@@ -1188,7 +1185,6 @@ void PolicyManagerImpl::RetrySequence() {
timer_retry_sequence_.Start(timeout_msec, timer::kPeriodic);
}
-#ifdef SDL_REMOTE_CONTROL
void PolicyManagerImpl::SetDefaultHmiTypes(const std::string& application_id,
const std::vector<int>& hmi_types) {
LOG4CXX_INFO(logger_, "SetDefaultHmiTypes");
@@ -1294,6 +1290,5 @@ void PolicyManagerImpl::set_access_remote(
utils::SharedPtr<AccessRemote> access_remote) {
access_remote_ = access_remote;
}
-#endif // SDL_REMOTE_CONTROL
} // namespace policy
diff --git a/src/components/policy/policy_regular/src/policy_table/enums.cc b/src/components/policy/policy_regular/src/policy_table/enums.cc
index 1dae9c5f96..2949ef315b 100644
--- a/src/components/policy/policy_regular/src/policy_table/enums.cc
+++ b/src/components/policy/policy_regular/src/policy_table/enums.cc
@@ -621,7 +621,6 @@ bool EnumFromJsonString(const std::string& literal, RequestType* result) {
}
}
-#ifdef SDL_REMOTE_CONTROL
bool IsValidEnum(ModuleType val) {
switch (val) {
case MT_CLIMATE:
@@ -654,7 +653,6 @@ bool EnumFromJsonString(const std::string& literal, ModuleType* result) {
return false;
}
}
-#endif // SDL_REMOTE_CONTROL
const std::string kDefaultApp = "default";
const std::string kPreDataConsentApp = "pre_DataConsent";
diff --git a/src/components/policy/policy_regular/src/policy_table/types.cc b/src/components/policy/policy_regular/src/policy_table/types.cc
index c4846c0d40..c983e4f12b 100644
--- a/src/components/policy/policy_regular/src/policy_table/types.cc
+++ b/src/components/policy/policy_regular/src/policy_table/types.cc
@@ -168,11 +168,7 @@ ApplicationParams::ApplicationParams(const Json::Value* value__)
, memory_kb(impl::ValueMember(value__, "memory_kb"), 0)
, heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms"))
, certificate(impl::ValueMember(value__, "certificate"), "not_specified")
-#ifdef SDL_REMOTE_CONTROL
- , moduleType(impl::ValueMember(value__, "moduleType"))
-#endif // SDL_REMOTE_CONTROL
-{
-}
+ , moduleType(impl::ValueMember(value__, "moduleType")) {}
Json::Value ApplicationParams::ToJsonValue() const {
Json::Value result__(PolicyBase::ToJsonValue());
@@ -184,9 +180,7 @@ Json::Value ApplicationParams::ToJsonValue() const {
impl::WriteJsonField("memory_kb", memory_kb, &result__);
impl::WriteJsonField(
"heart_beat_timeout_ms", heart_beat_timeout_ms, &result__);
-#ifdef SDL_REMOTE_CONTROL
impl::WriteJsonField("moduleType", moduleType, &result__);
-#endif // SDL_REMOTE_CONTROL
return result__;
}
@@ -215,11 +209,9 @@ bool ApplicationParams::is_valid() const {
if (!certificate.is_valid()) {
return false;
}
-#ifdef SDL_REMOTE_CONTROL
if (!moduleType.is_valid()) {
return false;
}
-#endif // SDL_REMOTE_CONTROL
return Validate();
}
@@ -255,11 +247,9 @@ bool ApplicationParams::struct_empty() const {
if (certificate.is_initialized()) {
return false;
}
-#ifdef SDL_REMOTE_CONTROL
if (moduleType.is_initialized()) {
return false;
}
-#endif // SDL_REMOTE_CONTROL
return true;
}
@@ -295,11 +285,9 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
if (!certificate.is_valid()) {
certificate.ReportErrors(&report__->ReportSubobject("certificate"));
}
-#ifdef SDL_REMOTE_CONTROL
if (!moduleType.is_valid()) {
moduleType.ReportErrors(&report__->ReportSubobject("moduleType"));
}
-#endif // SDL_REMOTE_CONTROL
}
void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
@@ -311,9 +299,7 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
memory_kb.SetPolicyTableType(pt_type);
heart_beat_timeout_ms.SetPolicyTableType(pt_type);
certificate.SetPolicyTableType(pt_type);
-#ifdef SDL_REMOTE_CONTROL
moduleType.SetPolicyTableType(pt_type);
-#endif // SDL_REMOTE_CONTROL
}
// RpcParameters methods
diff --git a/src/components/policy/policy_regular/src/policy_table/validation.cc b/src/components/policy/policy_regular/src/policy_table/validation.cc
index e760293ea6..714dfaae5a 100644
--- a/src/components/policy/policy_regular/src/policy_table/validation.cc
+++ b/src/components/policy/policy_regular/src/policy_table/validation.cc
@@ -147,7 +147,6 @@ bool ApplicationPoliciesSection::Validate() const {
return true;
}
-#ifdef SDL_REMOTE_CONTROL
bool ApplicationParams::ValidateModuleTypes() const {
// moduleType is optional so see Optional<T>::is_valid()
bool is_initialized = moduleType->is_initialized();
@@ -181,11 +180,6 @@ bool ApplicationParams::ValidateModuleTypes() const {
bool ApplicationParams::Validate() const {
return ValidateModuleTypes();
}
-#else // SDL_REMOTE_CONTROL
-bool ApplicationParams::Validate() const {
- return true;
-}
-#endif // SDL_REMOTE_CONTROL
bool RpcParameters::Validate() const {
return true;
diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc
index a57230aeb1..b1e574578e 100644
--- a/src/components/policy/policy_regular/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc
@@ -723,7 +723,6 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
if (!GatherAppGroup(app_id, &params.groups)) {
return false;
}
-#ifdef SDL_REMOTE_CONTROL
bool denied = false;
if (!GatherRemoteControlDenied(app_id, &denied)) {
return false;
@@ -733,7 +732,6 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
return false;
}
}
-#endif // SDL_REMOTE_CONTROL
if (!GatherNickName(app_id, &*params.nicknames)) {
return false;
}
@@ -905,12 +903,10 @@ bool SQLPTRepresentation::SaveApplicationPoliciesSection(
LOG4CXX_WARN(logger_, "Incorrect delete from app_group.");
return false;
}
-#ifdef SDL_REMOTE_CONTROL
if (!query_delete.Exec(sql_pt::kDeleteModuleTypes)) {
LOG4CXX_WARN(logger_, "Incorrect delete from module_type.");
return false;
}
-#endif // SDL_REMOTE_CONTROL
if (!query_delete.Exec(sql_pt::kDeleteApplication)) {
LOG4CXX_WARN(logger_, "Incorrect delete from application.");
return false;
@@ -998,13 +994,11 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy(
if (!SaveAppGroup(app.first, app.second.groups)) {
return false;
}
-#ifdef SDL_REMOTE_CONTROL
bool denied = !app.second.moduleType->is_initialized();
if (!SaveRemoteControlDenied(app.first, denied) ||
!SaveModuleType(app.first, *app.second.moduleType)) {
return false;
}
-#endif // SDL_REMOTE_CONTROL
if (!SaveNickname(app.first, *app.second.nicknames)) {
return false;
}
@@ -1671,8 +1665,6 @@ bool SQLPTRepresentation::GatherAppGroup(
return true;
}
-#ifdef SDL_REMOTE_CONTROL
-
bool SQLPTRepresentation::GatherRemoteControlDenied(const std::string& app_id,
bool* denied) const {
LOG4CXX_AUTO_TRACE(logger_);
@@ -1862,7 +1854,6 @@ bool SQLPTRepresentation::GatherRemoteRpc(
}
return true;
}
-#endif // SDL_REMOTE_CONTROL
bool SQLPTRepresentation::SaveApplicationCustomData(const std::string& app_id,
bool is_revoked,
diff --git a/src/components/policy/policy_regular/test/CMakeLists.txt b/src/components/policy/policy_regular/test/CMakeLists.txt
index 62ff691f83..bd6af96867 100644
--- a/src/components/policy/policy_regular/test/CMakeLists.txt
+++ b/src/components/policy/policy_regular/test/CMakeLists.txt
@@ -45,11 +45,6 @@ include_directories(
)
collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
-if (NOT REMOTE_CONTROL)
- list (REMOVE_ITEM SOURCES
- ${CMAKE_CURRENT_SOURCE_DIR}/access_remote_impl_test.cc
- )
-endif ()
set(LIBRARIES
gmock
diff --git a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
index 5fd0a48f7c..e4e361c52c 100644
--- a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
+++ b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
@@ -53,9 +53,8 @@
#include "utils/date_time.h"
#include "utils/make_shared.h"
#include "utils/gen_hash.h"
-#ifdef SDL_REMOTE_CONTROL
#include "policy/mock_access_remote.h"
-#endif // SDL_REMOTE_CONTROL
+
using ::testing::ReturnRef;
using ::testing::DoAll;
using ::testing::SetArgReferee;
@@ -146,20 +145,15 @@ class PolicyManagerImplTest : public ::testing::Test {
MockCacheManagerInterface* cache_manager;
NiceMock<MockPolicyListener> listener;
const std::string device_id;
-#ifdef SDL_REMOTE_CONTROL
utils::SharedPtr<access_remote_test::MockAccessRemote> access_remote;
-#endif // SDL_REMOTE_CONTROL
void SetUp() OVERRIDE {
manager = new PolicyManagerImpl();
manager->set_listener(&listener);
cache_manager = new MockCacheManagerInterface();
manager->set_cache_manager(cache_manager);
-
-#ifdef SDL_REMOTE_CONTROL
access_remote = new access_remote_test::MockAccessRemote();
manager->set_access_remote(access_remote);
-#endif // SDL_REMOTE_CONTROL
}
void TearDown() OVERRIDE {