Added support for Enabled property

Enabled property is added so that user can select via dbus interface if
Readings are updated and signal on Readings update is emitted, moreover
Metric calculation on received sensor data is active only when Enabled
is set to true

Tested:
- New unit tests were created, ran all new and previous UTs, all passed
- Tested under QEMU by adding reports for single and multiple sensors,
  changing Enabled property and emitting signal of value change for
  sensors added into the report, checking if Readings is accordingly
  updated or not updated
- Verified persistency, if Enabled property is successfully stored and
  restored after Telemetry service restart and also checked if after the
  restart dependencies of Enabled (Readings, Metric calculation) are
  properly initiated

Signed-off-by: Lukasz Kazmierczak <lukasz.kazmierczak@intel.com>
Change-Id: I29cf13693a48d15cb16d2ad6707f483f67f4879b
diff --git a/src/report_manager.cpp b/src/report_manager.cpp
index e40d9a4..c8103a6 100644
--- a/src/report_manager.cpp
+++ b/src/report_manager.cpp
@@ -56,12 +56,14 @@
                                     const bool logToMetricReportsCollection,
                                     const uint64_t interval,
                                     ReadingParametersPastVersion metricParams) {
+                    constexpr auto enabledDefault = true;
                     return addReport(yield, reportName, reportingType,
                                      emitsReadingsUpdate,
                                      logToMetricReportsCollection,
                                      Milliseconds(interval),
                                      convertToReadingParameters(
-                                         std::move(metricParams)))
+                                         std::move(metricParams)),
+                                     enabledDefault)
                         .getPath();
                 });
 
@@ -74,11 +76,12 @@
                        const bool logToMetricReportsCollection,
                        const uint64_t interval,
                        ReadingParameters metricParams) {
+                    constexpr auto enabledDefault = true;
                     return addReport(yield, reportName, reportingType,
                                      emitsReadingsUpdate,
                                      logToMetricReportsCollection,
                                      Milliseconds(interval),
-                                     std::move(metricParams))
+                                     std::move(metricParams), enabledDefault)
                         .getPath();
                 });
         });
@@ -169,28 +172,29 @@
     boost::asio::yield_context& yield, const std::string& reportName,
     const std::string& reportingType, const bool emitsReadingsUpdate,
     const bool logToMetricReportsCollection, Milliseconds interval,
-    ReadingParameters metricParams)
+    ReadingParameters metricParams, const bool enabled)
 {
     auto labeledMetricParams =
         reportFactory->convertMetricParams(yield, metricParams);
 
     return addReport(reportName, reportingType, emitsReadingsUpdate,
                      logToMetricReportsCollection, interval,
-                     std::move(labeledMetricParams));
+                     std::move(labeledMetricParams), enabled);
 }
 
 interfaces::Report& ReportManager::addReport(
     const std::string& reportName, const std::string& reportingType,
     const bool emitsReadingsUpdate, const bool logToMetricReportsCollection,
     Milliseconds interval,
-    std::vector<LabeledMetricParameters> labeledMetricParams)
+    std::vector<LabeledMetricParameters> labeledMetricParams,
+    const bool enabled)
 {
     verifyAddReport(reportName, reportingType, interval, labeledMetricParams);
 
     reports.emplace_back(
         reportFactory->make(reportName, reportingType, emitsReadingsUpdate,
                             logToMetricReportsCollection, interval, *this,
-                            *reportStorage, labeledMetricParams));
+                            *reportStorage, labeledMetricParams, enabled));
     return *reports.back();
 }
 
@@ -204,6 +208,7 @@
         std::optional<nlohmann::json> data = reportStorage->load(path);
         try
         {
+            bool enabled = data->at("Enabled").get<bool>();
             size_t version = data->at("Version").get<size_t>();
             if (version != Report::reportVersion)
             {
@@ -223,7 +228,7 @@
 
             addReport(name, reportingType, emitsReadingsSignal,
                       logToMetricReportsCollection, Milliseconds(interval),
-                      std::move(readingParameters));
+                      std::move(readingParameters), enabled);
         }
         catch (const std::exception& e)
         {