diff options
| author | 2023-03-29 02:37:49 +0000 | |
|---|---|---|
| committer | 2023-03-29 02:37:49 +0000 | |
| commit | ea62c769488999bd0e95ded4593878168ac42e16 (patch) | |
| tree | cb9ef04dd4db1ac216c1bc0d26e0a0b9006b3638 | |
| parent | e6f44ac081fa8d8dfcccc2748cb1330de655f08f (diff) | |
| parent | 6d90e403303f989918f0dd86d094f75b761c23f8 (diff) | |
Merge "binder - include calling PID/UID in uncaught remote exception code"
| -rw-r--r-- | core/jni/android_util_Binder.cpp | 11 |
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 |