Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
header_only_include/nativehelper/ | 03-May-2024 | - | 503 | 290 | ||
include/ | 03-May-2024 | - | 775 | 398 | ||
include_jni/ | 03-May-2024 | - | 1,143 | 915 | ||
include_platform/nativehelper/ | 03-May-2024 | - | 260 | 83 | ||
include_platform_header_only/nativehelper/ | 03-May-2024 | - | 1,726 | 1,012 | ||
tests/ | 03-May-2024 | - | 1,940 | 1,331 | ||
tests_mts/ | 03-May-2024 | - | 697 | 473 | ||
ALog-priv.h | D | 03-May-2024 | 1.9 KiB | 79 | 39 | |
Android.bp | D | 03-May-2024 | 6.6 KiB | 250 | 236 | |
DlHelp.c | D | 03-May-2024 | 2.2 KiB | 83 | 52 | |
DlHelp.h | D | 03-May-2024 | 932 | 33 | 11 | |
ExpandableString.c | D | 03-May-2024 | 1.4 KiB | 48 | 27 | |
ExpandableString.h | D | 03-May-2024 | 1.5 KiB | 46 | 14 | |
JNIHelp.c | D | 03-May-2024 | 14.2 KiB | 392 | 267 | |
JNIPlatformHelp.c | D | 03-May-2024 | 2.6 KiB | 66 | 40 | |
JniConstants.c | D | 03-May-2024 | 7.6 KiB | 196 | 122 | |
JniConstants.h | D | 03-May-2024 | 1.9 KiB | 60 | 18 | |
JniInvocation-priv.h | D | 03-May-2024 | 888 | 29 | 7 | |
JniInvocation.c | D | 03-May-2024 | 6.9 KiB | 225 | 148 | |
NOTICE | D | 03-May-2024 | 10.4 KiB | 191 | 158 | |
OWNERS | D | 03-May-2024 | 52 | 4 | 3 | |
PREUPLOAD.cfg | D | 03-May-2024 | 29 | 3 | 2 | |
README.md | D | 03-May-2024 | 4.2 KiB | 98 | 73 | |
TEST_MAPPING | D | 03-May-2024 | 306 | 20 | 19 | |
file_descriptor_jni.c | D | 03-May-2024 | 1.8 KiB | 48 | 24 | |
libnativehelper.map.txt | D | 03-May-2024 | 640 | 31 | 25 | |
libnativehelper_lazy.c | D | 03-May-2024 | 9.1 KiB | 276 | 166 | |
libnativehelper_lazy.h | D | 03-May-2024 | 736 | 25 | 5 |
README.md
1# libnativehelper 2 3libnativehelper is a collection of JNI related utilities used in Android. 4 5There are several header and binary libraries here and not all of the 6functionality fits together well. The header libraries are mostly C++ 7based. The binary libraries are entirely written in C with no C++ 8dependencies. This is by design as the code here can be distributed in 9multiple ways, including mainline modules, so keeping the size down 10benefits everyone with smaller downloads and a stable ABI. 11 12## Header Libraries 13 14### jni_headers 15 16This is a header library that contains provides the API represented in 17the JNI Specification 1.6. Any project in Android that depends on 18`jni.h` should depend on this. 19 20See: 21 22* [jni.h](include_jni/jni.h) 23 24### libnativehelper_header_only 25 26These headers provide utilities that defined entirely within the 27headers. There are scoped resource classes that make common JNI 28patterns of acquiring and releasing resources safer to use than the 29JNI specification equivalents. Examples being `ScopedLocalRef` to 30manage the lifetime of local references and `ScopedUtfChars` to manage 31the lifetime of Java strings in native code and provide access to utf8 32characters. 33 34See: 35 36* [nativehelper/nativehelper_utils.h](header_only_include/nativehelper/nativehelper_utils.h) 37* [nativehelper/scoped_utf_chars.h](header_only_include/nativehelper/scoped_utf_chars.h) 38* [nativehelper/scoped_bytes.h](header_only_include/nativehelper/scoped_bytes.h) 39* [nativehelper/scoped_string_chars.h](header_only_include/nativehelper/scoped_string_chars.h) 40* [nativehelper/scoped_primitive_array.h](header_only_include/nativehelper/scoped_primitive_array.h) 41* [nativehelper/scoped_local_ref.h](header_only_include/nativehelper/scoped_local_ref.h) 42* [nativehelper/scoped_local_frame.h](header_only_include/nativehelper/scoped_local_frame.h) 43 44### jni_platform_headers 45 46The `jni_macros.h` header provide compile time checking of JNI methods 47implemented in C++. They ensure the C++ method declaration match the 48Java signature they are associated with. 49 50See: 51 52* [nativehelper/jni_macros.h](include_platform_header_only/nativehelper/jni_macros.h) 53 54## Libraries 55 56### libnativehelper 57 58A shared library distributed in the ART module that provides helper 59routines built on Java APIs. This library depends on details that are 60private to libcore and use should be restricted to platform code and 61within the ART module. 62 63This library also contains the JNI invocation API from the JNI 64Specification and the glue that connects the ART runtime to the API 65implementation. The glue logic is platform only as it is used with the 66Zygote and the standalone dalvikvm. 67 68See: 69* [nativehelper/JNIHelp.h](include/nativehelper/JNIHelp.h) 70* [nativehelper/JniInvocation.h](include_platform/nativehelper/JniInvocation.h) 71* [nativehelper/JNIPlatformHelp.h](include_platform/nativehelper/JNIPlatformHelp.h) 72* [nativehelper/ScopedBytes.h](include/nativehelper/ScopedBytes.h) 73* [nativehelper/ScopedUtfChars.h](include/nativehelper/ScopedUtfChars.h) 74* [nativehelper/ScopedLocalFrame.h](include/nativehelper/ScopedLocalFrame.h) 75* [nativehelper/ScopedLocalRef.h](include/nativehelper/ScopedLocalRef.h) 76* [nativehelper/ScopedPrimitiveArray.h](include/nativehelper/ScopedPrimitiveArray.h) 77* [nativehelper/ScopedStringChars.h](include/nativehelper/ScopedStringChars.h) 78* [nativehelper/toStringArray.h](include/nativehelper/toStringArray.h) 79 80### libnativehelper_compat_libc++ 81 82This shared and static library contains a subset of the helper 83routines in libnativehelper based on public Java API. This code can be 84statically linked as the Java APIs it depends on are considered 85stable. The name of this library is a misnomer since it contains no 86C++ code. 87 88See: 89 90* [nativehelper/JNIHelp.h](include/nativehelper/JNIHelp.h) 91* [nativehelper/ScopedBytes.h](include/nativehelper/ScopedBytes.h) 92* [nativehelper/ScopedUtfChars.h](include/nativehelper/ScopedUtfChars.h) 93* [nativehelper/ScopedLocalFrame.h](include/nativehelper/ScopedLocalFrame.h) 94* [nativehelper/ScopedLocalRef.h](include/nativehelper/ScopedLocalRef.h) 95* [nativehelper/ScopedPrimitiveArray.h](include/nativehelper/ScopedPrimitiveArray.h) 96* [nativehelper/ScopedStringChars.h](include/nativehelper/ScopedStringChars.h) 97* [nativehelper/toStringArray.h](include/nativehelper/toStringArray.h) 98