diff --git a/core/jni/android_os_HwBinder.cpp b/core/jni/android_os_HwBinder.cpp index 740b24d645a86..2ae4a17c00a68 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); });