diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-04-25 01:22:06 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-04-25 01:22:06 +0000 |
commit | 752c60ccee8ddc705b28ccb00f2d7c80c842f9bb (patch) | |
tree | 5b6abb5dd8c466a821d57f6d27b178809f2414ba | |
parent | 1abf9ba128454a46da46e3fbbfd84bd84e33ec13 (diff) | |
parent | 7b7db076000b8a854478dd488b8acd9f2df98e25 (diff) | |
download | libhidl-sdk-release.tar.gz |
Snap for 11762235 from 7b7db076000b8a854478dd488b8acd9f2df98e25 to sdk-releasesdk-release
Change-Id: If35df7a06c1fe245fec73c2b0e4de5a5bef0dc11
-rw-r--r-- | transport/ServiceManagement.cpp | 34 |
1 files changed, 2 insertions, 32 deletions
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 = true; 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() { |