Name Date Size #Lines LOC

..--

header_only_include/nativehelper/07-Oct-2023-503290

include/07-Oct-2023-775398

include_jni/07-Oct-2023-1,143915

include_platform/nativehelper/07-Oct-2023-26083

include_platform_header_only/nativehelper/07-Oct-2023-1,7261,012

tests/07-Oct-2023-1,9401,331

tests_mts/07-Oct-2023-697473

ALog-priv.hD07-Oct-20231.9 KiB7939

Android.bpD07-Oct-20236.6 KiB250236

DlHelp.cD07-Oct-20232.2 KiB8352

DlHelp.hD07-Oct-2023932 3311

ExpandableString.cD07-Oct-20231.4 KiB4827

ExpandableString.hD07-Oct-20231.5 KiB4614

JNIHelp.cD07-Oct-202314.2 KiB392267

JNIPlatformHelp.cD07-Oct-20232.6 KiB6640

JniConstants.cD07-Oct-20237.6 KiB196122

JniConstants.hD07-Oct-20231.9 KiB6018

JniInvocation-priv.hD07-Oct-2023888 297

JniInvocation.cD07-Oct-20236.9 KiB225148

NOTICED07-Oct-202310.4 KiB191158

OWNERSD07-Oct-202352 43

PREUPLOAD.cfgD07-Oct-202329 32

README.mdD07-Oct-20234.2 KiB9873

TEST_MAPPINGD07-Oct-2023306 2019

file_descriptor_jni.cD07-Oct-20231.8 KiB4824

libnativehelper.map.txtD07-Oct-2023640 3125

libnativehelper_lazy.cD07-Oct-20239.1 KiB276166

libnativehelper_lazy.hD07-Oct-2023736 255

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