diff options
author | Francois Gaffie <francois.gaffie@intel.com> | 2014-04-07 13:46:05 +0200 |
---|---|---|
committer | Mattijs Korpershoek <mattijsx.korpershoek@intel.com> | 2014-06-24 11:51:35 +0200 |
commit | 8ab7293fc32d078f558985b938fa5c71c2b0404b (patch) | |
tree | 4123046de6b599d346e339d5c6126744d63a499e /parameter/Parameter.cpp | |
parent | 01c7495e66caea59165316bc025a69cce1383311 (diff) | |
download | external_parameter-framework-8ab7293fc32d078f558985b938fa5c71c2b0404b.zip external_parameter-framework-8ab7293fc32d078f558985b938fa5c71c2b0404b.tar.gz external_parameter-framework-8ab7293fc32d078f558985b938fa5c71c2b0404b.tar.bz2 |
Restore autosync of string parameter
BZ: 183857
Sync for String parameter accessed from parameter handle API
does not work.
This patch allows synchronisation for string parameter accessed
from parameter handle APIs.
Change-Id: If738402f4c0fcb0bb51bd2515e46f3ac36a361dd
Signed-off-by: Francois Gaffie <francois.gaffie@intel.com>
Signed-off-by: Mattijs Korpershoek <mattijsx.korpershoek@intel.com>
Diffstat (limited to 'parameter/Parameter.cpp')
-rw-r--r-- | parameter/Parameter.cpp | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/parameter/Parameter.cpp b/parameter/Parameter.cpp index 631710d..75433dd 100644 --- a/parameter/Parameter.cpp +++ b/parameter/Parameter.cpp @@ -122,30 +122,36 @@ bool CParameter::accessAsDouble(double& dValue, bool bSet, CParameterAccessConte // Generic Access template <typename type> -bool CParameter::doAccess(type& value, bool bSet, CParameterAccessContext& parameterAccessContext) const +bool CParameter::doAccess(type& value, bool bSet, + CParameterAccessContext& parameterAccessContext) const { - bool bSuccess; - if (bSet) { + // set value + if (!doSet(value, getOffset() - parameterAccessContext.getBaseOffset(), + parameterAccessContext)) { - if (doSet(value, getOffset() - parameterAccessContext.getBaseOffset(), parameterAccessContext)) { + // Append parameter path to error + parameterAccessContext.appendToError(" " + getPath()); + return false; - // Synchronize - bSuccess = sync(parameterAccessContext); - } else { + } + // Synchronize + if (!sync(parameterAccessContext)){ - bSuccess = false; + parameterAccessContext.appendToError(" " + getPath()); + return false; } } else { + // get value + if (!doGet(value, getOffset() - parameterAccessContext.getBaseOffset(), + parameterAccessContext)) { - bSuccess = doGet(value, getOffset() - parameterAccessContext.getBaseOffset(), parameterAccessContext); - } - if (!bSuccess) { - - // Append parameter path to error - parameterAccessContext.appendToError(" " + getPath()); + // Append parameter path to error + parameterAccessContext.appendToError(" " + getPath()); + return false; + } } - return bSuccess; + return true; } template <typename type> |