Snap for 11766482 from fa56ef0d2dee9739bb75965fa0c60cf1cd71ca6c to 24Q3-release

Change-Id: I76aec0675c028f9091681ca47fb4680e3d1c4d6c
diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp
index 54bb8dc..b5e02df 100644
--- a/transport/ServiceManagement.cpp
+++ b/transport/ServiceManagement.cpp
@@ -45,6 +45,7 @@
 #include <android-base/properties.h>
 #include <android-base/stringprintf.h>
 #include <android-base/strings.h>
+#include <hwbinder/HidlSupport.h>
 #include <hwbinder/IPCThreadState.h>
 #include <hwbinder/Parcel.h>
 #if !defined(__ANDROID_RECOVERY__) && defined(__ANDROID__)
@@ -71,39 +72,8 @@
 static constexpr bool kIsRecovery = false;
 #endif
 
-static bool isHwServiceManagerInstalled() {
-    return access("/system_ext/bin/hwservicemanager", F_OK) == 0 ||
-           access("/system/system_ext/bin/hwservicemanager", F_OK) == 0 ||
-           access("/system/bin/hwservicemanager", F_OK) == 0;
-}
-
-static bool waitForHwServiceManager() {
-    if (!isHwServiceManagerInstalled()) {
-        return false;
-    }
-    // TODO(b/31559095): need bionic host so that we can use 'prop_info' returned
-    // from WaitForProperty
-#ifdef __ANDROID__
-    static const char* kHwServicemanagerReadyProperty = "hwservicemanager.ready";
-
-    using std::literals::chrono_literals::operator""s;
-
-    using android::base::WaitForProperty;
-    while (true) {
-        if (base::GetBoolProperty("hwservicemanager.disabled", false)) {
-            return false;
-        }
-        if (WaitForProperty(kHwServicemanagerReadyProperty, "true", 1s)) {
-            return true;
-        }
-        LOG(WARNING) << "Waited for hwservicemanager.ready for a second, waiting another...";
-    }
-#endif  // __ANDROID__
-    return true;
-}
-
 bool isHidlSupported() {
-    return waitForHwServiceManager();
+    return isHwbinderSupportedBlocking();
 }
 
 static std::string binaryName() {