Home | History | Annotate | Download | only in jni
      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_MMapExecutableTest(JNIEnv* env);
     26 extern int register_android_security_cts_EncryptionTest(JNIEnv* env);
     27 
     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 
     35     if (register_android_security_cts_CharDeviceTest(env)) {
     36         return JNI_ERR;
     37     }
     38 
     39     if (register_android_security_cts_LinuxRngTest(env)) {
     40         return JNI_ERR;
     41     }
     42 
     43     if (register_android_security_cts_NativeCodeTest(env)) {
     44         return JNI_ERR;
     45     }
     46 
     47     if (register_android_security_cts_SELinuxTest(env)) {
     48         return JNI_ERR;
     49     }
     50 
     51     if (register_android_security_cts_KernelSettingsTest(env)) {
     52         return JNI_ERR;
     53     }
     54 
     55     if (register_android_security_cts_MMapExecutableTest(env)) {
     56         return JNI_ERR;
     57     }
     58 
     59     if (register_android_security_cts_EncryptionTest(env)) {
     60         return JNI_ERR;
     61     }
     62 
     63     return JNI_VERSION_1_4;
     64 }
     65