summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2023-03-29 02:37:49 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2023-03-29 02:37:49 +0000
commitea62c769488999bd0e95ded4593878168ac42e16 (patch)
treecb9ef04dd4db1ac216c1bc0d26e0a0b9006b3638
parente6f44ac081fa8d8dfcccc2748cb1330de655f08f (diff)
parent6d90e403303f989918f0dd86d094f75b761c23f8 (diff)
Merge "binder - include calling PID/UID in uncaught remote exception code"
-rw-r--r--core/jni/android_util_Binder.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp
index a7c7d0ba35bc..b24dc8a9e63b 100644
--- a/core/jni/android_util_Binder.cpp
+++ b/core/jni/android_util_Binder.cpp
@@ -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