summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2017-10-10 00:01:25 +0000
committer android-build-merger <android-build-merger@google.com> 2017-10-10 00:01:25 +0000
commita2f041fb9f79fd1baff0b0bf2a41d252f9b714f0 (patch)
tree7a6214c49467da9c6eaf155780e67735229b7f55
parent06247e94cf6086093cf8b1911d06fb42b3daa166 (diff)
parent25c2a82bed6b32fa2a22129746c48e10a61a20cb (diff)
Merge "EventLog: Check for exception after add()" am: c30a6ac2f1 am: f8fa4b8352 am: d145cab07b
am: 25c2a82bed Change-Id: I12744607497e0e5c230994aad930413d1342f713
-rw-r--r--core/jni/android_app_admin_SecurityLog.cpp3
-rw-r--r--core/jni/android_util_EventLog.cpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/core/jni/android_app_admin_SecurityLog.cpp b/core/jni/android_app_admin_SecurityLog.cpp
index 9a4c37167e3b..be3eef75fe71 100644
--- a/core/jni/android_app_admin_SecurityLog.cpp
+++ b/core/jni/android_app_admin_SecurityLog.cpp
@@ -161,6 +161,9 @@ static void readEvents(JNIEnv* env, int loggerMode, jlong startTime, jobject out
env->CallBooleanMethod(out, gCollectionAddID, event);
env->DeleteLocalRef(event);
env->DeleteLocalRef(array);
+ if (env->ExceptionCheck() == JNI_TRUE) {
+ break;
+ }
}
android_logger_list_close(logger_list);
diff --git a/core/jni/android_util_EventLog.cpp b/core/jni/android_util_EventLog.cpp
index 9fd7c4041058..76ce30779ced 100644
--- a/core/jni/android_util_EventLog.cpp
+++ b/core/jni/android_util_EventLog.cpp
@@ -215,6 +215,9 @@ static void readEvents(JNIEnv* env, int loggerMode, jintArray tags, jlong startT
env->CallBooleanMethod(out, gCollectionAddID, event);
env->DeleteLocalRef(event);
env->DeleteLocalRef(array);
+ if (env->ExceptionCheck() == JNI_TRUE) {
+ break;
+ }
}
}