PFW: Mapping optimization
BZ: 13906
As soon as a subsystem object is created, the mapping process
ceases to go deeper and explores other branches of the
parameter tree.
Adaptation to ICS environment in mk files
Change-Id: I5cdf3ea3829f59379804aa88be282b1128c598b0
Signed-off-by: Patrick Benavoli <patrickx.benavoli@intel.com>
Reviewed-on: http://android.intel.com:8080/25401
Reviewed-by: De Chivre, RenaudX <renaudx.de.chivre@intel.com>
Tested-by: Barthes, FabienX <fabienx.barthes@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
diff --git a/.gitignore b/.gitignore
index a3f55cc..b8a77d7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
*.win
-*.layout
\ No newline at end of file
+*.layout
+*.user
diff --git a/parameter/InstanceConfigurableElement.cpp b/parameter/InstanceConfigurableElement.cpp
index f35be87..6d6526e 100644
--- a/parameter/InstanceConfigurableElement.cpp
+++ b/parameter/InstanceConfigurableElement.cpp
@@ -68,10 +68,17 @@
// Begin
if (bHasMappingData) {
- if (!mapper.mapBegin(this, strError)) {
+ bool bKeepDiving;
+
+ if (!mapper.mapBegin(this, bKeepDiving, strError)) {
return false;
}
+ // Go on through children?
+ if (!bKeepDiving) {
+
+ return true;
+ }
}
// Map children
diff --git a/parameter/Mapper.h b/parameter/Mapper.h
index 4f32ca8..ab5f488 100644
--- a/parameter/Mapper.h
+++ b/parameter/Mapper.h
@@ -39,6 +39,6 @@
class IMapper
{
public:
- virtual bool mapBegin(CInstanceConfigurableElement* pInstanceConfigurableElement, string& strError) = 0;
+ virtual bool mapBegin(CInstanceConfigurableElement* pInstanceConfigurableElement, bool& bKeepDiving, string& strError) = 0;
virtual void mapEnd() = 0;
};
diff --git a/parameter/Subsystem.cpp b/parameter/Subsystem.cpp
index 7fb4bed..e17a80d 100644
--- a/parameter/Subsystem.cpp
+++ b/parameter/Subsystem.cpp
@@ -249,7 +249,7 @@
if (pInstanceConfigurableElement->getMappingData(strKey, pStrValue)) {
- // First check context consistensy (required ancestors must have been set prior to object creation)
+ // First check context consistency (required ancestors must have been set prior to object creation)
uint32_t uiAncestorKey;
uint32_t uiAncestorMask = pSubsystemObjectCreator->getAncestorMask();
@@ -271,7 +271,7 @@
// Then check configurable element size is correct
if (pInstanceConfigurableElement->getFootPrint() > pSubsystemObjectCreator->getMaxConfigurableElementSize()) {
- string strSizeError = "Size should not exceed " + pInstanceConfigurableElement->getFootprintAsString();
+ string strSizeError = "Size should not exceed " + pSubsystemObjectCreator->getMaxConfigurableElementSize();
getMappingError(strError, strKey, strSizeError, pInstanceConfigurableElement);
@@ -293,11 +293,11 @@
// Generic error handling from derived subsystem classes
void CSubsystem::getMappingError(string& strError, const string& strKey, const string& strMessage, const CInstanceConfigurableElement* pInstanceConfigurableElement)
{
- strError = getName() + " " + getKind() + " mapping:\n" + strKey + " error : \"" + strMessage + "\" for element " + pInstanceConfigurableElement->getPath();
+ strError = getName() + " " + getKind() + " mapping:\n" + strKey + " error: \"" + strMessage + "\" for element " + pInstanceConfigurableElement->getPath();
}
// From IMapper
-bool CSubsystem::mapBegin(CInstanceConfigurableElement* pInstanceConfigurableElement, string& strError)
+bool CSubsystem::mapBegin(CInstanceConfigurableElement* pInstanceConfigurableElement, bool& bKeepDiving, string& strError)
{
// Get current context
CMappingContext context = _contextStack.top();
@@ -310,27 +310,34 @@
return false;
}
- break;
+
+ // Push context
+ _contextStack.push(context);
+
+ // Keep diving
+ bKeepDiving = true;
+
+ return true;
+
case CInstanceConfigurableElement::EParameterBlock:
case CInstanceConfigurableElement::EBitParameterBlock:
case CInstanceConfigurableElement::EParameter:
case CInstanceConfigurableElement::EStringParameter:
- {
+
if (!handleSubsystemObjectCreation(pInstanceConfigurableElement, context, strError)) {
return false;
}
- break;
- }
+
+ // Done
+ bKeepDiving = false;
+
+ return true;
+
default:
assert(0);
return false;
}
-
- // Push context
- _contextStack.push(context);
-
- return true;
}
void CSubsystem::mapEnd()
diff --git a/parameter/Subsystem.h b/parameter/Subsystem.h
index f0ddc57..12f6ed0 100644
--- a/parameter/Subsystem.h
+++ b/parameter/Subsystem.h
@@ -84,7 +84,7 @@
void getMappingError(string& strError, const string& strKey, const string& strMessage, const CInstanceConfigurableElement* pInstanceConfigurableElement);
// From IMapper
- virtual bool mapBegin(CInstanceConfigurableElement* pInstanceConfigurableElement, string& strError);
+ virtual bool mapBegin(CInstanceConfigurableElement* pInstanceConfigurableElement, bool& bKeepDiving, string& strError);
virtual void mapEnd();
// Mapping generic context handling
diff --git a/xmlparser-test/Android.mk b/xmlparser-test/Android.mk
index ea1172d..ccb867d 100644
--- a/xmlparser-test/Android.mk
+++ b/xmlparser-test/Android.mk
@@ -18,7 +18,7 @@
LOCAL_C_INCLUDES += \
external/stlport/stlport/ \
external/libxml2/include/ \
- external/webkit/WebCore/icu/ \
+ external/webkit/Source/WebCore/icu/ \
bionic/libstdc++ \
bionic/
diff --git a/xmlserializer/Android.mk b/xmlserializer/Android.mk
index e45f1b1..7aa4e74 100644
--- a/xmlserializer/Android.mk
+++ b/xmlserializer/Android.mk
@@ -22,9 +22,8 @@
LOCAL_C_INCLUDES += \
external/stlport/stlport/ \
external/libxml2/include/ \
- external/webkit/WebCore/icu/ \
+ external/webkit/Source/WebCore/icu/ \
bionic/libstdc++ \
- external/icu4c/common \
bionic/
LOCAL_C_INCLUDES +=