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

Fix for Factory Presets Callback

Change-Id: I62bbed3ed2609d5ef6ff73010de9c18c21b81a24
Signed-off-by: Larry Sachs's avatarLarry Sachs <larry.j.sachs@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/29449Tested-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 5b660fd0
......@@ -370,6 +370,8 @@ void jni_oc_factory_presets_callback(size_t device, void *user_data)
{
OC_DBG("JNI: %s\n", __func__);
jni_callback_data *data = (jni_callback_data *)user_data;
jint getEnvResult = 0;
data->jenv = GetJNIEnv(&getEnvResult);
assert(cls_OCFactoryPresetsHandler);
const jmethodID mid_handler = JCALL3(GetMethodID,
......@@ -377,8 +379,11 @@ void jni_oc_factory_presets_callback(size_t device, void *user_data)
cls_OCFactoryPresetsHandler,
"handler",
"(J)V");
assert(mid_handler);
JCALL3(CallObjectMethod, (data->jenv), data->jcb_obj, mid_handler, (jlong)device);
JCALL3(CallVoidMethod, (data->jenv), data->jcb_obj, mid_handler, (jlong)device);
ReleaseJNIEnv(getEnvResult);
}
%}
......@@ -390,7 +395,6 @@ void jni_oc_factory_presets_callback(size_t device, void *user_data)
jni_callback_data *user_data = (jni_callback_data *)malloc(sizeof *user_data);
user_data->jenv = jenv;
user_data->jcb_obj = JCALL1(NewGlobalRef, jenv, $input);
jni_list_add(jni_callbacks, user_data);
$1 = jni_oc_factory_presets_callback;
$2 = user_data;
}
......
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