xref: /aosp_15_r20/frameworks/base/libs/nativehelper_jvm/JniConstants.h (revision d57664e9bc4670b3ecf6748a746a57c557b6bc9e)
1 /*
2  * Copyright 2024 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <sys/cdefs.h>
20 
21 #include <jni.h>
22 
23 __BEGIN_DECLS
24 
25 //
26 // Classes in constants cache.
27 //
28 // NB The implementations of these methods are generated by the JCLASS_ACCESSOR_IMPL macro in
29 // JniConstants.c.
30 //
31 jclass JniConstants_FileDescriptorClass(JNIEnv* env);
32 jclass JniConstants_NioByteBufferClass(JNIEnv* env);
33 jclass JniConstants_NioShortBufferClass(JNIEnv* env);
34 jclass JniConstants_NioCharBufferClass(JNIEnv* env);
35 jclass JniConstants_NioIntBufferClass(JNIEnv* env);
36 jclass JniConstants_NioFloatBufferClass(JNIEnv* env);
37 jclass JniConstants_NioLongBufferClass(JNIEnv* env);
38 jclass JniConstants_NioDoubleBufferClass(JNIEnv* env);
39 
40 //
41 // Methods in the constants cache.
42 //
43 // NB The implementations of these methods are generated by the JMETHODID_ACCESSOR_IMPL macro in
44 // JniConstants.c.
45 //
46 jmethodID JniConstants_FileDescriptor_init(JNIEnv* env);
47 jmethodID JniConstants_NioBuffer_array(JNIEnv* env);
48 jmethodID JniConstants_NioBuffer_arrayOffset(JNIEnv* env);
49 jmethodID JniConstants_NioBuffer_hasArray(JNIEnv* env);
50 jmethodID JniConstants_NioBuffer_isDirect(JNIEnv* env);
51 
52 //
53 // Fields in the constants cache.
54 //
55 // NB The implementations of these methods are generated by the JFIELDID_ACCESSOR_IMPL macro in
56 // JniConstants.c.
57 //
58 jfieldID JniConstants_FileDescriptor_fd(JNIEnv* env);
59 jfieldID JniConstants_NioBuffer_address(JNIEnv* env);
60 jfieldID JniConstants_NioBuffer_limit(JNIEnv* env);
61 jfieldID JniConstants_NioBuffer_position(JNIEnv* env);
62 
63 __END_DECLS
64