diff options
| author | 2017-04-11 23:13:06 +0000 | |
|---|---|---|
| committer | 2017-04-11 23:13:08 +0000 | |
| commit | cf39eea407efc9cd9196cecd042d91a07b4bfcce (patch) | |
| tree | dfe13c480c07b10a1bc698ad3f3d5976d200da43 | |
| parent | f954f2d5cc2d254b2e4c1c4df33caf3bd66843b0 (diff) | |
| parent | 8143fa57adfbb4a5cc253e4ef68663525a8f81eb (diff) | |
Merge "jni: isLoggable: adapt to removal of property name size limit"
| -rw-r--r-- | core/java/android/util/Log.java | 4 | ||||
| -rw-r--r-- | core/jni/android_util_Log.cpp | 11 |
2 files changed, 4 insertions, 11 deletions
diff --git a/core/java/android/util/Log.java b/core/java/android/util/Log.java index 5bc6c9480025..d857bf712bfe 100644 --- a/core/java/android/util/Log.java +++ b/core/java/android/util/Log.java @@ -212,7 +212,9 @@ public final class Log { * @param tag The tag to check. * @param level The level to check. * @return Whether or not that this is allowed to be logged. - * @throws IllegalArgumentException is thrown if the tag.length() > 23. + * @throws IllegalArgumentException is thrown if the tag.length() > 23 + * for Nougat (7.0) releases (API <= 23) and prior, there is no + * tag limit of concern after this API level. */ public static native boolean isLoggable(String tag, int level); diff --git a/core/jni/android_util_Log.cpp b/core/jni/android_util_Log.cpp index 20dfe7809728..56505afc78b2 100644 --- a/core/jni/android_util_Log.cpp +++ b/core/jni/android_util_Log.cpp @@ -58,16 +58,7 @@ static jboolean android_util_Log_isLoggable(JNIEnv* env, jobject clazz, jstring return false; } - jboolean result = false; - if ((strlen(chars)+sizeof(LOG_NAMESPACE)) > PROPERTY_KEY_MAX) { - char buf2[200]; - snprintf(buf2, sizeof(buf2), "Log tag \"%s\" exceeds limit of %zu characters\n", - chars, PROPERTY_KEY_MAX - sizeof(LOG_NAMESPACE)); - - jniThrowException(env, "java/lang/IllegalArgumentException", buf2); - } else { - result = isLoggable(chars, level); - } + jboolean result = isLoggable(chars, level); env->ReleaseStringUTFChars(tag, chars); return result; |