diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2015-03-12 01:22:36 +0900 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2015-03-16 21:09:23 +0900 |
commit | 23f9a3173cac2adfcdfc297f5b52c44299e7cd4c (patch) | |
tree | 5d3ed647be04f2f9bcd644102535692e71f890e0 | |
parent | 305f2218b79ee8d1e816201cdc92cd4a730a48d5 (diff) | |
download | libnativehelper-23f9a3173cac2adfcdfc297f5b52c44299e7cd4c.tar.gz |
Add JNI references for PacketSocketAddress.
Also remove an outdated comment.
Change-Id: If0da380f78c1e77963953d8e64737d0f22c90fad
-rw-r--r-- | JniConstants.cpp | 2 | ||||
-rw-r--r-- | include/nativehelper/JniConstants.h | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/JniConstants.cpp b/JniConstants.cpp index 745e8ba..9a77859 100644 --- a/JniConstants.cpp +++ b/JniConstants.cpp @@ -55,6 +55,7 @@ jclass JniConstants::netlinkSocketAddressClass; jclass JniConstants::objectClass; jclass JniConstants::objectArrayClass; jclass JniConstants::outputStreamClass; +jclass JniConstants::packetSocketAddressClass; jclass JniConstants::parsePositionClass; jclass JniConstants::patternSyntaxExceptionClass; jclass JniConstants::realToStringClass; @@ -120,6 +121,7 @@ void JniConstants::init(JNIEnv* env) { objectClass = findClass(env, "java/lang/Object"); objectArrayClass = findClass(env, "[Ljava/lang/Object;"); outputStreamClass = findClass(env, "java/io/OutputStream"); + packetSocketAddressClass = findClass(env, "android/system/PacketSocketAddress"); parsePositionClass = findClass(env, "java/text/ParsePosition"); patternSyntaxExceptionClass = findClass(env, "java/util/regex/PatternSyntaxException"); realToStringClass = findClass(env, "java/lang/RealToString"); diff --git a/include/nativehelper/JniConstants.h b/include/nativehelper/JniConstants.h index 9707154..40a0315 100644 --- a/include/nativehelper/JniConstants.h +++ b/include/nativehelper/JniConstants.h @@ -22,11 +22,10 @@ /** * A cache to avoid calling FindClass at runtime. * - * Class lookup is relatively expensive (2.5us on passion-eng at the time of writing), so we do - * all such lookups eagerly at startup. This means that code that never uses, say, - * java.util.zip.Deflater still has to pay for the lookup, but it means that on a device the cost - * is definitely paid during boot and amortized. A central cache also removes the temptation to - * dynamically call FindClass rather than add a small cache to each file that needs one. Another + * Class lookup is relatively expensive, so we do these lookups at startup. This means that code + * that never uses, say, java.util.zip.Deflater still has to pay for the lookup, but it means that + * on device the cost is paid during boot and amortized. A central cache also removes the temptation + * to dynamically call FindClass rather than add a small cache to each file that needs one. Another * cost is that each class cached here requires a global reference, though in practice we save * enough by not having a global reference for each file that uses a class such as java.lang.String * which is used in several files. @@ -73,6 +72,7 @@ struct JniConstants { static jclass objectClass; static jclass objectArrayClass; static jclass outputStreamClass; + static jclass packetSocketAddressClass; static jclass parsePositionClass; static jclass patternSyntaxExceptionClass; static jclass realToStringClass; |