Add the restoreLedsAssert method for LED manager

- Logically, Since the physical LEDs states should not be operated
  during the lamp test, all the physical LEDs states before and
  during the lamp test should be saved and restored after the lamp
  test.

Tested:
- Store the state of all the physical LEDs before the lamp test,
  and keep the state of all the physical LEDs consistent after
  the lamp test.

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I8b321bae2e38001ea33a80bda8badcf4c8a55040
diff --git a/manager.cpp b/manager.cpp
index c3c142f..6219091 100644
--- a/manager.cpp
+++ b/manager.cpp
@@ -1,3 +1,5 @@
+#include "config.h"
+
 #include "manager.hpp"
 
 #include <phosphor-logging/log.hpp>
@@ -100,9 +102,25 @@
     return assert;
 }
 
+void Manager::setLampTestCallBack(
+    std::function<bool(group& ledsAssert, group& ledsDeAssert)> callBack)
+{
+    lampTestCallBack = callBack;
+}
+
 /** @brief Run through the map and apply action on the LEDs */
 void Manager::driveLEDs(group& ledsAssert, group& ledsDeAssert)
 {
+#ifdef USE_LAMP_TEST
+    // Use the lampTestCallBack method and trigger the callback method in the
+    // lamp test(processLEDUpdates), in this way, all lamp test operations
+    // are performed in the lamp test class.
+    if (lampTestCallBack(ledsAssert, ledsDeAssert))
+    {
+        return;
+    }
+#endif
+
     // This order of LED operation is important.
     if (ledsDeAssert.size())
     {