diff options
author | Frédéric Boisnard <fredericx.boisnard@intel.com> | 2013-03-15 14:46:23 +0100 |
---|---|---|
committer | David Wagner <david.wagner@intel.com> | 2014-02-12 17:03:48 +0100 |
commit | 150407ca611581cdd41629ec6d1cf64ea0d72b18 (patch) | |
tree | d759e41e5efb2574ce038a75b374d1432890079f | |
parent | a6df5da93a24e0ea0db4ba9280db96dde03b32a6 (diff) | |
download | external_parameter-framework-150407ca611581cdd41629ec6d1cf64ea0d72b18.zip external_parameter-framework-150407ca611581cdd41629ec6d1cf64ea0d72b18.tar.gz external_parameter-framework-150407ca611581cdd41629ec6d1cf64ea0d72b18.tar.bz2 |
[PFW] Fix issue when setting a parameter of a configuration not applicable
BZ: 93374
This patch aims to fix an issue when using the command setConfigurationParameter
to update the value of a parameter of a configuration.
The autosync shall be turned off when updating the value of a parameter in a
configuration that is not currently applicable.
Change-Id: I12f9d37e544dc7b54f1bed0470783fdfc8568b7c
Signed-off-by: Frédéric Boisnard <fredericx.boisnard@intel.com>
Reviewed-on: http://android.intel.com:8080/96832
Reviewed-by: cactus <cactus@intel.com>
Reviewed-by: Gonzalve, Sebastien <sebastien.gonzalve@intel.com>
Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com>
Reviewed-by: De Chivre, Renaud <renaud.de.chivre@intel.com>
Reviewed-by: Benavoli, Patrick <patrick.benavoli@intel.com>
Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
-rw-r--r-- | parameter/ParameterAccessContext.cpp | 18 | ||||
-rw-r--r-- | parameter/ParameterAccessContext.h | 11 | ||||
-rw-r--r-- | parameter/ParameterMgr.cpp | 20 |
3 files changed, 35 insertions, 14 deletions
diff --git a/parameter/ParameterAccessContext.cpp b/parameter/ParameterAccessContext.cpp index 05e3cc3..61d54a3 100644 --- a/parameter/ParameterAccessContext.cpp +++ b/parameter/ParameterAccessContext.cpp @@ -26,22 +26,30 @@ #define base CErrorContext -CParameterAccessContext::CParameterAccessContext(string& strError, CParameterBlackboard* pParameterBlackboard, bool bValueSpaceIsRaw, bool bOutputRawFormatIsHex, uint32_t uiBaseOffset) +CParameterAccessContext::CParameterAccessContext(string& strError, + CParameterBlackboard* pParameterBlackboard, + bool bValueSpaceIsRaw, + bool bOutputRawFormatIsHex, + uint32_t uiBaseOffset) : base(strError), _pParameterBlackboard(pParameterBlackboard), _bValueSpaceIsRaw(bValueSpaceIsRaw), _bOutputRawFormatIsHex(bOutputRawFormatIsHex), - _bBigEndianSubsystem(false), _bAutoSync(true), _uiBaseOffset(uiBaseOffset) + _bBigEndianSubsystem(false), _bAutoSync(false), _uiBaseOffset(uiBaseOffset) { } -CParameterAccessContext::CParameterAccessContext(string& strError, bool bBigEndianSubsystem, CParameterBlackboard* pParameterBlackboard, uint32_t uiBaseOffset) +CParameterAccessContext::CParameterAccessContext(string& strError, + bool bBigEndianSubsystem, + CParameterBlackboard* pParameterBlackboard, + uint32_t uiBaseOffset) : base(strError), _pParameterBlackboard(pParameterBlackboard), _bValueSpaceIsRaw(false), - _bOutputRawFormatIsHex(false), _bBigEndianSubsystem(bBigEndianSubsystem), _bAutoSync(true), _uiBaseOffset(uiBaseOffset) + _bOutputRawFormatIsHex(false), _bBigEndianSubsystem(bBigEndianSubsystem), _bAutoSync(false), + _uiBaseOffset(uiBaseOffset) { } CParameterAccessContext::CParameterAccessContext(string& strError) : base(strError), _pParameterBlackboard(NULL), _bValueSpaceIsRaw(false), - _bOutputRawFormatIsHex(false), _bBigEndianSubsystem(false), _bAutoSync(true), _uiBaseOffset(0) + _bOutputRawFormatIsHex(false), _bBigEndianSubsystem(false), _bAutoSync(false), _uiBaseOffset(0) { } diff --git a/parameter/ParameterAccessContext.h b/parameter/ParameterAccessContext.h index f0ca74f..72982f8 100644 --- a/parameter/ParameterAccessContext.h +++ b/parameter/ParameterAccessContext.h @@ -32,8 +32,15 @@ class CParameterBlackboard; class CParameterAccessContext : public CErrorContext { public: - CParameterAccessContext(string& strError, CParameterBlackboard* pParameterBlackboard, bool bValueSpaceIsRaw, bool bOutputRawFormatIsHex = false, uint32_t uiOffsetBase = 0); - CParameterAccessContext(string& strError, bool bBigEndianSubsystem, CParameterBlackboard* pParameterBlackboard, uint32_t uiOffsetBase = 0); + CParameterAccessContext(string& strError, + CParameterBlackboard* pParameterBlackboard, + bool bValueSpaceIsRaw, + bool bOutputRawFormatIsHex = false, + uint32_t uiOffsetBase = 0); + CParameterAccessContext(string& strError, + bool bBigEndianSubsystem, + CParameterBlackboard* pParameterBlackboard, + uint32_t uiOffsetBase = 0); CParameterAccessContext(string& strError); // ParameterBlackboard diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp index e8ab863..092a496 100644 --- a/parameter/ParameterMgr.cpp +++ b/parameter/ParameterMgr.cpp @@ -1333,6 +1333,12 @@ bool CParameterMgr::accessParameterValue(const string& strPath, string& strValue // Define context CParameterAccessContext parameterAccessContext(strError, _pMainParameterBlackboard, _bValueSpaceIsRaw, _bOutputRawFormatIsHex); + // Activate the auto synchronization with the hardware + if (bSet) { + + parameterAccessContext.setAutoSync(_bAutoSyncOn); + } + return accessValue(parameterAccessContext, strPath, strValue, bSet, strError); } @@ -1366,7 +1372,7 @@ bool CParameterMgr::accessConfigurationValue(const string& strDomain, const stri /// Update the Configuration Blackboard - // Define Configuration context using Base Offset + // Define Configuration context using Base Offset and keep Auto Sync off to prevent access to HW CParameterAccessContext parameterAccessContext(strError, pConfigurationBlackboard, _bValueSpaceIsRaw, _bOutputRawFormatIsHex, uiBaseOffset); // Access Value in the Configuration Blackboard @@ -1382,6 +1388,12 @@ bool CParameterMgr::accessConfigurationValue(const string& strDomain, const stri // Define Main context parameterAccessContext.setParameterBlackboard(_pMainParameterBlackboard); + // Activate the auto synchronization with the hardware + if (bSet) { + + parameterAccessContext.setAutoSync(_bAutoSyncOn); + } + // Access Value in the Main Blackboard return accessValue(parameterAccessContext, strPath, strValue, bSet, strError); } @@ -1403,12 +1415,6 @@ bool CParameterMgr::accessValue(CParameterAccessContext& parameterAccessContext, return false; } - // Auto Sync - if (bSet) { - - parameterAccessContext.setAutoSync(_bAutoSyncOn); - } - // Do the get return getConstSystemClass()->accessValue(pathNavigator, strValue, bSet, parameterAccessContext); } |