Use unit name to distinguish USB code update service

In incoming patch, the object path of services will be encoded by
sdbusplus, using object path to distinguish the dummy USB code update
service is no longer suitable. This patch uses the unit name instead.

Tested:
Verified modifying the property of USB code update service will use
these special handlers as before. Other services are not affected.

Change-Id: I9d14ae57ca3f5a68744011e18e3ae45905edcacf
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
diff --git a/src/srvcfg_manager.cpp b/src/srvcfg_manager.cpp
index dab6316..cbe1afc 100644
--- a/src/srvcfg_manager.cpp
+++ b/src/srvcfg_manager.cpp
@@ -53,8 +53,6 @@
     "/var/lib/srvcfg_manager/usb-code-update-state";
 static constexpr const char* emptyUsbCodeUpdateRulesFile =
     "/etc/udev/rules.d/70-bmc-usb.rules";
-static constexpr const char* usbCodeUpdateObjectPath =
-    "/xyz/openbmc_project/control/service/phosphor_2dusb_2dcode_2dupdate";
 
 using UsbCodeUpdateStateMap = std::unordered_map<std::string, bool>;
 
@@ -217,7 +215,7 @@
     }
 
 #ifdef USB_CODE_UPDATE
-    if (objPath == usbCodeUpdateObjectPath)
+    if (baseUnitName == usbCodeUpdateUnitName)
     {
         getUSBCodeUpdateStateFromFile();
     }
@@ -566,7 +564,7 @@
             if (!internalSet)
             {
 #ifdef USB_CODE_UPDATE
-                if (objPath == usbCodeUpdateObjectPath)
+                if (baseUnitName == usbCodeUpdateUnitName)
                 {
                     unitMaskedState = req;
                     unitEnabledState = !unitMaskedState;
@@ -616,7 +614,7 @@
             if (!internalSet)
             {
 #ifdef USB_CODE_UPDATE
-                if (objPath == usbCodeUpdateObjectPath)
+                if (baseUnitName == usbCodeUpdateUnitName)
                 {
                     if (unitMaskedState)
                     { // block updating if masked
@@ -666,7 +664,7 @@
             if (!internalSet)
             {
 #ifdef USB_CODE_UPDATE
-                if (objPath == usbCodeUpdateObjectPath)
+                if (baseUnitName == usbCodeUpdateUnitName)
                 {
                     if (unitMaskedState)
                     { // block updating if masked