summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorAndrey Oleynik <aoleynik@luxoft.com>2017-08-21 10:15:52 +0300
committerAndrey Oleynik <aoleynik@luxoft.com>2017-08-21 16:02:16 +0300
commit6fa778daef5b67589c84d3ca6b9b83db35243595 (patch)
tree43b01bbd75fa8e7d14c717c95865e972ebde1875 /src/components
parent8f546b0a662d3cf3f40c014c7abc2bbdcab056be (diff)
downloadsdl_core-6fa778daef5b67589c84d3ca6b9b83db35243595.tar.gz
Removes obsolete enable/disable interfaces from RC
Diffstat (limited to 'src/components')
-rw-r--r--src/components/application_manager/include/application_manager/core_service.h11
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h12
-rw-r--r--src/components/application_manager/include/application_manager/service.h11
-rw-r--r--src/components/application_manager/src/core_service.cc13
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc10
-rw-r--r--src/components/application_manager/test/rc_policy_handler_test.cc15
-rw-r--r--src/components/functional_module/test/include/mock_service.h3
-rw-r--r--src/components/include/application_manager/policies/policy_handler_interface.h12
-rw-r--r--src/components/include/policy/policy_external/policy/policy_manager.h12
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_manager.h12
-rw-r--r--src/components/include/test/application_manager/policies/mock_policy_handler_interface.h4
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_manager.h2
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h2
-rw-r--r--src/components/policy/policy_external/include/policy/access_remote.h21
-rw-r--r--src/components/policy/policy_external/include/policy/access_remote_impl.h5
-rw-r--r--src/components/policy/policy_external/include/policy/policy_manager_impl.h2
-rw-r--r--src/components/policy/policy_external/src/access_remote_impl.cc34
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc20
-rw-r--r--src/components/policy/policy_regular/include/policy/access_remote.h22
-rw-r--r--src/components/policy/policy_regular/include/policy/access_remote_impl.h7
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_manager_impl.h2
-rw-r--r--src/components/policy/policy_regular/src/access_remote_impl.cc33
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc20
-rw-r--r--src/components/policy/policy_regular/test/access_remote_impl_test.cc14
-rw-r--r--src/components/remote_control/include/remote_control/policy_helper.h50
-rw-r--r--src/components/remote_control/src/policy_helper.cc47
-rw-r--r--src/components/remote_control/src/remote_control_plugin.cc1
27 files changed, 4 insertions, 393 deletions
diff --git a/src/components/application_manager/include/application_manager/core_service.h b/src/components/application_manager/include/application_manager/core_service.h
index 2ff5a8ed79..0ea1dbc344 100644
--- a/src/components/application_manager/include/application_manager/core_service.h
+++ b/src/components/application_manager/include/application_manager/core_service.h
@@ -118,17 +118,6 @@ class CoreService : public Service {
uint32_t GetDeviceHandlerById(const std::string& device_id) FINAL;
/**
- * Sets mode of remote control (on/off)
- * @param enabled true if remote control is turned on
- */
- void SetRemoteControl(bool enabled) FINAL;
-
- /**
- * @brief Is Remote Control allowed by Policy and User
- */
- bool IsRemoteControlAllowed() const FINAL;
-
- /**
* Checks if application has remote control functions
* @param app application
* @return true if application has remote control functions
diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h
index 0b1445039a..3125997b33 100644
--- a/src/components/application_manager/include/application_manager/policies/policy_handler.h
+++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h
@@ -188,18 +188,6 @@ class PolicyHandler : public PolicyHandlerInterface,
void ResetAccess(const std::string& module) OVERRIDE;
/**
- * Sets mode of remote control (on/off)
- * @param enabled true if remote control is turned on
- */
- void SetRemoteControl(bool enabled) OVERRIDE;
-
- /**
- * @brief If remote control is enabled
- * by User and by Policy
- */
- bool GetRemoteControl() const OVERRIDE;
-
- /**
* @brief Notifies Remote apps about change in permissions
* @param device_id Device on which app is running
* @param application_id ID of app whose permissions are changed
diff --git a/src/components/application_manager/include/application_manager/service.h b/src/components/application_manager/include/application_manager/service.h
index c1666554be..33a41c272d 100644
--- a/src/components/application_manager/include/application_manager/service.h
+++ b/src/components/application_manager/include/application_manager/service.h
@@ -118,17 +118,6 @@ class Service {
virtual uint32_t GetDeviceHandlerById(const std::string& device_id) = 0;
/**
- * Sets mode of remote control (on/off)
- * @param enabled true if remote control is turned on
- */
- virtual void SetRemoteControl(bool enabled) = 0;
-
- /**
- * @brief Is Remote Control allowed by Policy and User
- */
- virtual bool IsRemoteControlAllowed() const = 0;
-
- /**
* @brief Get pointer to application by application id
* @param app_id application id
* return pointer to application
diff --git a/src/components/application_manager/src/core_service.cc b/src/components/application_manager/src/core_service.cc
index dd37484591..2e50503582 100644
--- a/src/components/application_manager/src/core_service.cc
+++ b/src/components/application_manager/src/core_service.cc
@@ -147,19 +147,6 @@ uint32_t CoreService::GetDeviceHandlerById(const std::string& device_id) {
return device_handle;
}
-void CoreService::SetRemoteControl(bool enabled) {
-#ifdef SDL_REMOTE_CONTROL
- application_manager_.GetPolicyHandler().SetRemoteControl(enabled);
-#endif // SDL_REMOTE_CONTROL
-}
-
-bool CoreService::IsRemoteControlAllowed() const {
-#ifdef SDL_REMOTE_CONTROL
- return application_manager_.GetPolicyHandler().GetRemoteControl();
-#endif // SDL_REMOTE_CONTROL
- return false;
-}
-
bool CoreService::IsRemoteControlApplication(ApplicationSharedPtr app) const {
#ifdef SDL_REMOTE_CONTROL
return application_manager_.GetPolicyHandler().CheckHMIType(
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index bf5d19eed6..49fd31f564 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -2025,16 +2025,6 @@ void PolicyHandler::ResetAccess(const std::string& module) {
policy_manager_->ResetAccess(module);
}
-void PolicyHandler::SetRemoteControl(bool enabled) {
- POLICY_LIB_CHECK_VOID();
- policy_manager_->SetRemoteControl(enabled);
-}
-
-bool PolicyHandler::GetRemoteControl() const {
- POLICY_LIB_CHECK(false);
- return policy_manager_->GetRemoteControl();
-}
-
void PolicyHandler::OnRemoteAppPermissionsChanged(
const std::string& device_id, const std::string& application_id) {
POLICY_LIB_CHECK_VOID();
diff --git a/src/components/application_manager/test/rc_policy_handler_test.cc b/src/components/application_manager/test/rc_policy_handler_test.cc
index 78d4f5a359..bd6d0a7ad8 100644
--- a/src/components/application_manager/test/rc_policy_handler_test.cc
+++ b/src/components/application_manager/test/rc_policy_handler_test.cc
@@ -330,21 +330,6 @@ ACTION_P(SetDeviceHandle, handle) {
*arg1 = handle;
}
-TEST_F(RCPolicyHandlerTest, GetRemoteControl_SUCCESS) {
- EnablePolicyAndPolicyManagerMock();
- EXPECT_CALL(*mock_policy_manager_, GetRemoteControl()).WillOnce(Return(true));
-
- EXPECT_TRUE(policy_handler_.GetRemoteControl());
-}
-
-TEST_F(RCPolicyHandlerTest, SetRemoteControl_SUCCESS) {
- EnablePolicyAndPolicyManagerMock();
- const bool enabled(true);
- EXPECT_CALL(*mock_policy_manager_, SetRemoteControl(enabled));
-
- policy_handler_.SetRemoteControl(enabled);
-}
-
TEST_F(RCPolicyHandlerTest,
OnRemoteAppPermissionsChanged_DifferentDeviceHandle_SUCCESS) {
EnablePolicyAndPolicyManagerMock();
diff --git a/src/components/functional_module/test/include/mock_service.h b/src/components/functional_module/test/include/mock_service.h
index 0297855246..a4cd769022 100644
--- a/src/components/functional_module/test/include/mock_service.h
+++ b/src/components/functional_module/test/include/mock_service.h
@@ -68,11 +68,8 @@ class MockService : public Service {
MOCK_METHOD1(ResetAccess, void(const ApplicationId& app_id));
MOCK_METHOD1(ResetAccess, void(const std::string& module));
MOCK_METHOD1(GetDeviceHandlerById, uint32_t(const std::string& device_id));
- MOCK_METHOD1(SetRemoteControl, void(bool enabled));
MOCK_METHOD1(RemoveHMIFakeParameters,
void(application_manager::MessagePtr& message));
- MOCK_CONST_METHOD0(IsRemoteControlAllowed, bool());
-
MOCK_CONST_METHOD1(IsRemoteControlApplication,
bool(ApplicationSharedPtr app));
MOCK_CONST_METHOD1(IsInterfaceAvailable,
diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h
index e49d86290c..47036340d1 100644
--- a/src/components/include/application_manager/policies/policy_handler_interface.h
+++ b/src/components/include/application_manager/policies/policy_handler_interface.h
@@ -495,18 +495,6 @@ class PolicyHandlerInterface {
virtual void ResetAccess(const std::string& module) = 0;
/**
- * Sets mode of remote control (on/off)
- * @param enabled true if remote control is turned on
- */
- virtual void SetRemoteControl(bool enabled) = 0;
-
- /**
- * @brief If remote control is enabled
- * by User and by Policy
- */
- virtual bool GetRemoteControl() const = 0;
-
- /**
* @brief Notifies Remote apps about change in permissions
* @param device_id Device on which app is running
* @param application_id ID of app whose permissions are changed
diff --git a/src/components/include/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h
index f6d1396be8..626bd36167 100644
--- a/src/components/include/policy/policy_external/policy/policy_manager.h
+++ b/src/components/include/policy/policy_external/policy/policy_manager.h
@@ -565,18 +565,6 @@ class PolicyManager : public usage_statistics::StatisticsManager {
*/
virtual void ResetAccess(const PTString& module) = 0;
- /**
- * Sets mode of remote control (on/off)
- * @param enabled true if remote control is turned on
- */
- virtual void SetRemoteControl(bool enabled) = 0;
-
- /*
- * @brief If remote control is enabled
- * by User and by Policy
- */
- virtual bool GetRemoteControl() const = 0;
-
/*
* Send OnPermissionsChange notification to mobile app
* when it's permissions are changed.
diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h
index da59af08d8..a1e31d9244 100644
--- a/src/components/include/policy/policy_regular/policy/policy_manager.h
+++ b/src/components/include/policy/policy_regular/policy/policy_manager.h
@@ -539,18 +539,6 @@ class PolicyManager : public usage_statistics::StatisticsManager {
*/
virtual void ResetAccess(const PTString& module) = 0;
- /**
- * Sets mode of remote control (on/off)
- * @param enabled true if remote control is turned on
- */
- virtual void SetRemoteControl(bool enabled) = 0;
-
- /*
- * @brief If remote control is enabled
- * by User and by Policy
- */
- virtual bool GetRemoteControl() const = 0;
-
/*
* Send OnPermissionsChange notification to mobile app
* when it's permissions are changed.
diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
index 2acbb16032..eb1ba6d84e 100644
--- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
+++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
@@ -258,10 +258,6 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
MOCK_METHOD1(ResetAccess, void(const std::string& module));
- MOCK_METHOD1(SetRemoteControl, void(bool enabled));
-
- MOCK_CONST_METHOD0(GetRemoteControl, bool());
-
MOCK_METHOD2(OnRemoteAppPermissionsChanged,
void(const std::string& device_id,
const std::string& application_id));
diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
index 3739d96caf..9b26afa71d 100644
--- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
+++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
@@ -169,8 +169,6 @@ class MockPolicyManager : public PolicyManager {
MOCK_METHOD2(ResetAccess,
void(const PTString& dev_id, const PTString& app_id));
MOCK_METHOD1(ResetAccess, void(const PTString& module));
- MOCK_METHOD1(SetRemoteControl, void(bool enabled));
- MOCK_CONST_METHOD0(GetRemoteControl, bool());
MOCK_METHOD2(SendAppPermissionsChanged,
void(const std::string& device_id,
const std::string& application_id));
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
index 551b711ea0..d24b39632c 100644
--- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
+++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
@@ -168,8 +168,6 @@ class MockPolicyManager : public PolicyManager {
MOCK_METHOD2(ResetAccess,
void(const PTString& dev_id, const PTString& app_id));
MOCK_METHOD1(ResetAccess, void(const PTString& module));
- MOCK_METHOD1(SetRemoteControl, void(bool enabled));
- MOCK_CONST_METHOD0(GetRemoteControl, bool());
MOCK_METHOD2(SendAppPermissionsChanged,
void(const std::string& device_id,
const std::string& application_id));
diff --git a/src/components/policy/policy_external/include/policy/access_remote.h b/src/components/policy/policy_external/include/policy/access_remote.h
index 33524bf229..6fc2141dbd 100644
--- a/src/components/policy/policy_external/include/policy/access_remote.h
+++ b/src/components/policy/policy_external/include/policy/access_remote.h
@@ -94,27 +94,6 @@ class AccessRemote {
virtual ~AccessRemote() {}
/**
- * Initializes oneself
- */
- virtual void Init() = 0;
-
- /**
- * Enables remote control
- */
- virtual void Enable() = 0;
-
- /**
- * Disables remote control
- */
- virtual void Disable() = 0;
-
- /**
- * Checks if remote control is enabled
- * @return true if enabled
- */
- virtual bool IsEnabled() const = 0;
-
- /**
* Allows access subject to object
* @param who subject is dev_id and app_id
* @param what object is group_id
diff --git a/src/components/policy/policy_external/include/policy/access_remote_impl.h b/src/components/policy/policy_external/include/policy/access_remote_impl.h
index 749edd6ce2..1822b6b3ae 100644
--- a/src/components/policy/policy_external/include/policy/access_remote_impl.h
+++ b/src/components/policy/policy_external/include/policy/access_remote_impl.h
@@ -48,11 +48,6 @@ class AccessRemoteImpl : public AccessRemote {
AccessRemoteImpl();
explicit AccessRemoteImpl(utils::SharedPtr<CacheManager> cache);
- virtual void Init();
- virtual void Enable();
- virtual void Disable();
- virtual bool IsEnabled() const;
-
virtual void Allow(const Subject& who, const Object& what);
virtual void Deny(const Subject& who, const Object& what);
virtual void Reset(const Subject& who);
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 653dbf5281..3e6d08c2c4 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
@@ -394,8 +394,6 @@ class PolicyManagerImpl : public PolicyManager {
bool allowed);
virtual void ResetAccess(const PTString& dev_id, const PTString& app_id);
virtual void ResetAccess(const PTString& module);
- virtual void SetRemoteControl(bool enabled);
- virtual bool GetRemoteControl() const;
virtual void SendAppPermissionsChanged(const std::string& device_id,
const std::string& application_id);
virtual bool GetModuleTypes(const std::string& policy_app_id,
diff --git a/src/components/policy/policy_external/src/access_remote_impl.cc b/src/components/policy/policy_external/src/access_remote_impl.cc
index da18f26119..a5628c5790 100644
--- a/src/components/policy/policy_external/src/access_remote_impl.cc
+++ b/src/components/policy/policy_external/src/access_remote_impl.cc
@@ -110,20 +110,10 @@ struct ToModuleType {
}
};
-AccessRemoteImpl::AccessRemoteImpl()
- : cache_(new CacheManager()), enabled_(true), acl_() {}
+AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()), acl_() {}
AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr<CacheManager> cache)
- : cache_(cache), enabled_(true), acl_() {}
-
-void AccessRemoteImpl::Init() {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK(cache_->pt_);
-
- // TODO: Rework
-
- enabled_ = true;
-}
+ : cache_(cache), acl_() {}
TypeAccess AccessRemoteImpl::Check(const Subject& who,
const Object& what) const {
@@ -231,26 +221,6 @@ void AccessRemoteImpl::Reset() {
acl_.clear();
}
-void AccessRemoteImpl::Enable() {
- LOG4CXX_AUTO_TRACE(logger_);
- set_enabled(true);
-}
-
-void AccessRemoteImpl::Disable() {
- LOG4CXX_AUTO_TRACE(logger_);
- set_enabled(false);
-}
-
-void AccessRemoteImpl::set_enabled(bool value) {
- enabled_ = value;
- cache_->Backup();
-}
-
-bool AccessRemoteImpl::IsEnabled() const {
- LOG4CXX_AUTO_TRACE(logger_);
- return enabled_;
-}
-
void AccessRemoteImpl::SetDefaultHmiTypes(const Subject& who,
const std::vector<int>& hmi_types) {
LOG4CXX_AUTO_TRACE(logger_);
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 ec618859cd..2daf70654f 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -341,7 +341,6 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
listener_->OnCertificateUpdated(
*(pt_update->policy_table.module_config.certificate));
#ifdef SDL_REMOTE_CONTROL
- access_remote_->Init();
CheckPTUUpdatesChange(pt_update, policy_table_snapshot);
#endif // SDL_REMOTE_CONTROL
@@ -1906,9 +1905,6 @@ bool PolicyManagerImpl::InitPT(const std::string& file_name,
if (ret) {
RefreshRetrySequence();
update_status_manager_.OnPolicyInit(cache_->UpdateRequired());
-#ifdef SDL_REMOTE_CONTROL
- access_remote_->Init();
-#endif // SDL_REMOTE_CONTROL
}
return ret;
}
@@ -1999,9 +1995,6 @@ TypeAccess PolicyManagerImpl::CheckDriverConsent(
const std::string& rpc,
const RemoteControlParams& params) {
LOG4CXX_AUTO_TRACE(logger_);
- if (!access_remote_->IsEnabled()) {
- return TypeAccess::kDisallowed;
- }
return access_remote_->Check(who, what);
}
@@ -2048,19 +2041,6 @@ void PolicyManagerImpl::ResetAccess(const PTString& module) {
access_remote_->Reset(what);
}
-void PolicyManagerImpl::SetRemoteControl(bool enabled) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (enabled) {
- access_remote_->Enable();
- } else {
- access_remote_->Disable();
- }
-}
-
-bool PolicyManagerImpl::GetRemoteControl() const {
- return access_remote_->IsEnabled();
-}
-
void PolicyManagerImpl::SendHMILevelChanged(const Subject& who) {
std::string default_hmi("NONE");
if (GetDefaultHmi(who.app_id, &default_hmi)) {
diff --git a/src/components/policy/policy_regular/include/policy/access_remote.h b/src/components/policy/policy_regular/include/policy/access_remote.h
index 77555a54a7..dd0cbb0ce5 100644
--- a/src/components/policy/policy_regular/include/policy/access_remote.h
+++ b/src/components/policy/policy_regular/include/policy/access_remote.h
@@ -92,28 +92,6 @@ typedef std::vector<PTString> RemoteControlParams;
class AccessRemote {
public:
virtual ~AccessRemote() {}
-
- /**
- * Initializes oneself
- */
- virtual void Init() = 0;
-
- /**
- * Enables remote control
- */
- virtual void Enable() = 0;
-
- /**
- * Disables remote control
- */
- virtual void Disable() = 0;
-
- /**
- * Checks if remote control is enabled
- * @return true if enabled
- */
- virtual bool IsEnabled() const = 0;
-
/**
* Allows access subject to object
* @param who subject is dev_id and app_id
diff --git a/src/components/policy/policy_regular/include/policy/access_remote_impl.h b/src/components/policy/policy_regular/include/policy/access_remote_impl.h
index d15b707cca..8b89a42744 100644
--- a/src/components/policy/policy_regular/include/policy/access_remote_impl.h
+++ b/src/components/policy/policy_regular/include/policy/access_remote_impl.h
@@ -52,11 +52,6 @@ class AccessRemoteImpl : public AccessRemote {
AccessRemoteImpl();
explicit AccessRemoteImpl(utils::SharedPtr<CacheManager> cache);
- virtual void Init();
- virtual void Enable();
- virtual void Disable();
- virtual bool IsEnabled() const;
-
virtual void Allow(const Subject& who, const Object& what);
virtual void Deny(const Subject& who, const Object& what);
virtual void Reset(const Subject& who);
@@ -76,7 +71,6 @@ class AccessRemoteImpl : public AccessRemote {
std::vector<std::string>* modules);
private:
- inline void set_enabled(bool value);
const policy_table::AppHMITypes& HmiTypes(const Subject& who);
void GetGroupsIds(const std::string& device_id,
const std::string& app_id,
@@ -88,7 +82,6 @@ class AccessRemoteImpl : public AccessRemote {
bool CompareParameters(const policy_table::Strings& parameters,
RemoteControlParams* input) const;
utils::SharedPtr<CacheManager> cache_;
- bool enabled_;
AccessControlList acl_;
HMIList hmi_types_;
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 73286414be..91e45efd0e 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
@@ -365,8 +365,6 @@ class PolicyManagerImpl : public PolicyManager {
bool allowed);
virtual void ResetAccess(const PTString& dev_id, const PTString& app_id);
virtual void ResetAccess(const PTString& module);
- virtual void SetRemoteControl(bool enabled);
- virtual bool GetRemoteControl() const;
virtual void SendAppPermissionsChanged(const std::string& device_id,
const std::string& application_id);
virtual bool GetModuleTypes(const std::string& policy_app_id,
diff --git a/src/components/policy/policy_regular/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc
index e73184664f..1d7190d70c 100644
--- a/src/components/policy/policy_regular/src/access_remote_impl.cc
+++ b/src/components/policy/policy_regular/src/access_remote_impl.cc
@@ -111,19 +111,10 @@ struct ToModuleType {
};
AccessRemoteImpl::AccessRemoteImpl()
- : cache_(new CacheManager()), enabled_(true), acl_() {}
+ : cache_(new CacheManager()), acl_() {}
AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr<CacheManager> cache)
- : cache_(cache), enabled_(true), acl_() {}
-
-void AccessRemoteImpl::Init() {
- LOG4CXX_AUTO_TRACE(logger_);
- DCHECK(cache_->pt());
-
- // TODO: Rework
-
- enabled_ = true;
-}
+ : cache_(cache), acl_() {}
TypeAccess AccessRemoteImpl::Check(const Subject& who,
const Object& what) const {
@@ -231,26 +222,6 @@ void AccessRemoteImpl::Reset() {
acl_.clear();
}
-void AccessRemoteImpl::Enable() {
- LOG4CXX_AUTO_TRACE(logger_);
- set_enabled(true);
-}
-
-void AccessRemoteImpl::Disable() {
- LOG4CXX_AUTO_TRACE(logger_);
- set_enabled(false);
-}
-
-void AccessRemoteImpl::set_enabled(bool value) {
- enabled_ = value;
- cache_->Backup();
-}
-
-bool AccessRemoteImpl::IsEnabled() const {
- LOG4CXX_AUTO_TRACE(logger_);
- return enabled_;
-}
-
void AccessRemoteImpl::SetDefaultHmiTypes(const Subject& who,
const std::vector<int>& hmi_types) {
LOG4CXX_AUTO_TRACE(logger_);
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 7ca4c5f3ac..780874c43a 100644
--- a/src/components/policy/policy_regular/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc
@@ -215,7 +215,6 @@ bool PolicyManagerImpl::LoadPT(const std::string& file,
*(pt_update->policy_table.module_config.certificate));
}
#ifdef SDL_REMOTE_CONTROL
- access_remote_->Init();
CheckPTUUpdatesChange(pt_update, policy_table_snapshot);
#endif // SDL_REMOTE_CONTROL
@@ -1131,9 +1130,6 @@ bool PolicyManagerImpl::InitPT(const std::string& file_name,
if (ret) {
RefreshRetrySequence();
update_status_manager_.OnPolicyInit(cache_->UpdateRequired());
-#ifdef SDL_REMOTE_CONTROL
- access_remote_->Init();
-#endif // SDL_REMOTE_CONTROL
}
return ret;
}
@@ -1229,9 +1225,6 @@ TypeAccess PolicyManagerImpl::CheckDriverConsent(
const std::string& rpc,
const RemoteControlParams& params) {
LOG4CXX_AUTO_TRACE(logger_);
- if (!access_remote_->IsEnabled()) {
- return TypeAccess::kDisallowed;
- }
return access_remote_->Check(who, what);
}
@@ -1278,19 +1271,6 @@ void PolicyManagerImpl::ResetAccess(const PTString& module) {
access_remote_->Reset(what);
}
-void PolicyManagerImpl::SetRemoteControl(bool enabled) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (enabled) {
- access_remote_->Enable();
- } else {
- access_remote_->Disable();
- }
-}
-
-bool PolicyManagerImpl::GetRemoteControl() const {
- return access_remote_->IsEnabled();
-}
-
void PolicyManagerImpl::SendHMILevelChanged(const Subject& who) {
std::string default_hmi("NONE");
if (GetDefaultHmi(who.app_id, &default_hmi)) {
diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc
index 5b88a8ba42..0b6e2aa1fc 100644
--- a/src/components/policy/policy_regular/test/access_remote_impl_test.cc
+++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc
@@ -163,19 +163,6 @@ TEST(AccessRemoteImplTest, CheckModuleType) {
EXPECT_FALSE(access_remote.CheckModuleType("1234", policy_table::MT_CLIMATE));
}
-TEST(AccessRemoteImplTest, EnableDisable) {
- AccessRemoteImpl access_remote;
- access_remote.cache_->pt_ = new policy_table::Table();
-
- // Country is enabled
- access_remote.enabled_ = true;
- access_remote.Enable();
- EXPECT_TRUE(access_remote.IsEnabled());
-
- access_remote.Disable();
- EXPECT_FALSE(access_remote.IsEnabled());
-}
-
TEST(AccessRemoteImplTest, SetDefaultHmiTypes) {
AccessRemoteImpl access_remote;
@@ -194,7 +181,6 @@ TEST(AccessRemoteImplTest, SetDefaultHmiTypes) {
TEST(AccessRemoteImplTest, GetGroups) {
AccessRemoteImpl access_remote;
- access_remote.enabled_ = true;
Subject who = {"dev1", "1234"};
access_remote.hmi_types_[who].push_back(policy_table::AHT_REMOTE_CONTROL);
diff --git a/src/components/remote_control/include/remote_control/policy_helper.h b/src/components/remote_control/include/remote_control/policy_helper.h
deleted file mode 100644
index 8d1fcc184b..0000000000
--- a/src/components/remote_control/include/remote_control/policy_helper.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_POLICY_HELPER_H_
-#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_POLICY_HELPER_H_
-
-#include <string>
-#include "application_manager/application.h"
-#include "remote_control/remote_plugin_interface.h"
-
-namespace remote_control {
-
-class PolicyHelper {
- public:
- static void OnRSDLFunctionalityAllowing(bool allowed,
- RemotePluginInterface& rc_module);
-};
-
-} // namespace remote_control
-
-#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_POLICY_HELPER_H_
diff --git a/src/components/remote_control/src/policy_helper.cc b/src/components/remote_control/src/policy_helper.cc
deleted file mode 100644
index e50233fe2b..0000000000
--- a/src/components/remote_control/src/policy_helper.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "remote_control/policy_helper.h"
-#include "remote_control/remote_control_plugin.h"
-#include "remote_control/rc_app_extension.h"
-#include "utils/logger.h"
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControl")
-
-namespace remote_control {
-
-void PolicyHelper::OnRSDLFunctionalityAllowing(
- bool allowed, RemotePluginInterface& rc_module) {
- rc_module.service()->SetRemoteControl(allowed);
-}
-
-} // namespace remote_control
diff --git a/src/components/remote_control/src/remote_control_plugin.cc b/src/components/remote_control/src/remote_control_plugin.cc
index 5ecc587cfd..cd0f123ba8 100644
--- a/src/components/remote_control/src/remote_control_plugin.cc
+++ b/src/components/remote_control/src/remote_control_plugin.cc
@@ -36,7 +36,6 @@
#include "remote_control/rc_module_constants.h"
#include "remote_control/rc_app_extension.h"
#include "remote_control/message_helper.h"
-#include "remote_control/policy_helper.h"
#include "utils/logger.h"
#include "interfaces/MOBILE_API.h"
#include "utils/macro.h"