pass additional param into java world so don't show toast every time connect to relay

This commit is contained in:
Eric House 2013-07-07 13:31:49 -07:00
parent 923d41e0ee
commit e9615cb154
5 changed files with 22 additions and 16 deletions

View file

@ -112,12 +112,12 @@ and_xport_relayConnd( void* closure, XP_UCHAR* const room, XP_Bool reconnect,
AndTransportProcs* aprocs = (AndTransportProcs*)closure;
if ( NULL != aprocs->jxport ) {
JNIEnv* env = *aprocs->envp;
const char* sig = "(Ljava/lang/String;IZI)V";
const char* sig = "(Ljava/lang/String;ZIZI)V";
jmethodID mid = getMethodID( env, aprocs->jxport, "relayConnd", sig );
jstring str = (*env)->NewStringUTF( env, room );
(*env)->CallVoidMethod( env, aprocs->jxport, mid,
str, devOrder, allHere, nMissing );
str, reconnect, devOrder, allHere, nMissing );
deleteLocalRef( env, str );
}
}

View file

@ -1030,14 +1030,17 @@ public class BoardActivity extends XWActivity
// TransportProcs.TPMsgHandler interface
//////////////////////////////////////////////////
public void tpmRelayConnd( final String room, final int devOrder,
final boolean allHere, final int nMissing )
public void tpmRelayConnd( final String room, boolean isReconnect,
final int devOrder, final boolean allHere,
final int nMissing )
{
post( new Runnable() {
public void run() {
handleConndMessage( room, devOrder, allHere, nMissing );
}
} );
if ( !isReconnect ) {
post( new Runnable() {
public void run() {
handleConndMessage( room, devOrder, allHere, nMissing );
}
} );
}
}
public void tpmRelayErrorProc( TransportProcs.XWRELAY_ERROR relayErr )

View file

@ -435,10 +435,11 @@ public class CommsTransport implements TransportProcs,
}
}
public void relayConnd( String room, int devOrder, boolean allHere,
int nMissing )
public void relayConnd( String room, boolean isReconnect, int devOrder,
boolean allHere, int nMissing )
{
m_tpHandler.tpmRelayConnd( room, devOrder, allHere, nMissing );
m_tpHandler.tpmRelayConnd( room, isReconnect, devOrder, allHere,
nMissing );
}
public void relayErrorProc( XWRELAY_ERROR relayErr )

View file

@ -48,8 +48,8 @@ public class MultiMsgSink implements TransportProcs {
{
}
public void relayConnd( String room, int devOrder, boolean allHere,
int nMissing )
public void relayConnd( String room, boolean isReconnect, int devOrder,
boolean allHere, int nMissing )
{
}

View file

@ -37,7 +37,8 @@ public interface TransportProcs {
};
void relayStatus( CommsRelayState newState );
void relayConnd( String room, int devOrder, boolean allHere, int nMissing );
void relayConnd( String room, boolean isReconnect, int devOrder,
boolean allHere, int nMissing );
public static enum XWRELAY_ERROR { NONE
,OLDFLAGS
@ -61,7 +62,8 @@ public interface TransportProcs {
boolean relayNoConnProc( byte[] buf, String relayID );
public interface TPMsgHandler {
public void tpmRelayConnd( String room, int devOrder, boolean allHere,
public void tpmRelayConnd( String room, boolean isReconnect,
int devOrder, boolean allHere,
int nMissing );
public void tpmRelayErrorProc( XWRELAY_ERROR relayErr );
}