aboutsummaryrefslogtreecommitdiffstats
path: root/parameter
diff options
context:
space:
mode:
authorFrédéric Boisnard <fredericx.boisnard@intel.com>2012-09-06 18:03:20 +0200
committerDavid Wagner <david.wagner@intel.com>2014-02-12 17:03:14 +0100
commit8b243f50a38a26e6b373287e07cb7e4743a8cd28 (patch)
tree01a0ac75b9ef0a1e41c027febf91f63c4c3000d9 /parameter
parentdaaa63ce33fa4795403f9339bc872694c9ab6113 (diff)
downloadexternal_parameter-framework-8b243f50a38a26e6b373287e07cb7e4743a8cd28.zip
external_parameter-framework-8b243f50a38a26e6b373287e07cb7e4743a8cd28.tar.gz
external_parameter-framework-8b243f50a38a26e6b373287e07cb7e4743a8cd28.tar.bz2
PFW: Show pending configurations in status command
BZ: 56118 Update the "status" command of the PFW to display the current pending configurations for all domains, that is to say configurations that are waiting the next call to "applyConfiguration()" to be applied. This improvement will help developers to better understand the current state of the PFW, in particular when dealing with HAL modifications. Change-Id: I6300620ad8cedcb534fb2859b57b7ab2988fa618 Signed-off-by: Frédéric Boisnard <fredericx.boisnard@intel.com> Reviewed-on: http://android.intel.com:8080/64796 Reviewed-by: De Chivre, Renaud <renaud.de.chivre@intel.com> Reviewed-by: Benavoli, Patrick <patrick.benavoli@intel.com> Reviewed-by: Rocard, KevinX <kevinx.rocard@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')
-rw-r--r--parameter/ConfigurableDomain.cpp29
-rw-r--r--parameter/ConfigurableDomain.h15
-rw-r--r--parameter/ConfigurableDomains.cpp2
-rw-r--r--parameter/ParameterMgr.cpp4
4 files changed, 44 insertions, 6 deletions
diff --git a/parameter/ConfigurableDomain.cpp b/parameter/ConfigurableDomain.cpp
index 01e4a69..8c83f48 100644
--- a/parameter/ConfigurableDomain.cpp
+++ b/parameter/ConfigurableDomain.cpp
@@ -420,6 +420,23 @@ bool CConfigurableDomain::split(CConfigurableElement* pConfigurableElement, stri
return true;
}
+// Check if there is a pending configuration for this domain: i.e. an applicable configuration different from the last applied configuration
+const CDomainConfiguration* CConfigurableDomain::getPendingConfiguration() const
+{
+ const CDomainConfiguration* pApplicableDomainConfiguration = findApplicableDomainConfiguration();
+
+ if (pApplicableDomainConfiguration) {
+
+ // Check not the last one before applying
+ if (!_pLastAppliedConfiguration || (_pLastAppliedConfiguration != pApplicableDomainConfiguration)) {
+
+ return pApplicableDomainConfiguration;
+ }
+ }
+
+ return NULL;
+}
+
// Configuration application if required
bool CConfigurableDomain::apply(CParameterBlackboard* pParameterBlackboard, CSyncerSet& syncerSet, bool bForce, string& strError) const
{
@@ -707,6 +724,18 @@ string CConfigurableDomain::getLastAppliedConfigurationName() const
return "<none>";
}
+// Pending configuration
+string CConfigurableDomain::getPendingConfigurationName() const
+{
+ const CDomainConfiguration* pPendingConfiguration = getPendingConfiguration();
+
+ if (pPendingConfiguration) {
+
+ return pPendingConfiguration->getName();
+ }
+ return "<none>";
+}
+
// Ensure validity on whole domain from main blackboard
void CConfigurableDomain::validate(const CParameterBlackboard* pMainBlackboard)
{
diff --git a/parameter/ConfigurableDomain.h b/parameter/ConfigurableDomain.h
index ff194c2..29e92cb 100644
--- a/parameter/ConfigurableDomain.h
+++ b/parameter/ConfigurableDomain.h
@@ -59,9 +59,12 @@ public:
bool clearApplicationRule(const string& strConfiguration, string& strError);
bool getApplicationRule(const string& strConfiguration, string& strResult) const;
- // Last applied configuration
+ // Last applied configuration name
string getLastAppliedConfigurationName() const;
+ // Pending configuration name
+ string getPendingConfigurationName() const;
+
// Associated Configurable elements
void gatherConfigurableElements(set<const CConfigurableElement*>& configurableElementSet) const;
void listAssociatedToElements(string& strResult) const;
@@ -90,10 +93,18 @@ public:
// Class kind
virtual string getKind() const;
+
protected:
// Content dumping
virtual void logValue(string& strValue, CErrorContext& errorContext) const;
+
private:
+ // Get pending configuration
+ const CDomainConfiguration* getPendingConfiguration() const;
+
+ // Search for an applicable configuration
+ const CDomainConfiguration* findApplicableDomainConfiguration() const;
+
// Returns true if children dynamic creation is to be dealt with (here, will allow child deletion upon clean)
virtual bool childrenAreDynamic() const;
@@ -112,8 +123,6 @@ private:
// Search for a valid configuration for given configurable element
const CDomainConfiguration* findValidDomainConfiguration(const CConfigurableElement* pConfigurableElement) const;
- // Search for an applicable configuration
- const CDomainConfiguration* findApplicableDomainConfiguration() const;
// In case configurable element was removed
void computeSyncSet();
diff --git a/parameter/ConfigurableDomains.cpp b/parameter/ConfigurableDomains.cpp
index 79bfdac..56693ef 100644
--- a/parameter/ConfigurableDomains.cpp
+++ b/parameter/ConfigurableDomains.cpp
@@ -481,7 +481,7 @@ void CConfigurableDomains::listLastAppliedConfigurations(string& strResult) cons
const CConfigurableDomain* pChildConfigurableDomain = static_cast<const CConfigurableDomain*>(getChild(uiChild));
- strResult += pChildConfigurableDomain->getName() + ": " + pChildConfigurableDomain->getLastAppliedConfigurationName() + "\n";
+ strResult += pChildConfigurableDomain->getName() + ": " + pChildConfigurableDomain->getLastAppliedConfigurationName() + " [" + pChildConfigurableDomain->getPendingConfigurationName() + "]\n";
}
}
diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp
index 14a5b4b..cff2b47 100644
--- a/parameter/ParameterMgr.cpp
+++ b/parameter/ParameterMgr.cpp
@@ -678,13 +678,13 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::statusCommandProces
strResult += strSubsystemList;
/// Last applied configurations
- appendTitle(strResult, "Last applied configurations:");
+ appendTitle(strResult, "Last Applied [Pending] Configurations:");
string strLastAppliedConfigurations;
getConfigurableDomains()->listLastAppliedConfigurations(strLastAppliedConfigurations);
strResult += strLastAppliedConfigurations;
/// Criteria states
- appendTitle(strResult, "Selection criteria:");
+ appendTitle(strResult, "Selection Criteria:");
string strSelectionCriteria;
getSelectionCriteria()->listSelectionCriteria(strSelectionCriteria, false);
strResult += strSelectionCriteria;