From 962ff7b523d81249dfc1eb6870b7a6249893e2ea Mon Sep 17 00:00:00 2001 From: David Wagner Date: Fri, 16 Jan 2015 16:59:06 +0100 Subject: ParameterMgr: add a method to forcefully disable the remote interface In some setup, users might not want to start the remote interface even if the toplevel configuration file allows it. The parameter-framework client can now override the remote interface starting policy. This was, until now, only dictated by the 'TuningAllowed' attribute in the toplevel configuration file and the presence of the libremote-processor library. This method is forwarded to the connectors and the bindings. Change-Id: Ib6dc272dfc7114125fdafd1a58642cde88847752 Signed-off-by: David Wagner --- parameter/ParameterMgr.cpp | 16 ++++++++++++++++ parameter/ParameterMgr.h | 17 +++++++++++++++++ parameter/ParameterMgrFullConnector.cpp | 10 ++++++++++ parameter/ParameterMgrPlatformConnector.cpp | 10 ++++++++++ parameter/include/ParameterMgrFullConnector.h | 13 +++++++++++++ parameter/include/ParameterMgrPlatformConnector.h | 13 +++++++++++++ 6 files changed, 79 insertions(+) (limited to 'parameter') diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp index 1d77666..4b8bdf6 100644 --- a/parameter/ParameterMgr.cpp +++ b/parameter/ParameterMgr.cpp @@ -306,6 +306,7 @@ CParameterMgr::CParameterMgr(const string& strConfigurationFilePath) : _uiMaxCommandUsageLength(0), _pLogger(NULL), _uiLogDepth(0), + _bForceNoRemoteInterface(false), _bFailOnMissingSubsystem(true), _bFailOnFailedSettingsLoad(true), _bValidateSchemasOnStart(false) @@ -2426,11 +2427,26 @@ void CParameterMgr::feedElementLibraries() _pElementLibrarySet->addElementLibrary(pParameterConfigurationLibrary); } +bool CParameterMgr::getForceNoRemoteInterface() const +{ + return _bForceNoRemoteInterface; +} + +void CParameterMgr::setForceNoRemoteInterface(bool bForceNoRemoteInterface) +{ + _bForceNoRemoteInterface = bForceNoRemoteInterface; +} + // Remote Processor Server connection handling bool CParameterMgr::handleRemoteProcessingInterface(string& strError) { CAutoLog autoLog(this, "Handling remote processing interface"); + if (_bForceNoRemoteInterface) { + // The user requested not to start the remote interface + return true; + } + // Start server if tuning allowed if (getConstFrameworkConfiguration()->isTuningAllowed()) { diff --git a/parameter/ParameterMgr.h b/parameter/ParameterMgr.h index de948ba..c6a2fd5 100644 --- a/parameter/ParameterMgr.h +++ b/parameter/ParameterMgr.h @@ -143,6 +143,17 @@ public: // Dynamic parameter handling CParameterHandle* createParameterHandle(const std::string& strPath, std::string& strError); + /** Is the remote interface forcefully disabled ? + */ + bool getForceNoRemoteInterface() const; + + /** + * Forcefully disable the remote interface or cancel this policy + * + * @param[in] bForceNoRemoteInterface disable the remote interface if true. + */ + void setForceNoRemoteInterface(bool bForceNoRemoteInterface); + /** Should start fail in case of missing subsystems. * * @param[in] bFail: If set to true, parameterMgr start will fail on missing subsystems. @@ -614,6 +625,12 @@ private: ILogger* _pLogger; mutable uint32_t _uiLogDepth; + /** If set to false, the remote interface won't be started no matter what. + * If set to true - the default - it has no impact on the policy for + * starting the remote interface. + */ + bool _bForceNoRemoteInterface; + /** If set to true, missing subsystem will abort parameterMgr start. * If set to false, missing subsystem will fallback on virtual subsystem. */ diff --git a/parameter/ParameterMgrFullConnector.cpp b/parameter/ParameterMgrFullConnector.cpp index 9cd2441..b03facc 100644 --- a/parameter/ParameterMgrFullConnector.cpp +++ b/parameter/ParameterMgrFullConnector.cpp @@ -95,6 +95,16 @@ ISelectionCriterionInterface* CParameterMgrFullConnector::getSelectionCriterion( return _pParameterMgr->getSelectionCriterion(strName); } +bool CParameterMgrFullConnector::getForceNoRemoteInterface() const +{ + return _pParameterMgr->getForceNoRemoteInterface(); +} + +void CParameterMgrFullConnector::setForceNoRemoteInterface(bool bForceNoRemoteInterface) +{ + _pParameterMgr->setForceNoRemoteInterface(bForceNoRemoteInterface); +} + void CParameterMgrFullConnector::applyConfigurations() { return _pParameterMgr->applyConfigurations(); diff --git a/parameter/ParameterMgrPlatformConnector.cpp b/parameter/ParameterMgrPlatformConnector.cpp index f1ca539..f29c8a8 100644 --- a/parameter/ParameterMgrPlatformConnector.cpp +++ b/parameter/ParameterMgrPlatformConnector.cpp @@ -93,6 +93,16 @@ void CParameterMgrPlatformConnector::setLogger(CParameterMgrPlatformConnector::I _pLogger = pLogger; } +bool CParameterMgrPlatformConnector::getForceNoRemoteInterface() const +{ + return _pParameterMgr->getForceNoRemoteInterface(); +} + +void CParameterMgrPlatformConnector::setForceNoRemoteInterface(bool bForceNoRemoteInterface) +{ + _pParameterMgr->setForceNoRemoteInterface(bForceNoRemoteInterface); +} + bool CParameterMgrPlatformConnector::setFailureOnMissingSubsystem(bool bFail, string &strError) { if (_bStarted) { diff --git a/parameter/include/ParameterMgrFullConnector.h b/parameter/include/ParameterMgrFullConnector.h index 63d3cf0..8ef7bb7 100644 --- a/parameter/include/ParameterMgrFullConnector.h +++ b/parameter/include/ParameterMgrFullConnector.h @@ -71,6 +71,19 @@ public: const ISelectionCriterionTypeInterface* pSelectionCriterionType); ISelectionCriterionInterface* getSelectionCriterion(const std::string& strName); + /** Is the remote interface forcefully disabled ? + */ + bool getForceNoRemoteInterface() const; + + /** + * Forcefully disable the remote interface or cancel this policy. + * + * Has no effect if called after calling start(). + * + * @param[in] bForceNoRemoteInterface disable the remote interface if true. + */ + void setForceNoRemoteInterface(bool bForceNoRemoteInterface); + void applyConfigurations(); /** Should start fail in case of missing subsystems. diff --git a/parameter/include/ParameterMgrPlatformConnector.h b/parameter/include/ParameterMgrPlatformConnector.h index d8ae433..cd99215 100644 --- a/parameter/include/ParameterMgrPlatformConnector.h +++ b/parameter/include/ParameterMgrPlatformConnector.h @@ -78,6 +78,19 @@ public: // Must be cassed after successfull start CParameterHandle* createParameterHandle(const std::string& strPath, std::string& strError) const; + /** Is the remote interface forcefully disabled ? + */ + bool getForceNoRemoteInterface() const; + + /** + * Forcefully disable the remote interface or cancel this policy. + * + * Has no effect if called after calling start(). + * + * @param[in] bForceNoRemoteInterface disable the remote interface if true. + */ + void setForceNoRemoteInterface(bool bForceNoRemoteInterface); + /** Should start fail in case of missing subsystems. * * Will fail if called on started instance. -- cgit v1.1