diff options
author | Guillaume Denneulin <guillaume.denneulin@intel.com> | 2012-12-20 17:53:29 +0100 |
---|---|---|
committer | David Wagner <david.wagner@intel.com> | 2014-02-12 17:03:31 +0100 |
commit | f2fd15a331fd3b5b63f0dc6f492651330adcedf9 (patch) | |
tree | 4176f855bf77467ed7d1519490bdce022bd1ea4d /parameter/ConfigurableDomain.cpp | |
parent | ace81f873b910493ab884dc5a6a38ba6ec3d56d3 (diff) | |
download | external_parameter-framework-f2fd15a331fd3b5b63f0dc6f492651330adcedf9.zip external_parameter-framework-f2fd15a331fd3b5b63f0dc6f492651330adcedf9.tar.gz external_parameter-framework-f2fd15a331fd3b5b63f0dc6f492651330adcedf9.tar.bz2 |
PFW: Add resync mechanism if a subsystem needs resync
BZ: 76267
In the case of a hw subsystems reset, it's possible that its
parameter managed by the PFW may not be aligned with the PFW
blackboard.
A re-synchronization mechanism is implemented to ensure that the
subsystem is re-synchronized on the next configurations application.
Change-Id: I032150955d25a7020cf494e69456897b4c157916
Signed-off-by: Guillaume Denneulin <guillaume.denneulin@intel.com>
Reviewed-on: http://android.intel.com:8080/83015
Reviewed-by: Rocard, KevinX <kevinx.rocard@intel.com>
Reviewed-by: Centelles, Sylvain <sylvain.centelles@intel.com>
Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Tested-by: cactus <cactus@intel.com>
Diffstat (limited to 'parameter/ConfigurableDomain.cpp')
-rw-r--r-- | parameter/ConfigurableDomain.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/parameter/ConfigurableDomain.cpp b/parameter/ConfigurableDomain.cpp index 7d713a1..6d1c19c 100644 --- a/parameter/ConfigurableDomain.cpp +++ b/parameter/ConfigurableDomain.cpp @@ -438,8 +438,15 @@ const CDomainConfiguration* CConfigurableDomain::getPendingConfiguration() const } // Configuration application if required -void CConfigurableDomain::apply(CParameterBlackboard* pParameterBlackboard, CSyncerSet& syncerSet, bool bForce) const +void CConfigurableDomain::apply(CParameterBlackboard* pParameterBlackboard, CSyncerSet* pSyncerSet, bool bForce) const { + // Apply configuration only if the blackboard will + // be synchronized either now or by syncerSet. + if(!pSyncerSet ^ _bSequenceAware) { + // The configuration can not be syncronised + return; + } + if (bForce) { // Force a configuration restore by forgetting about last applied configuration _pLastAppliedConfiguration = NULL; @@ -451,19 +458,24 @@ void CConfigurableDomain::apply(CParameterBlackboard* pParameterBlackboard, CSyn // Check not the last one before applying if (!_pLastAppliedConfiguration || _pLastAppliedConfiguration != pApplicableDomainConfiguration) { - log_info("Applying configuration \"%s\" from domain \"%s\"", pApplicableDomainConfiguration->getName().c_str(), getName().c_str()); + log_info("Applying configuration \"%s\" from domain \"%s\"", + pApplicableDomainConfiguration->getName().c_str(), + getName().c_str()); + + // Check if we need to synchronize during restore + bool bSync = !pSyncerSet && _bSequenceAware; // Do the restore - pApplicableDomainConfiguration->restore(pParameterBlackboard, _bSequenceAware, NULL); + pApplicableDomainConfiguration->restore(pParameterBlackboard, bSync, NULL); // Record last applied configuration _pLastAppliedConfiguration = pApplicableDomainConfiguration; - // Check we did not already sync the changes - if (!_bSequenceAware) { + // Check we need to provide syncer set to caller + if (pSyncerSet && !_bSequenceAware) { // Since we applied changes, add our own sync set to the given one - syncerSet += _syncerSet; + *pSyncerSet += _syncerSet; } } } |