diff options
author | David Wagner <david.wagner@intel.com> | 2015-01-16 16:59:06 +0100 |
---|---|---|
committer | David Wagner <david.wagner@intel.com> | 2015-01-28 20:02:52 +0100 |
commit | 962ff7b523d81249dfc1eb6870b7a6249893e2ea (patch) | |
tree | ded0b501ce65c97eefb195bf7b3d896d6f289367 | |
parent | e6711f76f6baaccf449e85b2105fc0e64b20ab9a (diff) | |
download | external_parameter-framework-962ff7b523d81249dfc1eb6870b7a6249893e2ea.zip external_parameter-framework-962ff7b523d81249dfc1eb6870b7a6249893e2ea.tar.gz external_parameter-framework-962ff7b523d81249dfc1eb6870b7a6249893e2ea.tar.bz2 |
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 <david.wagner@intel.com>
-rw-r--r-- | bindings/python/pfw.i | 3 | ||||
-rw-r--r-- | parameter/ParameterMgr.cpp | 16 | ||||
-rw-r--r-- | parameter/ParameterMgr.h | 17 | ||||
-rw-r--r-- | parameter/ParameterMgrFullConnector.cpp | 10 | ||||
-rw-r--r-- | parameter/ParameterMgrPlatformConnector.cpp | 10 | ||||
-rw-r--r-- | parameter/include/ParameterMgrFullConnector.h | 13 | ||||
-rw-r--r-- | parameter/include/ParameterMgrPlatformConnector.h | 13 |
7 files changed, 82 insertions, 0 deletions
diff --git a/bindings/python/pfw.i b/bindings/python/pfw.i index da01cdc..ce27173 100644 --- a/bindings/python/pfw.i +++ b/bindings/python/pfw.i @@ -88,6 +88,9 @@ public: // Configuration application void applyConfigurations(); + bool getForceNoRemoteInterface() const; + void setForceNoRemoteInterface(bool bForceNoRemoteInterface); + void setFailureOnMissingSubsystem(bool bFail); bool getFailureOnMissingSubsystem() const; 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. |