From 645a0424817091275a041e442577b0979d9c6eca Mon Sep 17 00:00:00 2001 From: Andy2 Date: Thu, 28 Oct 2010 18:46:28 -0700 Subject: [PATCH] add room name to callback used when device connects: fix jni to compile --- xwords4/android/XWords4/jni/xportwrapper.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xwords4/android/XWords4/jni/xportwrapper.c b/xwords4/android/XWords4/jni/xportwrapper.c index 417a4dc07..0c53fbba6 100644 --- a/xwords4/android/XWords4/jni/xportwrapper.c +++ b/xwords4/android/XWords4/jni/xportwrapper.c @@ -95,16 +95,19 @@ and_xport_relayStatus( void* closure, CommsRelayState newState ) } static void -and_xport_relayConnd( void* closure, XP_Bool allHere, XP_U16 nMissing ) +and_xport_relayConnd( void* closure, XP_UCHAR* const room, + XP_Bool allHere, XP_U16 nMissing ) { AndTransportProcs* aprocs = (AndTransportProcs*)closure; if ( NULL != aprocs->jxport ) { JNIEnv* env = *aprocs->envp; - const char* sig = "(ZI)V"; + const char* sig = "(Ljava/lang/String;ZI)V"; jmethodID mid = getMethodID( env, aprocs->jxport, "relayConnd", sig ); + jstring str = (*env)->NewStringUTF( env, room ); (*env)->CallVoidMethod( env, aprocs->jxport, mid, - allHere, nMissing ); + str, allHere, nMissing ); + (*env)->DeleteLocalRef( env, str ); } }