Commit e4e8073e authored by Larry Sachs's avatar Larry Sachs Committed by Rick Bell

Fix for Random Pin Callback

Need to ensure thread was attached and CallVoidMethod().

Change-Id: I0b3e6fb2a281eccd7b02ba173b5aef0b20919210
Signed-off-by: Larry Sachs's avatarLarry Sachs <larry.j.sachs@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/29431Tested-by: default avatarIoTivity Jenkins <jenkins-daemon@iotivity.org>
Reviewed-by: George Nash's avatarGeorge Nash <george.nash@intel.com>
Reviewed-by: default avatarRick Bell <richard.s.bell@intel.com>
parent 3d014341
......@@ -488,6 +488,8 @@ void jni_oc_random_pin_callback(const unsigned char *pin, size_t pin_len, void *
{
OC_DBG("JNI: %s\n", __func__);
jni_callback_data *data = (jni_callback_data *)user_data;
jint getEnvResult = 0;
data->jenv = GetJNIEnv(&getEnvResult);
assert(cls_OCRandomPinHandler);
const jmethodID mid_handler = JCALL3(GetMethodID,
......@@ -498,9 +500,9 @@ void jni_oc_random_pin_callback(const unsigned char *pin, size_t pin_len, void *
assert(mid_handler);
jstring jpin = JCALL1(NewStringUTF, (data->jenv), (const char *)pin);
JCALL3(CallVoidMethod, (data->jenv), data->jcb_obj, mid_handler, jpin);
/* TODO convert pin to java string */
JCALL3(CallObjectMethod, (data->jenv), data->jcb_obj, mid_handler, jpin);
ReleaseJNIEnv(getEnvResult);
}
%}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment