Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ae197cb authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge "HIDL Java: DeadObjectException" am: 628198a9 am: d16ad56f am: 6a969595

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1355810

Change-Id: Ia4dac0da412a761cb940a92e4d939c584f19e69c
parents 4c1a47c2 6a969595
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -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;
        }