Merge "HIDL Java: DeadObjectException" am: 628198a90f am: d16ad56f35 am: 6a9695953d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1355810 Change-Id: Ia4dac0da412a761cb940a92e4d939c584f19e69c
This commit is contained in:
@@ -122,10 +122,18 @@ void signalExceptionForError(JNIEnv *env, status_t err, bool canThrowRemoteExcep
|
||||
std::stringstream ss;
|
||||
ss << "HwBinder Error: (" << err << ")";
|
||||
|
||||
jniThrowException(
|
||||
env,
|
||||
canThrowRemoteException ? "android/os/RemoteException" : "java/lang/RuntimeException",
|
||||
ss.str().c_str());
|
||||
const char* exception = nullptr;
|
||||
if (canThrowRemoteException) {
|
||||
if (err == DEAD_OBJECT) {
|
||||
exception = "android/os/DeadObjectException";
|
||||
} else {
|
||||
exception = "android/os/RemoteException";
|
||||
}
|
||||
} else {
|
||||
exception = "java/lang/RuntimeException";
|
||||
}
|
||||
|
||||
jniThrowException(env, exception, ss.str().c_str());
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user