diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2018-01-03 22:38:56 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-01-03 22:38:56 +0000 |
commit | d749b47414fac334c57a2c192dfff9316674bdcf (patch) | |
tree | d484fd8c77147e3b8d4c60ecfd1edc05c6c5982d | |
parent | 686977390ae30be677cb3cfcc540aa606d175b84 (diff) | |
parent | 09e02dcdf79de1e4a9dd62db7c3152ba37a98f6c (diff) | |
download | libhidl-oreo-m2-s3-release.tar.gz |
Snap for 4485699 from 09e02dcdf79de1e4a9dd62db7c3152ba37a98f6c to oc-m2-releaseandroid-8.1.0_r8android-8.1.0_r33android-8.1.0_r30android-8.1.0_r26android-8.1.0_r25android-8.1.0_r20oreo-m2-s3-releaseoreo-m2-s2-releaseoreo-m2-s1-releaseoreo-m2-release
Change-Id: I777627ce9d9e0a544ff74cd1e1d91380dea0f056
-rw-r--r-- | transport/HidlTransportUtils.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/transport/HidlTransportUtils.cpp b/transport/HidlTransportUtils.cpp index eda9b8a..4e952eb 100644 --- a/transport/HidlTransportUtils.cpp +++ b/transport/HidlTransportUtils.cpp @@ -16,16 +16,25 @@ #include <hidl/HidlTransportUtils.h> +#include <android/hidl/base/1.0/IBase.h> + namespace android { namespace hardware { namespace details { -Return<bool> canCastInterface(::android::hidl::base::V1_0::IBase* interface, - const char* castTo, bool emitError) { +using ::android::hidl::base::V1_0::IBase; + +Return<bool> canCastInterface(IBase* interface, const char* castTo, bool emitError) { if (interface == nullptr) { return false; } + // b/68217907 + // Every HIDL interface is a base interface. + if (std::string(IBase::descriptor) == castTo) { + return true; + } + bool canCast = false; auto chainRet = interface->interfaceChain([&](const hidl_vec<hidl_string> &types) { for (size_t i = 0; i < types.size(); i++) { @@ -46,7 +55,7 @@ Return<bool> canCastInterface(::android::hidl::base::V1_0::IBase* interface, return canCast; } -std::string getDescriptor(::android::hidl::base::V1_0::IBase* interface) { +std::string getDescriptor(IBase* interface) { std::string myDescriptor{}; auto ret = interface->interfaceDescriptor([&](const hidl_string &types) { myDescriptor = types.c_str(); |