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 <jni.h> 18 #include <stdio.h> 19 20 extern int register_android_security_cts_KernelSettingsTest(JNIEnv*); 21 extern int register_android_security_cts_CharDeviceTest(JNIEnv*); 22 extern int register_android_security_cts_LinuxRngTest(JNIEnv*); 23 extern int register_android_security_cts_NativeCodeTest(JNIEnv*); 24 extern int register_android_security_cts_SELinuxTest(JNIEnv*); 25 extern int register_android_security_cts_SeccompTest(JNIEnv*); 26 extern int register_android_security_cts_MMapExecutableTest(JNIEnv* env); 27 extern int register_android_security_cts_EncryptionTest(JNIEnv* env); 28 29 jint JNI_OnLoad(JavaVM *vm, void *reserved) { 30 JNIEnv *env = NULL; 31 32 if (vm->GetEnv((void **) &env, JNI_VERSION_1_4) != JNI_OK) { 33 return JNI_ERR; 34 } 35 36 if (register_android_security_cts_CharDeviceTest(env)) { 37 return JNI_ERR; 38 } 39 40 if (register_android_security_cts_LinuxRngTest(env)) { 41 return JNI_ERR; 42 } 43 44 if (register_android_security_cts_NativeCodeTest(env)) { 45 return JNI_ERR; 46 } 47 48 if (register_android_security_cts_SELinuxTest(env)) { 49 return JNI_ERR; 50 } 51 52 if (register_android_security_cts_KernelSettingsTest(env)) { 53 return JNI_ERR; 54 } 55 56 if (register_android_security_cts_MMapExecutableTest(env)) { 57 return JNI_ERR; 58 } 59 60 if (register_android_security_cts_EncryptionTest(env)) { 61 return JNI_ERR; 62 } 63 64 return JNI_VERSION_1_4; 65 } 66