aboutsummaryrefslogtreecommitdiffstats
path: root/parameter/SelectionCriterion.cpp
diff options
context:
space:
mode:
authorFrédéric Boisnard <fredericx.boisnard@intel.com>2012-08-27 15:48:15 +0200
committerDavid Wagner <david.wagner@intel.com>2014-02-12 17:03:14 +0100
commitdaaa63ce33fa4795403f9339bc872694c9ab6113 (patch)
treeb34506f80e67f4b2396dd89be365f687d2c18926 /parameter/SelectionCriterion.cpp
parent951ecce4fbf195694b14ef8504c59732354abcdb (diff)
downloadexternal_parameter-framework-daaa63ce33fa4795403f9339bc872694c9ab6113.zip
external_parameter-framework-daaa63ce33fa4795403f9339bc872694c9ab6113.tar.gz
external_parameter-framework-daaa63ce33fa4795403f9339bc872694c9ab6113.tar.bz2
PFW: Display warning messages to help user
BZ: 54512 Display a warning message when a configuration cannot be applied because the TuningMode is on, in order to help user to identify potential issues. Display a warning message when a criterion change doesn't lead to a configuration application (a check is performed each time a criterion is changed). Change-Id: Id872655c92770d1f6f1b01b20db2fde3db826ceb Signed-off-by: Frédéric Boisnard <fredericx.boisnard@intel.com> Reviewed-on: http://android.intel.com:8080/63845 Reviewed-by: Rocard, KevinX <kevinx.rocard@intel.com> Reviewed-by: De Chivre, Renaud <renaud.de.chivre@intel.com> Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@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/SelectionCriterion.cpp')
-rw-r--r--parameter/SelectionCriterion.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/parameter/SelectionCriterion.cpp b/parameter/SelectionCriterion.cpp
index 7f2809a..453f244 100644
--- a/parameter/SelectionCriterion.cpp
+++ b/parameter/SelectionCriterion.cpp
@@ -27,7 +27,7 @@
#define base CElement
-CSelectionCriterion::CSelectionCriterion(const string& strName, const CSelectionCriterionType* pType) : base(strName), _iState(0), _pType(pType)
+CSelectionCriterion::CSelectionCriterion(const string& strName, const CSelectionCriterionType* pType) : base(strName), _iState(0), _pType(pType), _uiNbModifications(0)
{
}
@@ -36,6 +36,16 @@ string CSelectionCriterion::getKind() const
return "SelectionCriterion";
}
+bool CSelectionCriterion::hasBeenModified() const
+{
+ return _uiNbModifications != 0;
+}
+
+void CSelectionCriterion::resetModifiedStatus()
+{
+ _uiNbModifications = 0;
+}
+
/// From ISelectionCriterionInterface
// State
void CSelectionCriterion::setCriterionState(int iState)
@@ -46,6 +56,16 @@ void CSelectionCriterion::setCriterionState(int iState)
_iState = iState;
log("Selection criterion changed event: %s", getFormattedDescription(false).c_str());
+
+ // Check if the previous criterion value has been taken into account (i.e. at least one Configuration was applied
+ // since the last criterion change)
+ if (_uiNbModifications > 0) {
+
+ log("Warning: Selection criterion \"%s\" has been modified %d time(s) without any configuration application", getName().c_str(), _uiNbModifications);
+ }
+
+ // Track the number of modifications for this criterion
+ _uiNbModifications++;
}
}