Loading core/jni/android_os_HwBinder.cpp +3 −9 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include "android_os_HwBinder.h" #include "android_util_Binder.h" // for binder_report_exception #include "android_os_HwParcel.h" #include "android_os_HwRemoteBinder.h" Loading Loading @@ -183,15 +185,7 @@ status_t JHwBinder::onTransact( env->ExceptionDescribe(); env->ExceptionClear(); // It is illegal to call IsInstanceOf if there is a pending exception. // Attempting to do so results in a JniAbort which crashes the entire process. if (env->IsInstanceOf(excep, gErrorClass)) { /* It's an error */ LOG(ERROR) << "Forcefully exiting"; _exit(1); } else { LOG(ERROR) << "Uncaught exception!"; } binder_report_exception(env, excep, "Uncaught error or exception in hwbinder!"); env->DeleteLocalRef(excep); } Loading core/jni/android_util_Binder.cpp +14 −11 Original line number Diff line number Diff line Loading @@ -302,8 +302,9 @@ static void report_java_lang_error(JNIEnv* env, jthrowable error, const char* ms report_java_lang_error_fatal_error(env, error, msg); } static void report_exception(JNIEnv* env, jthrowable excep, const char* msg) { namespace android { void binder_report_exception(JNIEnv* env, jthrowable excep, const char* msg) { env->ExceptionClear(); ScopedLocalRef<jstring> tagstr(env, env->NewStringUTF(LOG_TAG)); Loading Loading @@ -331,6 +332,8 @@ static void report_exception(JNIEnv* env, jthrowable excep, const char* msg) } } } // namespace android class JavaBBinderHolder; class JavaBBinder : public BBinder Loading Loading @@ -405,7 +408,7 @@ protected: if (env->ExceptionCheck()) { ScopedLocalRef<jthrowable> excep(env, env->ExceptionOccurred()); report_exception(env, excep.get(), binder_report_exception(env, excep.get(), "*** Uncaught remote exception! " "(Exceptions are not yet supported across processes.)"); res = JNI_FALSE; Loading @@ -421,7 +424,7 @@ protected: if (env->ExceptionCheck()) { ScopedLocalRef<jthrowable> excep(env, env->ExceptionOccurred()); report_exception(env, excep.get(), binder_report_exception(env, excep.get(), "*** Uncaught exception in onBinderStrictModePolicyChange"); } Loading Loading @@ -567,7 +570,7 @@ public: jBinderProxy.get()); if (env->ExceptionCheck()) { jthrowable excep = env->ExceptionOccurred(); report_exception(env, excep, binder_report_exception(env, excep, "*** Uncaught exception returned from death notification!"); } Loading Loading @@ -1163,7 +1166,7 @@ static void android_os_BinderInternal_proxyLimitcallback(int uid) if (env->ExceptionCheck()) { ScopedLocalRef<jthrowable> excep(env, env->ExceptionOccurred()); report_exception(env, excep.get(), binder_report_exception(env, excep.get(), "*** Uncaught exception in binderProxyLimitCallbackFromNative"); } } Loading core/jni/android_util_Binder.h +2 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ extern void set_dalvik_blockguard_policy(JNIEnv* env, jint strict_policy); extern void signalExceptionForError(JNIEnv* env, jobject obj, status_t err, bool canThrowRemoteException = false, int parcelSize = 0); // does not take ownership of the exception, aborts if this is an error void binder_report_exception(JNIEnv* env, jthrowable excep, const char* msg); } #endif Loading
core/jni/android_os_HwBinder.cpp +3 −9 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include "android_os_HwBinder.h" #include "android_util_Binder.h" // for binder_report_exception #include "android_os_HwParcel.h" #include "android_os_HwRemoteBinder.h" Loading Loading @@ -183,15 +185,7 @@ status_t JHwBinder::onTransact( env->ExceptionDescribe(); env->ExceptionClear(); // It is illegal to call IsInstanceOf if there is a pending exception. // Attempting to do so results in a JniAbort which crashes the entire process. if (env->IsInstanceOf(excep, gErrorClass)) { /* It's an error */ LOG(ERROR) << "Forcefully exiting"; _exit(1); } else { LOG(ERROR) << "Uncaught exception!"; } binder_report_exception(env, excep, "Uncaught error or exception in hwbinder!"); env->DeleteLocalRef(excep); } Loading
core/jni/android_util_Binder.cpp +14 −11 Original line number Diff line number Diff line Loading @@ -302,8 +302,9 @@ static void report_java_lang_error(JNIEnv* env, jthrowable error, const char* ms report_java_lang_error_fatal_error(env, error, msg); } static void report_exception(JNIEnv* env, jthrowable excep, const char* msg) { namespace android { void binder_report_exception(JNIEnv* env, jthrowable excep, const char* msg) { env->ExceptionClear(); ScopedLocalRef<jstring> tagstr(env, env->NewStringUTF(LOG_TAG)); Loading Loading @@ -331,6 +332,8 @@ static void report_exception(JNIEnv* env, jthrowable excep, const char* msg) } } } // namespace android class JavaBBinderHolder; class JavaBBinder : public BBinder Loading Loading @@ -405,7 +408,7 @@ protected: if (env->ExceptionCheck()) { ScopedLocalRef<jthrowable> excep(env, env->ExceptionOccurred()); report_exception(env, excep.get(), binder_report_exception(env, excep.get(), "*** Uncaught remote exception! " "(Exceptions are not yet supported across processes.)"); res = JNI_FALSE; Loading @@ -421,7 +424,7 @@ protected: if (env->ExceptionCheck()) { ScopedLocalRef<jthrowable> excep(env, env->ExceptionOccurred()); report_exception(env, excep.get(), binder_report_exception(env, excep.get(), "*** Uncaught exception in onBinderStrictModePolicyChange"); } Loading Loading @@ -567,7 +570,7 @@ public: jBinderProxy.get()); if (env->ExceptionCheck()) { jthrowable excep = env->ExceptionOccurred(); report_exception(env, excep, binder_report_exception(env, excep, "*** Uncaught exception returned from death notification!"); } Loading Loading @@ -1163,7 +1166,7 @@ static void android_os_BinderInternal_proxyLimitcallback(int uid) if (env->ExceptionCheck()) { ScopedLocalRef<jthrowable> excep(env, env->ExceptionOccurred()); report_exception(env, excep.get(), binder_report_exception(env, excep.get(), "*** Uncaught exception in binderProxyLimitCallbackFromNative"); } } Loading
core/jni/android_util_Binder.h +2 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ extern void set_dalvik_blockguard_policy(JNIEnv* env, jint strict_policy); extern void signalExceptionForError(JNIEnv* env, jobject obj, status_t err, bool canThrowRemoteException = false, int parcelSize = 0); // does not take ownership of the exception, aborts if this is an error void binder_report_exception(JNIEnv* env, jthrowable excep, const char* msg); } #endif