Persistence the led group asserted value by default

Currently, only IBM's P10 machine will persist the Asserted attribute
value of ledGroup by default. But for other systems, most do not need
to perform persistence actions.

The intent behind this commit is to add a switch to control the
persistence function, and it is enabled by default in CI and disabled
by default in Yocto.

Tested: Regardless of whether `persistent-led-asserted` is enabled or
disabled, the ledmanager process works fine.

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I75b59a12dde417a9ccadaf25b2af07fc33186a01
diff --git a/manager/group.hpp b/manager/group.hpp
index aec0e85..e3717ca 100644
--- a/manager/group.hpp
+++ b/manager/group.hpp
@@ -35,22 +35,22 @@
 
     /** @brief Constructs LED Group
      *
-     * @param[in] bus       - Handle to system dbus
-     * @param[in] objPath   - The D-Bus path that hosts LED group
-     * @param[in] manager   - Reference to Manager
-     * @param[in] serialize - Serialize object
-     * @param[in] callBack  - Custom callback when LED group is asserted
+     * @param[in] bus           - Handle to system dbus
+     * @param[in] objPath       - The D-Bus path that hosts LED group
+     * @param[in] manager       - Reference to Manager
+     * @param[in] serializePtr  - Serialize object
+     * @param[in] callBack      - Custom callback when LED group is asserted
      */
     Group(sdbusplus::bus_t& bus, const std::string& objPath, Manager& manager,
-          Serialize& serialize,
+          std::shared_ptr<Serialize> serializePtr,
           std::function<void(Group*, bool)> callBack = nullptr) :
 
         GroupInherit(bus, objPath.c_str(), GroupInherit::action::defer_emit),
-        path(objPath), manager(manager), serialize(serialize),
+        path(objPath), manager(manager), serializePtr(serializePtr),
         customCallBack(callBack)
     {
         // Initialize Asserted property value
-        if (serialize.getGroupSavedState(objPath))
+        if (serializePtr && serializePtr->getGroupSavedState(objPath))
         {
             asserted(true);
         }
@@ -74,7 +74,7 @@
     Manager& manager;
 
     /** @brief The serialize class for storing and restoring groups of LEDs */
-    Serialize& serialize;
+    std::shared_ptr<Serialize> serializePtr;
 
     /** @brief Custom callback when LED group is asserted
      */