Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a5e1a7f authored by Dimitry Ivanov's avatar Dimitry Ivanov Committed by android-build-merger
Browse files

Merge "Fix coretests: Remove dependency on libnativehelper"

am: f68cb55c

Change-Id: I06e1b8acbe6772ea80bb9c6ab6704e6ce678c3cc
parents d771b369 f68cb55c
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -19,8 +19,7 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
LOCAL_SRC_FILES := \
    com_android_frameworks_coretests_JNITest.cpp
    com_android_frameworks_coretests_JNITest.cpp


LOCAL_SHARED_LIBRARIES := \
LOCAL_SDK_VERSION := 16
    libnativehelper


LOCAL_CFLAGS += -Wall -Werror
LOCAL_CFLAGS += -Wall -Werror


+3 −21
Original line number Original line Diff line number Diff line
@@ -14,41 +14,23 @@
 * limitations under the License.
 * limitations under the License.
 */
 */


#include "nativehelper/JNIHelp.h"
#include <jni.h>


namespace android {
extern "C" JNIEXPORT

jint JNICALL Java_com_android_frameworks_coretests_JNITests_checkFunction(JNIEnv*, jclass) {
static jint checkFunction(JNIEnv*, jclass) {
    return 1;
    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
 * JNI Initialization
 */
 */
jint JNI_OnLoad(JavaVM *jvm, void */* reserved */) {
jint JNI_OnLoad(JavaVM *jvm, void */* reserved */) {
    JNIEnv *e;
    JNIEnv *e;
    int status;


    // Check JNI version
    // Check JNI version
    if (jvm->GetEnv((void **) &e, JNI_VERSION_1_6)) {
    if (jvm->GetEnv((void **) &e, JNI_VERSION_1_6)) {
        return JNI_ERR;
        return JNI_ERR;
    }
    }


    if ((status = android::register_com_android_frameworks_coretests_JNITests(e)) < 0) {
        return JNI_ERR;
    }

    return JNI_VERSION_1_6;
    return JNI_VERSION_1_6;
}
}