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

Commit d753383b 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 am: 5ae197cb

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

Change-Id: Ib29bbb76e9bd37655e5724e2f506c74448d11269
parents 83e151be 5ae197cb
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;
        }