Remove gBn/sConstructorMap from headers.

Prebuilts that include toBinder() should no longer
link to gBnConstructorMap after rebuild.

After prebuilts are updated, symbols (in Static.cpp and
HidlPassthroughSupport.cpp) can be removed as well.

Test: walleye boots
Test: HAL def libs that link to libhidltransport no longer
      links to gBnConstructorMap / gBsConstructorMap.

Bug: 69122224
Change-Id: I6554a98a3068f9595666b7131df310e200551e45
diff --git a/transport/HidlPassthroughSupport.cpp b/transport/HidlPassthroughSupport.cpp
index e5eb164..c5ca1c9 100644
--- a/transport/HidlPassthroughSupport.cpp
+++ b/transport/HidlPassthroughSupport.cpp
@@ -25,6 +25,9 @@
 namespace hardware {
 namespace details {
 
+// TODO(b/69122224) remove once prebuilts are updated.
+extern BsConstructorMap gBsConstructorMap;
+
 static sp<IBase> tryWrap(const std::string& descriptor, sp<IBase> iface) {
     auto func = getBsConstructorMap().get(descriptor, nullptr);
     if (!func) {
diff --git a/transport/Static.cpp b/transport/Static.cpp
index cbe6add..40e0c59 100644
--- a/transport/Static.cpp
+++ b/transport/Static.cpp
@@ -30,6 +30,7 @@
 sp<android::hidl::manager::V1_0::IServiceManager> gDefaultServiceManager;
 
 // Deprecated; kept for ABI compatibility. Use getBnConstructorMap.
+// TODO(b/69122224) remove once prebuilts are updated.
 BnConstructorMap gBnConstructorMap{};
 
 ConcurrentMap<const ::android::hidl::base::V1_0::IBase*, wp<::android::hardware::BHwBinder>>
@@ -38,6 +39,7 @@
 ConcurrentMap<wp<::android::hidl::base::V1_0::IBase>, SchedPrio> gServicePrioMap{};
 
 // Deprecated; kept for ABI compatibility. Use getBsConstructorMap.
+// TODO(b/69122224) remove once prebuilts are updated.
 BsConstructorMap gBsConstructorMap{};
 
 // For static executables, it is not guaranteed that gBnConstructorMap are initialized before
diff --git a/transport/include/hidl/HidlBinderSupport.h b/transport/include/hidl/HidlBinderSupport.h
index 9759af1..55003cc 100644
--- a/transport/include/hidl/HidlBinderSupport.h
+++ b/transport/include/hidl/HidlBinderSupport.h
@@ -332,10 +332,7 @@
         if (sBnObj == nullptr) {
             auto func = details::getBnConstructorMap().get(myDescriptor, nullptr);
             if (!func) {
-                func = details::gBnConstructorMap.get(myDescriptor, nullptr);
-                if (!func) {
-                    return nullptr;
-                }
+                return nullptr;
             }
 
             sBnObj = sp<IBinder>(func(static_cast<void*>(ifacePtr)));
diff --git a/transport/include/hidl/Static.h b/transport/include/hidl/Static.h
index 0522e44..9d9a14a 100644
--- a/transport/include/hidl/Static.h
+++ b/transport/include/hidl/Static.h
@@ -44,8 +44,6 @@
 // For HidlBinderSupport and autogenerated code
 // value function receives reinterpret_cast<void *>(static_cast<IFoo *>(foo)),
 // returns sp<IBinder>
-// deprecated; use getBnConstructorMap instead.
-extern BnConstructorMap gBnConstructorMap;
 BnConstructorMap& getBnConstructorMap();
 
 using BsConstructorMap = ConcurrentMap<std::string,
@@ -53,8 +51,6 @@
 // For HidlPassthroughSupport and autogenerated code
 // value function receives reinterpret_cast<void *>(static_cast<IFoo *>(foo)),
 // returns sp<IBase>
-// deprecated; use getBsConstructorMap instead.
-extern BsConstructorMap gBsConstructorMap;
 BsConstructorMap& getBsConstructorMap();
 }  // namespace details
 }  // namespace hardware