registration.cpp revision 74c9983e80d8224bbe1de7c37e8f6ac4a76df11d
1/* 2 * Copyright (C) 2016 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 19extern jint android_util_MemoryIntArrayTest_createAshmem(JNIEnv* env, 20 jobject clazz, jstring name, jint size); 21extern void android_util_MemoryIntArrayTest_setAshmemSize(JNIEnv* env, 22 jobject clazz, jint fd, jint size); 23 24extern "C" { 25 JNIEXPORT jint JNICALL Java_android_util_MemoryIntArrayTest_nativeCreateAshmem( 26 JNIEnv * env, jobject obj, jstring name, jint size); 27 JNIEXPORT void JNICALL Java_android_util_MemoryIntArrayTest_nativeSetAshmemSize( 28 JNIEnv * env, jobject obj, jint fd, jint size); 29}; 30 31JNIEXPORT jint JNICALL Java_android_util_MemoryIntArrayTest_nativeCreateAshmem( 32 __attribute__((unused)) JNIEnv * env,__attribute__((unused)) jobject obj, 33 jstring name, jint size) 34{ 35 return android_util_MemoryIntArrayTest_createAshmem(env, obj, name, size); 36} 37 38JNIEXPORT void JNICALL Java_android_util_MemoryIntArrayTest_nativeSetAshmemSize( 39 __attribute__((unused)) JNIEnv * env,__attribute__((unused)) jobject obj, 40 jint fd, jint size) 41{ 42 android_util_MemoryIntArrayTest_setAshmemSize(env, obj, fd, size); 43} 44