Brian Muramatsu | 8c005b3 | 2010-07-07 16:43:01 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 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 <jni.h> |
| 18 | #include <stdio.h> |
| 19 | |
Brian Muramatsu | 8c005b3 | 2010-07-07 16:43:01 -0700 | [diff] [blame] | 20 | extern int register_android_os_cts_CpuFeatures(JNIEnv*); |
Brian Muramatsu | 8c005b3 | 2010-07-07 16:43:01 -0700 | [diff] [blame] | 21 | |
Rom Lemarchand | 762312d | 2014-02-11 10:59:15 -0800 | [diff] [blame] | 22 | extern int register_android_os_cts_TaggedPointer(JNIEnv*); |
| 23 | |
Nick Kralevich | a948d73 | 2013-05-10 11:06:47 -0700 | [diff] [blame] | 24 | extern int register_android_os_cts_OSFeatures(JNIEnv*); |
| 25 | |
Brian Muramatsu | b33836e | 2011-04-19 11:35:22 -0700 | [diff] [blame] | 26 | extern int register_android_os_cts_FileUtils(JNIEnv*); |
| 27 | |
Brian Muramatsu | 8c005b3 | 2010-07-07 16:43:01 -0700 | [diff] [blame] | 28 | jint JNI_OnLoad(JavaVM *vm, void *reserved) { |
| 29 | JNIEnv *env = NULL; |
| 30 | |
| 31 | if (vm->GetEnv((void **) &env, JNI_VERSION_1_4) != JNI_OK) { |
| 32 | return JNI_ERR; |
| 33 | } |
| 34 | |
Brian Muramatsu | 8c005b3 | 2010-07-07 16:43:01 -0700 | [diff] [blame] | 35 | if (register_android_os_cts_CpuFeatures(env)) { |
| 36 | return JNI_ERR; |
| 37 | } |
Brian Muramatsu | 8c005b3 | 2010-07-07 16:43:01 -0700 | [diff] [blame] | 38 | |
Rom Lemarchand | 762312d | 2014-02-11 10:59:15 -0800 | [diff] [blame] | 39 | if (register_android_os_cts_TaggedPointer(env)) { |
| 40 | return JNI_ERR; |
| 41 | } |
| 42 | |
Nick Kralevich | a948d73 | 2013-05-10 11:06:47 -0700 | [diff] [blame] | 43 | if (register_android_os_cts_OSFeatures(env)) { |
| 44 | return JNI_ERR; |
| 45 | } |
| 46 | |
Brian Muramatsu | b33836e | 2011-04-19 11:35:22 -0700 | [diff] [blame] | 47 | if (register_android_os_cts_FileUtils(env)) { |
Brian Muramatsu | 328dfec | 2011-05-02 15:13:01 -0700 | [diff] [blame] | 48 | return JNI_ERR; |
| 49 | } |
| 50 | |
Brian Muramatsu | 8c005b3 | 2010-07-07 16:43:01 -0700 | [diff] [blame] | 51 | return JNI_VERSION_1_4; |
| 52 | } |