blob: 8d9119275bc80a194bec5af8b24791b00323fb97 [file] [log] [blame]
Kenny Roote64e0972012-09-09 13:22:06 -07001/*
2 * Copyright (C) 2012 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#include "nativehelper/JNIHelp.h"
18
19namespace android {
20
21static jint checkFunction(JNIEnv*, jclass) {
22 return 1;
23}
24
Daniel Micay76f6a862015-09-19 17:31:01 -040025static const JNINativeMethod sMethods[] = {
Kenny Roote64e0972012-09-09 13:22:06 -070026 /* name, signature, funcPtr */
27 { "checkFunction", "()I", (void*) checkFunction },
28};
29
Dmitriy Ivanovdec46882014-09-30 15:10:48 -070030int register_com_android_frameworks_coretests_JNITests(JNIEnv* env) {
31 return jniRegisterNativeMethods(env, "com/android/frameworks/coretests/JNITests", sMethods,
Kenny Roote64e0972012-09-09 13:22:06 -070032 NELEM(sMethods));
33}
34
35}
36
37/*
38 * JNI Initialization
39 */
Aurimas Liutikas1c8cbb52016-02-19 13:44:25 -080040jint JNI_OnLoad(JavaVM *jvm, void */* reserved */) {
Kenny Roote64e0972012-09-09 13:22:06 -070041 JNIEnv *e;
42 int status;
43
44 // Check JNI version
45 if (jvm->GetEnv((void **) &e, JNI_VERSION_1_6)) {
46 return JNI_ERR;
47 }
48
Dmitriy Ivanovdec46882014-09-30 15:10:48 -070049 if ((status = android::register_com_android_frameworks_coretests_JNITests(e)) < 0) {
Kenny Roote64e0972012-09-09 13:22:06 -070050 return JNI_ERR;
51 }
52
53 return JNI_VERSION_1_6;
54}