Merge "HIDL Java: DeadObjectException"

This commit is contained in:
Steven Moreland
2020-07-08 16:45:34 +00:00
committed by Gerrit Code Review

View File

@@ -122,10 +122,18 @@ void signalExceptionForError(JNIEnv *env, status_t err, bool canThrowRemoteExcep
std::stringstream ss; std::stringstream ss;
ss << "HwBinder Error: (" << err << ")"; ss << "HwBinder Error: (" << err << ")";
jniThrowException( const char* exception = nullptr;
env, if (canThrowRemoteException) {
canThrowRemoteException ? "android/os/RemoteException" : "java/lang/RuntimeException", if (err == DEAD_OBJECT) {
ss.str().c_str()); exception = "android/os/DeadObjectException";
} else {
exception = "android/os/RemoteException";
}
} else {
exception = "java/lang/RuntimeException";
}
jniThrowException(env, exception, ss.str().c_str());
break; break;
} }