Merge "Revert "Remove gBn/sConstructorMap from headers.""
diff --git a/transport/HidlPassthroughSupport.cpp b/transport/HidlPassthroughSupport.cpp
index c5ca1c9..e5eb164 100644
--- a/transport/HidlPassthroughSupport.cpp
+++ b/transport/HidlPassthroughSupport.cpp
@@ -25,9 +25,6 @@
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 40e0c59..cbe6add 100644
--- a/transport/Static.cpp
+++ b/transport/Static.cpp
@@ -30,7 +30,6 @@
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>>
@@ -39,7 +38,6 @@
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 55003cc..9759af1 100644
--- a/transport/include/hidl/HidlBinderSupport.h
+++ b/transport/include/hidl/HidlBinderSupport.h
@@ -332,7 +332,10 @@
if (sBnObj == nullptr) {
auto func = details::getBnConstructorMap().get(myDescriptor, nullptr);
if (!func) {
- return nullptr;
+ func = details::gBnConstructorMap.get(myDescriptor, nullptr);
+ if (!func) {
+ 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 9d9a14a..0522e44 100644
--- a/transport/include/hidl/Static.h
+++ b/transport/include/hidl/Static.h
@@ -44,6 +44,8 @@
// 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,
@@ -51,6 +53,8 @@
// 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