summaryrefslogtreecommitdiffstats
path: root/parameter/ParameterMgr.cpp
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/ParameterMgr.cpp
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/ParameterMgr.cpp')
-rw-r--r--parameter/ParameterMgr.cpp22
1 files changed, 22 insertions, 0 deletions
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