registerReferences registers absolute subclass

There was a problem where when a passthrough
service was loaded, it only registered the class that
was requested instead of the actual class to
hwservicemanager (and therefore lshal for debugDumps).

Change-Id: I127653f99b3813bac5ad0e832a165cfc469ee17f
Fixes: 74407622
Test: lshal
diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp
index dd6736f..edd2af3 100644
--- a/transport/ServiceManagement.cpp
+++ b/transport/ServiceManagement.cpp
@@ -30,6 +30,7 @@
 
 #include <hidl/HidlBinderSupport.h>
 #include <hidl/HidlInternal.h>
+#include <hidl/HidlTransportUtils.h>
 #include <hidl/ServiceManagement.h>
 #include <hidl/Status.h>
 
@@ -357,7 +358,12 @@
                 return true; // this module doesn't provide this instance name
             }
 
-            registerReference(fqName, name);
+            // Actual fqname might be a subclass.
+            // This assumption is tested in vts_treble_vintf_test
+            using ::android::hardware::details::getDescriptor;
+            std::string actualFqName = getDescriptor(ret.get());
+            CHECK(actualFqName.size() > 0);
+            registerReference(actualFqName, name);
             return false;
         });