Allow libhidl to be used in recovery am: 86ae999dd1 am: 2113b038e0
am: 190769589d

Change-Id: I93e934017b9cde3070fd52b72ccf5a9e88869254
diff --git a/base/Android.bp b/base/Android.bp
index 22f5ee1..359ac91 100644
--- a/base/Android.bp
+++ b/base/Android.bp
@@ -14,6 +14,7 @@
 
 cc_library {
     name: "libhidlbase",
+    recovery_available: true,
     vendor_available: true,
     vndk: {
         enabled: true,
diff --git a/transport/Android.bp b/transport/Android.bp
index 434a1d5..12a23c5 100644
--- a/transport/Android.bp
+++ b/transport/Android.bp
@@ -19,6 +19,7 @@
 
 cc_library {
     name: "libhidltransport",
+    recovery_available: true,
     vendor_available: true,
     vndk: {
         enabled: true,
@@ -80,4 +81,10 @@
             cflags: ["-DENFORCE_VINTF_MANIFEST"]
         },
     },
+
+    target: {
+        recovery: {
+            exclude_shared_libs: ["libvndksupport"],
+        },
+    },
 }
diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp
index e624887..8e3ab7a 100644
--- a/transport/ServiceManagement.cpp
+++ b/transport/ServiceManagement.cpp
@@ -39,7 +39,9 @@
 #include <android-base/stringprintf.h>
 #include <hwbinder/IPCThreadState.h>
 #include <hwbinder/Parcel.h>
+#if !defined(__ANDROID_RECOVERY__)
 #include <vndksupport/linker.h>
+#endif
 
 #include <android/hidl/manager/1.2/BnHwServiceManager.h>
 #include <android/hidl/manager/1.2/BpHwServiceManager.h>
@@ -347,7 +349,9 @@
                 if (path == HAL_LIBRARY_PATH_SYSTEM) {
                     handle = dlopen(fullPath.c_str(), dlMode);
                 } else {
+#if !defined(__ANDROID_RECOVERY__)
                     handle = android_load_sphal_library(fullPath.c_str(), dlMode);
+#endif
                 }
 
                 if (handle == nullptr) {