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
This commit is contained in:
Steven Moreland
2020-10-01 22:26:35 +00:00
parent 1fa847ad64
commit 028f65fa86

View File

@@ -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;
}