Merge "Fix coretests: Remove dependency on libnativehelper" am: f68cb55cc1

am: 6a5e1a7f4a

Change-Id: I096fb9b30c2e11bf7054aefa1bd3deb6974a9d36
This commit is contained in:
Dimitry Ivanov
2016-11-17 18:57:58 +00:00
committed by android-build-merger
2 changed files with 4 additions and 23 deletions

View File

@@ -19,8 +19,7 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
com_android_frameworks_coretests_JNITest.cpp
LOCAL_SHARED_LIBRARIES := \
libnativehelper
LOCAL_SDK_VERSION := 16
LOCAL_CFLAGS += -Wall -Werror

View File

@@ -14,41 +14,23 @@
* limitations under the License.
*/
#include "nativehelper/JNIHelp.h"
#include <jni.h>
namespace android {
static jint checkFunction(JNIEnv*, jclass) {
extern "C" JNIEXPORT
jint JNICALL Java_com_android_frameworks_coretests_JNITests_checkFunction(JNIEnv*, jclass) {
return 1;
}
static const JNINativeMethod sMethods[] = {
/* name, signature, funcPtr */
{ "checkFunction", "()I", (void*) checkFunction },
};
int register_com_android_frameworks_coretests_JNITests(JNIEnv* env) {
return jniRegisterNativeMethods(env, "com/android/frameworks/coretests/JNITests", sMethods,
NELEM(sMethods));
}
}
/*
* JNI Initialization
*/
jint JNI_OnLoad(JavaVM *jvm, void */* reserved */) {
JNIEnv *e;
int status;
// Check JNI version
if (jvm->GetEnv((void **) &e, JNI_VERSION_1_6)) {
return JNI_ERR;
}
if ((status = android::register_com_android_frameworks_coretests_JNITests(e)) < 0) {
return JNI_ERR;
}
return JNI_VERSION_1_6;
}