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