summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-11-29 18:13:13 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-11-29 18:13:13 +0000
commit3fc10363768b350a94463175759e665a75f55989 (patch)
treed484fd8c77147e3b8d4c60ecfd1edc05c6c5982d
parent85bff5b7bb8d56b5afdfcb23bbcd0e5f744766d2 (diff)
parentdf72fbdabacbcd45bab5c8409817e14df9710407 (diff)
downloadlibhidl-oreo-m3-release.tar.gz
Merge cherrypicks of [3287457, 3287458, 3286978, 3286979, 3287477, 3287478, 3287479, 3287480, 3287517, 3287518, 3287537, 3287538, 3287539, 3287540, 3287481, 3287482, 3287483, 3287484, 3287485, 3287486, 3287487, 3287488, 3287359, 3287459, 3287360, 3287361, 3287362, 3287363, 3287364, 3287365, 3287366, 3287367, 3287489, 3287490, 3287491, 3287557, 3287577, 3287558, 3287492, 3287493, 3287597, 3287617, 3286980, 3287460, 3287494] into oc-m3-releaseandroid-8.1.0_r9android-8.1.0_r7android-8.1.0_r22android-8.1.0_r21android-8.1.0_r18android-8.1.0_r17android-8.1.0_r14android-8.1.0_r13oreo-m5-releaseoreo-m3-release
Change-Id: Id2f5c04d866c6e9f2c1eaf46ebe273f6fa383db5
-rw-r--r--transport/HidlTransportUtils.cpp15
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();