aboutsummaryrefslogtreecommitdiffstats
path: root/parameter
diff options
context:
space:
mode:
authorKevin Rocard <kevinx.rocard@intel.com>2012-06-18 13:56:05 +0200
committerDavid Wagner <david.wagner@intel.com>2014-02-12 17:03:10 +0100
commit170f0a44b8309a954cd4802e85ac3dd6944a35fa (patch)
tree3b24f1b914424c623a8dc318863e23c41376d8e6 /parameter
parenta2a91058deb15b21baed892e2e27cb2d49e824ed (diff)
downloadexternal_parameter-framework-170f0a44b8309a954cd4802e85ac3dd6944a35fa.zip
external_parameter-framework-170f0a44b8309a954cd4802e85ac3dd6944a35fa.tar.gz
external_parameter-framework-170f0a44b8309a954cd4802e85ac3dd6944a35fa.tar.bz2
PFW: Add a command to delete all domains
BZ: 42432 This command is useful to reset all PFW settings. Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Change-Id: I23b74c45205739aeca71278979699b6b88f3111e Reviewed-on: http://android.intel.com:8080/53332 Reviewed-by: De Chivre, Renaud <renaud.de.chivre@intel.com> Tested-by: Mendi, EduardoX <eduardox.mendi@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'parameter')
-rw-r--r--parameter/ConfigurableDomains.cpp8
-rw-r--r--parameter/ConfigurableDomains.h1
-rw-r--r--parameter/ParameterMgr.cpp22
-rw-r--r--parameter/ParameterMgr.h2
4 files changed, 33 insertions, 0 deletions
diff --git a/parameter/ConfigurableDomains.cpp b/parameter/ConfigurableDomains.cpp
index 28611d3..706767b 100644
--- a/parameter/ConfigurableDomains.cpp
+++ b/parameter/ConfigurableDomains.cpp
@@ -157,6 +157,14 @@ bool CConfigurableDomains::deleteDomain(const string& strName, string& strError)
return true;
}
+void CConfigurableDomains::deleteAllDomains()
+{
+ log("Deleting all configurable domains");
+
+ //remove Children
+ clean();
+}
+
bool CConfigurableDomains::renameDomain(const string& strName, const string& strNewName, string& strError)
{
CConfigurableDomain* pConfigurableDomain = findConfigurableDomain(strName, strError);
diff --git a/parameter/ConfigurableDomains.h b/parameter/ConfigurableDomains.h
index 262d900..bafcbfb 100644
--- a/parameter/ConfigurableDomains.h
+++ b/parameter/ConfigurableDomains.h
@@ -48,6 +48,7 @@ public:
/// Domains
bool createDomain(const string& strName, string& strError);
bool deleteDomain(const string& strName, string& strError);
+ void deleteAllDomains();
bool renameDomain(const string& strName, const string& strNewName, string& strError);
bool setSequenceAwareness(const string& strDomain, bool bSequenceAware, string& strError);
bool getSequenceAwareness(const string& strDomain, bool& bSequenceAware, string& strError) const;
diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp
index dc38f95..c1538df 100644
--- a/parameter/ParameterMgr.cpp
+++ b/parameter/ParameterMgr.cpp
@@ -132,6 +132,7 @@ const CParameterMgr::SRemoteCommandParserItem CParameterMgr::gastRemoteCommandPa
{ "dumpDomains", &CParameterMgr::dumpDomainsCommmandProcess, 0, "", "Show all domains and configurations, including applicability conditions" },
{ "createDomain", &CParameterMgr::createDomainCommmandProcess, 1, "<domain>", "Create new configurable domain" },
{ "deleteDomain", &CParameterMgr::deleteDomainCommmandProcess, 1, "<domain>", "Delete configurable domain" },
+ { "deleteAllDomains", &CParameterMgr::deleteAllDomainsCommmandProcess, 0, "", "Delete all configurable domains" },
{ "renameDomain", &CParameterMgr::renameDomainCommmandProcess, 2, "<domain> <new name>", "Rename configurable domain" },
{ "setSequenceAwareness", &CParameterMgr::setSequenceAwarenessCommmandProcess, 1, "<domain> true|false*", "Set configurable domain sequence awareness" },
{ "getSequenceAwareness", &CParameterMgr::getSequenceAwarenessCommmandProcess, 1, "<domain>", "Get configurable domain sequence awareness" },
@@ -872,6 +873,13 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::deleteDomainCommman
return deleteDomain(remoteCommand.getArgument(0), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
}
+CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::deleteAllDomainsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
+{
+ (void)remoteCommand;
+
+ return deleteAllDomains(strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
+}
+
CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::renameDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult)
{
return getConfigurableDomains()->renameDomain(remoteCommand.getArgument(0), remoteCommand.getArgument(1), strResult) ? CCommandHandler::EDone : CCommandHandler::EFailed;
@@ -1447,6 +1455,20 @@ bool CParameterMgr::deleteDomain(const string& strName, string& strError)
return getConfigurableDomains()->deleteDomain(strName, strError);
}
+bool CParameterMgr::deleteAllDomains(string& strError)
+{
+ // Check tuning mode
+ if (!checkTuningModeOn(strError)) {
+
+ return false;
+ }
+
+ // Delegate to configurable domains
+ getConfigurableDomains()->deleteAllDomains();
+
+ return true;
+}
+
bool CParameterMgr::createConfiguration(const string& strDomain, const string& strConfiguration, string& strError)
{
// Check tuning mode
diff --git a/parameter/ParameterMgr.h b/parameter/ParameterMgr.h
index 1a5ebf2..a694bf4 100644
--- a/parameter/ParameterMgr.h
+++ b/parameter/ParameterMgr.h
@@ -144,6 +144,7 @@ public:
// Creation/Deletion
bool createDomain(const string& strName, string& strError);
bool deleteDomain(const string& strName, string& strError);
+ bool deleteAllDomains(string& strError);
bool createConfiguration(const string& strDomain, const string& strConfiguration, string& strError);
bool deleteConfiguration(const string& strDomain, const string& strConfiguration, string& strError);
@@ -202,6 +203,7 @@ private:
CCommandHandler::CommandStatus listDomainsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
CCommandHandler::CommandStatus createDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
CCommandHandler::CommandStatus deleteDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
+ CCommandHandler::CommandStatus deleteAllDomainsCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
CCommandHandler::CommandStatus renameDomainCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
CCommandHandler::CommandStatus setSequenceAwarenessCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);
CCommandHandler::CommandStatus getSequenceAwarenessCommmandProcess(const IRemoteCommand& remoteCommand, string& strResult);