From 4695619c6384913c1478ea413e60a025696c5961 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 21 Sep 2014 11:35:32 -0700 Subject: [PATCH] refactor: add methods to be called from elsewhere --- .../org/eehouse/android/xw4/BTService.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 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 e508544ee..afbe2bb71 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java @@ -399,9 +399,7 @@ public class BTService extends XWService { DbgUtils.logf( "unexpected msg %d", msg ); break; } - ConnStatusHandler. - updateStatusIn( BTService.this, null, - CommsConnType.COMMS_CONN_BT, true ); + updateStatusIn( true ); } } catch ( IOException ioe ) { DbgUtils.logf( "trying again..." ); @@ -645,10 +643,7 @@ public class BTService extends XWService { if ( !success ) { addToResends( elem ); } - ConnStatusHandler - .updateStatusOut( BTService.this, null, - CommsConnType.COMMS_CONN_BT, - success ); + updateStatusOut( success ); break; default: Assert.fail(); @@ -1025,6 +1020,18 @@ public class BTService extends XWService { body, (int)rowid ); } + private void updateStatusOut( boolean success ) + { + ConnStatusHandler + .updateStatusOut( this, null, CommsConnType.COMMS_CONN_BT, success ); + } + + private void updateStatusIn( boolean success ) + { + ConnStatusHandler + .updateStatusIn( this, null, CommsConnType.COMMS_CONN_BT, success ); + } + private Thread killSocketIn( final BluetoothSocket socket ) { return killSocketIn( socket, 10 );