From 129871167444cbcd2aaca1131ec4355222d29e40 Mon Sep 17 00:00:00 2001 From: Martijn Coenen Date: Thu, 8 Dec 2016 10:48:19 +0100 Subject: HwBinder: Remove use of IHw class. Note that this is somewhat of a hack, until we properly solve b/33440494. Bug: 33440494 Bug: 33173166 Test: mma, hidl_test, hidl_test_java Change-Id: I7db8eb11c8c9c624f2f5ed11bef6c32f155b5a76 --- core/jni/android_os_HwBinder.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/core/jni/android_os_HwBinder.cpp b/core/jni/android_os_HwBinder.cpp index 740b24d645a8..2ae4a17c00a6 100644 --- a/core/jni/android_os_HwBinder.cpp +++ b/core/jni/android_os_HwBinder.cpp @@ -26,10 +26,11 @@ #include #include #include -#include +#include #include #include #include +#include #include #include @@ -241,14 +242,8 @@ static void JHwBinder_native_registerService( using android::hidl::manager::V1_0::IServiceManager; sp binder = JHwBinder::GetNativeContext(env, thiz); - - sp base = hidl::base::V1_0::IHwBase::asInterface(binder); - if (base.get() == nullptr) { - LOG(ERROR) << "IBinder object cannot be casted to the base interface."; - signalExceptionForError(env, UNKNOWN_ERROR); - return; - } - + /* TODO(b/33440494) this is not right */ + sp base = new hidl::base::V1_0::BpBase(binder); bool ok = hardware::defaultServiceManager()->add( interfaceChain, serviceName, @@ -300,7 +295,7 @@ static jobject JHwBinder_native_getService( serviceName, [&service](sp out) { service = hardware::toBinder< - hidl::base::V1_0::IBase, hidl::base::V1_0::IHwBase + hidl::base::V1_0::IBase, hidl::base::V1_0::BpBase >(out); }); -- cgit v1.2.3-59-g8ed1b