• Home
Name Date Size #Lines LOC

..--

header_only_include/nativehelper/03-May-2024-503290

include/03-May-2024-775398

include_jni/03-May-2024-1,143915

include_platform/nativehelper/03-May-2024-26083

include_platform_header_only/nativehelper/03-May-2024-1,7261,012

tests/03-May-2024-1,9401,331

tests_mts/03-May-2024-697473

ALog-priv.hD03-May-20241.9 KiB7939

Android.bpD03-May-20246.6 KiB250236

DlHelp.cD03-May-20242.2 KiB8352

DlHelp.hD03-May-2024932 3311

ExpandableString.cD03-May-20241.4 KiB4827

ExpandableString.hD03-May-20241.5 KiB4614

JNIHelp.cD03-May-202414.2 KiB392267

JNIPlatformHelp.cD03-May-20242.6 KiB6640

JniConstants.cD03-May-20247.6 KiB196122

JniConstants.hD03-May-20241.9 KiB6018

JniInvocation-priv.hD03-May-2024888 297

JniInvocation.cD03-May-20246.9 KiB225148

NOTICED03-May-202410.4 KiB191158

OWNERSD03-May-202452 43

PREUPLOAD.cfgD03-May-202429 32

README.mdD03-May-20244.2 KiB9873

TEST_MAPPINGD03-May-2024306 2019

file_descriptor_jni.cD03-May-20241.8 KiB4824

libnativehelper.map.txtD03-May-2024640 3125

libnativehelper_lazy.cD03-May-20249.1 KiB276166

libnativehelper_lazy.hD03-May-2024736 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