OSDN Git Service

HIDL: Check error value.
authorSteven Moreland <smoreland@google.com>
Wed, 17 Jan 2018 21:26:35 +0000 (13:26 -0800)
committerSteven Moreland <smoreland@google.com>
Wed, 17 Jan 2018 21:26:35 +0000 (13:26 -0800)
HwParcel's verifySuccess method doesn't actually check
to see if the call succeeded.

Change-Id: Iaa99cbfd6f5f211facaa20c09c5e1dae8e2b8a7f
Fixes: 71813867
Test: boot walleye, hidl_test_java

core/jni/android_os_HwParcel.cpp

index 9494fb8..061349a 100644 (file)
@@ -391,6 +391,10 @@ static void JHwParcel_native_verifySuccess(JNIEnv *env, jobject thiz) {
     Status status;
     status_t err = ::android::hardware::readFromParcel(&status, *parcel);
     signalExceptionForError(env, err);
+
+    if (!status.isOk()) {
+        signalExceptionForError(env, UNKNOWN_ERROR, true /* canThrowRemoteException */);
+    }
 }
 
 static void JHwParcel_native_release(