PEL.Entry update hidden property setting

The condition to set hidden flag depends on the severity type and the
action flag setting. This change is to make sure that the hidden
property is set using various conditions and not just hidden action flag.

Tested:
using busctl injected different types of errors and made sure that the
hidden property is set accordingly.

Signed-off-by: Vijay Lobo <vijaylobo@gmail.com>
Change-Id: I91ad232e50b0201f5d58e0f145a013b8994c3a9b
diff --git a/extensions/openpower-pels/manager.cpp b/extensions/openpower-pels/manager.cpp
index df8e50c..facaabb 100644
--- a/extensions/openpower-pels/manager.cpp
+++ b/extensions/openpower-pels/manager.cpp
@@ -804,8 +804,19 @@
     {
         namespace pv = openpower::pels::pel_values;
         auto& attr = attributes.value().get();
-        varData.emplace(std::string("Hidden"),
-                        attr.actionFlags.test(hiddenFlagBit));
+
+        // get the hidden flag values
+        auto sevType = static_cast<SeverityType>(attr.severity & 0xF0);
+        auto isHidden = true;
+        if (((sevType != SeverityType::nonError) &&
+             attr.actionFlags.test(reportFlagBit) &&
+             !attr.actionFlags.test(hiddenFlagBit)) ||
+            ((sevType == SeverityType::nonError) &&
+             attr.actionFlags.test(serviceActionFlagBit)))
+        {
+            isHidden = false;
+        }
+        varData.emplace(std::string("Hidden"), isHidden);
         varData.emplace(
             std::string("Subsystem"),
             pv::getValue(attr.subsystem, pel_values::subsystemValues));