From d25e20221ba49bdfff9758c07e82dc3b9571d272 Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 6 Dec 2013 07:39:16 -0800 Subject: [PATCH] update send success status --- .../src/org/eehouse/android/xw4/BTService.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java index 5bc5988de..efa932caa 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java @@ -43,11 +43,12 @@ import java.util.Set; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; -import junit.framework.Assert; - import org.eehouse.android.xw4.MultiService.MultiEvent; +import org.eehouse.android.xw4.jni.CommsAddrRec.CommsConnType; import org.eehouse.android.xw4.jni.CommsAddrRec; +import junit.framework.Assert; + public class BTService extends XWService { private static final long RESEND_TIMEOUT = 5; // seconds @@ -357,6 +358,9 @@ public class BTService extends XWService { DbgUtils.logf( "unexpected msg %d", msg ); break; } + ConnStatusHandler. + updateStatusIn( BTService.this, null, + CommsConnType.COMMS_CONN_BT, true ); } } catch ( java.io.IOException ioe ) { DbgUtils.loge( ioe ); @@ -618,9 +622,15 @@ public class BTService extends XWService { sendInvite( elem ); break; case MESG_SEND: - if ( !doAnyResends( elem.m_addr ) || ! sendMsg( elem ) ) { + boolean success = doAnyResends( elem.m_addr ) + && sendMsg( elem ); + if ( !success ) { addToResends( elem ); } + ConnStatusHandler + .updateStatusOut( BTService.this, null, + CommsConnType.COMMS_CONN_BT, + success ); break; default: Assert.fail();