Kenny Root | e64e097 | 2012-09-09 13:22:06 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 19 | namespace android { |
| 20 | |
| 21 | static jint checkFunction(JNIEnv*, jclass) { |
| 22 | return 1; |
| 23 | } |
| 24 | |
Daniel Micay | 76f6a86 | 2015-09-19 17:31:01 -0400 | [diff] [blame] | 25 | static const JNINativeMethod sMethods[] = { |
Kenny Root | e64e097 | 2012-09-09 13:22:06 -0700 | [diff] [blame] | 26 | /* name, signature, funcPtr */ |
| 27 | { "checkFunction", "()I", (void*) checkFunction }, |
| 28 | }; |
| 29 | |
Dmitriy Ivanov | dec4688 | 2014-09-30 15:10:48 -0700 | [diff] [blame] | 30 | int register_com_android_frameworks_coretests_JNITests(JNIEnv* env) { |
| 31 | return jniRegisterNativeMethods(env, "com/android/frameworks/coretests/JNITests", sMethods, |
Kenny Root | e64e097 | 2012-09-09 13:22:06 -0700 | [diff] [blame] | 32 | NELEM(sMethods)); |
| 33 | } |
| 34 | |
| 35 | } |
| 36 | |
| 37 | /* |
| 38 | * JNI Initialization |
| 39 | */ |
Aurimas Liutikas | 1c8cbb5 | 2016-02-19 13:44:25 -0800 | [diff] [blame] | 40 | jint JNI_OnLoad(JavaVM *jvm, void */* reserved */) { |
Kenny Root | e64e097 | 2012-09-09 13:22:06 -0700 | [diff] [blame] | 41 | 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 Ivanov | dec4688 | 2014-09-30 15:10:48 -0700 | [diff] [blame] | 49 | if ((status = android::register_com_android_frameworks_coretests_JNITests(e)) < 0) { |
Kenny Root | e64e097 | 2012-09-09 13:22:06 -0700 | [diff] [blame] | 50 | return JNI_ERR; |
| 51 | } |
| 52 | |
| 53 | return JNI_VERSION_1_6; |
| 54 | } |