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/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()