From 028f65fa86f8280677f6e04bd57b895251e5cb20 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Thu, 1 Oct 2020 22:26:35 +0000 Subject: HIDL: unsilence error for local Java binder HIDL Java never originally supported passthrough HALs. However, even though after a series of bug fixes were created, they are believed to work, they are still untested, and there is a desire to avoid adding additional complexity by introducing this usecase, which hasn't been needed from the birth to the beginning of the deprecation of HIDL. Bug: 169369810 Test: RemoteException, instead of silent failure 10-01 22:25:30.691 3701 3701 E android_os_HwBinder: Local Java Binder not supported. 10-01 22:25:30.691 3701 3701 E android_os_HwBinder: Uncaught exception! 10-01 22:25:30.692 3704 3704 E HidlTestJava: Error 10-01 22:25:30.692 3704 3704 E HidlTestJava: android.os.RemoteException: HwBinder Error: (-2147483648) 10-01 22:25:30.692 3704 3704 E HidlTestJava: at android.os.HwRemoteBinder.transact(Native Method) 10-01 22:25:30.692 3704 3704 E HidlTestJava: at android.hardware.tests.baz.V1_0.IBaz$Proxy.haveSomeStructWithInterface(IBaz.java:2497) 10-01 22:25:30.691 3701 3701 E android_os_HwBinder: Local Java Binder Change-Id: Ic69c4c860fd5b93320c249ab460bf1c6192fe3e2 --- core/jni/android_os_HwParcel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/jni/android_os_HwParcel.cpp b/core/jni/android_os_HwParcel.cpp index ff336ee64b54..4c4443fc29c3 100644 --- a/core/jni/android_os_HwParcel.cpp +++ b/core/jni/android_os_HwParcel.cpp @@ -990,6 +990,8 @@ static jobject JHwParcel_native_readStrongBinder(JNIEnv *env, jobject thiz) { } if (!validateCanUseHwBinder(binder)) { + jniThrowException(env, "java/lang/IllegalArgumentException", + "Local binder is not supported in Java"); return nullptr; } -- cgit v1.2.3-59-g8ed1b