From ace81f873b910493ab884dc5a6a38ba6ec3d56d3 Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Tue, 11 Dec 2012 16:19:17 +0100 Subject: PFW: Do not stop on hard sync errors BZ: 76263 When synchronization fails, the parameter-framework should log a warning and continue synchronization instead of stopping Change-Id: Ic12d8798ea25584db714ee26e644fac793c28881 Signed-off-by: Kevin Rocard Reviewed-on: http://android.intel.com:8080/81825 Reviewed-by: Centelles, Sylvain Reviewed-by: Denneulin, Guillaume Tested-by: Dixon, CharlesX Reviewed-by: cactus Tested-by: cactus --- parameter/ConfigurableDomains.cpp | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'parameter/ConfigurableDomains.cpp') diff --git a/parameter/ConfigurableDomains.cpp b/parameter/ConfigurableDomains.cpp index 56693ef..a1bfb3c 100644 --- a/parameter/ConfigurableDomains.cpp +++ b/parameter/ConfigurableDomains.cpp @@ -22,6 +22,7 @@ * CREATED: 2011-06-01 * UPDATED: 2011-07-27 */ +#include #include "ConfigurableDomains.h" #include "ConfigurableDomain.h" #include "ConfigurableElement.h" @@ -60,8 +61,9 @@ void CConfigurableDomains::validate(const CParameterBlackboard* pMainBlackboard) } // Configuration application if required -bool CConfigurableDomains::apply(CParameterBlackboard* pParameterBlackboard, bool bForce, string& strError) const +void CConfigurableDomains::apply(CParameterBlackboard* pParameterBlackboard, bool bForce) const { + CAutoLog autoLog(this, "Applying configurations"); // Syncer set @@ -77,29 +79,24 @@ bool CConfigurableDomains::apply(CParameterBlackboard* pParameterBlackboard, boo const CConfigurableDomain* pChildConfigurableDomain = static_cast(getChild(uiChild)); - if (!pChildConfigurableDomain->getSequenceAwareness() && !pChildConfigurableDomain->apply(pParameterBlackboard, syncerSet, bForce, strError)) { - - return false; + if (!pChildConfigurableDomain->getSequenceAwareness()) { + // Apply sequence unaware domain + pChildConfigurableDomain->apply(pParameterBlackboard, syncerSet, bForce); } } - // Synchronize - if (!syncerSet.sync(*pParameterBlackboard, false, strError)) { - - return false; - } + // Synchronize sequence unaware domains + syncerSet.sync(*pParameterBlackboard, false, NULL); // Then deal with sequence aware domains for (uiChild = 0; uiChild < uiNbConfigurableDomains; uiChild++) { const CConfigurableDomain* pChildConfigurableDomain = static_cast(getChild(uiChild)); - if (pChildConfigurableDomain->getSequenceAwareness() && !pChildConfigurableDomain->apply(pParameterBlackboard, syncerSet, bForce, strError)) { - - return false; + if (pChildConfigurableDomain->getSequenceAwareness()) { + // Apply sequence aware domain + pChildConfigurableDomain->apply(pParameterBlackboard, syncerSet, bForce); } } - - return true; } // From IXmlSource @@ -123,7 +120,7 @@ bool CConfigurableDomains::createDomain(const string& strName, string& strError) return false; } - log("Creating configurable domain \"%s\"", strName.c_str()); + log_info("Creating configurable domain \"%s\"", strName.c_str()); // Creation/Hierarchy addChild(new CConfigurableDomain(strName)); @@ -140,7 +137,7 @@ bool CConfigurableDomains::deleteDomain(const string& strName, string& strError) return false; } - log("Deleting configurable domain \"%s\"", strName.c_str()); + log_info("Deleting configurable domain \"%s\"", strName.c_str()); // Hierarchy removeChild(pConfigurableDomain); @@ -153,7 +150,7 @@ bool CConfigurableDomains::deleteDomain(const string& strName, string& strError) void CConfigurableDomains::deleteAllDomains() { - log("Deleting all configurable domains"); + log_info("Deleting all configurable domains"); //remove Children clean(); @@ -168,7 +165,7 @@ bool CConfigurableDomains::renameDomain(const string& strName, const string& str return false; } - log("Renaming configurable domain \"%s\" to \"%s\"", strName.c_str(), strNewName.c_str()); + log_info("Renaming configurable domain \"%s\" to \"%s\"", strName.c_str(), strNewName.c_str()); // Rename return pConfigurableDomain->rename(strNewName, strError); @@ -377,17 +374,19 @@ void CConfigurableDomains::gatherAllOwnedConfigurableElements(set& lstrError) const { + string strError; // Find domain const CConfigurableDomain* pConfigurableDomain = findConfigurableDomain(strDomain, strError); if (!pConfigurableDomain) { + lstrError.push_back(strError); return false; } // Delegate - return pConfigurableDomain->restoreConfiguration(strConfiguration, pMainBlackboard, bAutoSync, strError); + return pConfigurableDomain->restoreConfiguration(strConfiguration, pMainBlackboard, bAutoSync, lstrError); } // Config save -- cgit v1.1