aboutsummaryrefslogtreecommitdiffstats
path: root/parameter/BooleanParameterType.cpp
diff options
context:
space:
mode:
authorFrédéric Boisnard <fredericx.boisnard@intel.com>2013-03-27 11:48:15 +0100
committerDavid Wagner <david.wagner@intel.com>2014-02-12 17:03:48 +0100
commit2bc8bc68f508680a724f987f7d17401fb2f647f4 (patch)
tree47fcef9ef9117215645f8ba1663eb7381d3017a2 /parameter/BooleanParameterType.cpp
parent150407ca611581cdd41629ec6d1cf64ea0d72b18 (diff)
downloadexternal_parameter-framework-2bc8bc68f508680a724f987f7d17401fb2f647f4.zip
external_parameter-framework-2bc8bc68f508680a724f987f7d17401fb2f647f4.tar.gz
external_parameter-framework-2bc8bc68f508680a724f987f7d17401fb2f647f4.tar.bz2
[PFW] Fix display error when using getConfigurationParameter with BooleanParameters
BZ: 96140 When using getConfigurationParameter on a BooleanParameter, the displayed value is duplicated on the output if the configuration is applicable. The method CParameterMgr::accessConfigurationValue() accesses the element twice when the configuration is the last one applied (in order to update the parameter value in both the configuration blackboard and the main blackboard). The output result is managed using a string passed as reference to ParameterMgr::accessValue() and then to CBooleanParameterType::fromBlackboard(). In the latest method, the boolean value is appended to the output string, however no check is performed to make sure that the string is empty before being used. As the method is called twice with the same output string, we end up with a dupplicated output. This fix updates CBooleanParameterType::fromBlackboard() in order to make sure that the output string is overwritten with the current result. Change-Id: I394366910b1ddc0c8bbe570aa357e007745613db Signed-off-by: Frédéric Boisnard <fredericx.boisnard@intel.com> Reviewed-on: http://android.intel.com:8080/98648 Reviewed-by: cactus <cactus@intel.com> Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com> Reviewed-by: Benavoli, Patrick <patrick.benavoli@intel.com> Reviewed-by: Gonzalve, Sebastien <sebastien.gonzalve@intel.com> Tested-by: Barthes, FabienX <fabienx.barthes@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'parameter/BooleanParameterType.cpp')
-rw-r--r--parameter/BooleanParameterType.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/parameter/BooleanParameterType.cpp b/parameter/BooleanParameterType.cpp
index cbe4afd..34f148c 100644
--- a/parameter/BooleanParameterType.cpp
+++ b/parameter/BooleanParameterType.cpp
@@ -73,13 +73,13 @@ bool CBooleanParameterType::toBlackboard(const string& strValue, uint32_t& uiVal
bool CBooleanParameterType::fromBlackboard(string& strValue, const uint32_t& uiValue, CParameterAccessContext& parameterAccessContext) const
{
+ strValue = uiValue ? "1" : "0";
+
if (parameterAccessContext.valueSpaceIsRaw() && parameterAccessContext.outputRawFormatIsHex()) {
- strValue = "0x";
+ strValue = "0x" + strValue;
}
- strValue += uiValue ? "1" : "0";
-
return true;
}