jni_init.cpp revision 9ced3cd9d6ea414523051ec872fffc68f5fdbf08
19ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk/* 29ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk * Copyright (C) 2013 The Android Open Source Project 39ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk * 49ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk * Licensed under the Apache License, Version 2.0 (the "License"); 59ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk * you may not use this file except in compliance with the License. 69ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk * You may obtain a copy of the License at 79ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk * 89ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk * http://www.apache.org/licenses/LICENSE-2.0 99ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk * 109ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk * Unless required by applicable law or agreed to in writing, software 119ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk * distributed under the License is distributed on an "AS IS" BASIS, 129ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 139ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk * See the License for the specific language governing permissions and 149ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk * limitations under the License. 159ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk */ 169ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk 179ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk#define LOG_TAG "PacProcessor" 189ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk 199ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk#include <utils/Log.h> 209ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk#include "jni.h" 219ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk 229ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monknamespace android { 239ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk extern int register_com_android_pacprocessor_PacNative(JNIEnv *env); 249ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk} 259ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk 269ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monkusing namespace android; 279ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk 289ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monkextern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved) { 299ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk JNIEnv *env; 309ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) { 319ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk ALOGE("ERROR: GetEnv failed"); 329ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk return -1; 339ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk } 349ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk 359ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk register_com_android_pacprocessor_PacNative(env); 369ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk 379ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk return JNI_VERSION_1_6; 389ced3cd9d6ea414523051ec872fffc68f5fdbf08Jason Monk} 39