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

Commit 6d90e403 authored by Steven Moreland's avatar Steven Moreland
Browse files

binder - include calling PID/UID in uncaught remote exception code

Bug: 150808347
Change-Id: I7c8e69e1f71910b7e1358b91646b23380cce74a3
Test: N/A
parent a7e060a9
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -413,9 +413,13 @@ protected:

        if (env->ExceptionCheck()) {
            ScopedLocalRef<jthrowable> excep(env, env->ExceptionOccurred());
            binder_report_exception(env, excep.get(),
                                    "*** Uncaught remote exception!  "
                                    "(Exceptions are not yet supported across processes.)");

            auto state = IPCThreadState::self();
            String8 msg;
            msg.appendFormat("*** Uncaught remote exception! Exceptions are not yet supported "
                             "across processes. Client PID %d UID %d.",
                             state->getCallingPid(), state->getCallingUid());
            binder_report_exception(env, excep.get(), msg.c_str());
            res = JNI_FALSE;
        }

@@ -431,6 +435,7 @@ protected:
            ScopedLocalRef<jthrowable> excep(env, env->ExceptionOccurred());
            binder_report_exception(env, excep.get(),
                                    "*** Uncaught exception in onBinderStrictModePolicyChange");
            // TODO: should turn this to fatal?
        }

        // Need to always call through the native implementation of