From d4bfaca127593d7513bd02a2ffe3b49fe2a84db1 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 14 Jun 2015 22:39:47 -0700 Subject: [PATCH] cleanup: mostly removing logging and wrapping rematch code in an if(false) so it goes away. --- xwords4/android/XWords4/jni/utilwrapper.c | 4 - .../eehouse/android/xw4/BoardDelegate.java | 59 +++++++------ .../eehouse/android/xw4/CommsTransport.java | 2 - .../src/org/eehouse/android/xw4/DBHelper.java | 1 - .../src/org/eehouse/android/xw4/DBUtils.java | 29 +++---- .../org/eehouse/android/xw4/DlgDelegate.java | 3 +- .../eehouse/android/xw4/DwnldDelegate.java | 1 - .../android/xw4/GameConfigActivity.java | 6 +- .../org/eehouse/android/xw4/GameUtils.java | 4 +- .../android/xw4/GamesListActivity.java | 6 +- .../android/xw4/GamesListDelegate.java | 84 ++++++++----------- .../eehouse/android/xw4/NetLaunchInfo.java | 19 +++-- .../eehouse/android/xw4/NetStateCache.java | 7 +- .../eehouse/android/xw4/RelayReceiver.java | 2 - .../org/eehouse/android/xw4/RelayService.java | 6 +- .../org/eehouse/android/xw4/SMSReceiver.java | 10 +-- .../android/xw4/XWConnAddrPreference.java | 1 - .../eehouse/android/xw4/jni/GameSummary.java | 21 +++-- .../eehouse/android/xw4/jni/UtilCtxtImpl.java | 2 - 19 files changed, 119 insertions(+), 148 deletions(-) diff --git a/xwords4/android/XWords4/jni/utilwrapper.c b/xwords4/android/XWords4/jni/utilwrapper.c index bbe03769b..ed100cf5e 100644 --- a/xwords4/android/XWords4/jni/utilwrapper.c +++ b/xwords4/android/XWords4/jni/utilwrapper.c @@ -431,12 +431,9 @@ and_util_getUserString( XW_UtilCtxt* uc, XP_U16 stringCode ) return result; } -/* FIXME: This will always return the same string, ignoring quantity all but - the first time (because of util->userStrings) */ static const XP_UCHAR* and_util_getUserQuantityString( XW_UtilCtxt* uc, XP_U16 stringCode, XP_U16 quantity ) { - LOG_FUNC(); XP_UCHAR* result = ""; UTIL_CBK_HEADER("getUserQuantityString", "(II)Ljava/lang/String;" ); int index = stringCode - 1; /* see LocalizedStrIncludes.h */ @@ -478,7 +475,6 @@ and_util_getUserQuantityString( XW_UtilCtxt* uc, XP_U16 stringCode, XP_U16 quant result = ptrs[indx]; UTIL_CBK_TAIL(); - LOG_RETURNF( "%s", result ); return result; } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java index e3bb34bf0..433ddff02 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java @@ -1385,8 +1385,6 @@ public class BoardDelegate extends DelegateBase private void handleConndMessage( String room, int devOrder, // <- hostID boolean allHere, int nMissing ) { - DbgUtils.logf( "BoardDelegate.handleConndMessage(): nMissing = %d", nMissing ); - dismissInviteAlert( nMissing, true ); int naMsg = 0; @@ -1732,8 +1730,8 @@ public class BoardDelegate extends DelegateBase { m_connTypes = connTypes; Assert.assertTrue( isServer || 0 == nMissing ); - DbgUtils.logf( "BoardDelegate.informMissing(isServer=%b, nDevs=%d, nMissing=%d)", - isServer, nDevs, nMissing ); + // DbgUtils.logf( "BoardDelegate.informMissing(isServer=%b, nDevs=%d, nMissing=%d)", + // isServer, nDevs, nMissing ); m_nGuestDevs = nDevs; // If we might have put up an alert earlier, take it down @@ -1891,7 +1889,6 @@ public class BoardDelegate extends DelegateBase m_gi = new CurGameInfo( m_activity ); m_gi.setName( gameName ); XwJNI.gi_from_stream( m_gi, stream ); - DbgUtils.logf( "BoardDelegate:after loadGame: gi.nPlayers: %d", m_gi.nPlayers ); String langName = m_gi.langName(); m_summary = DBUtils.getSummary( m_activity, m_gameLock ); @@ -2443,39 +2440,41 @@ public class BoardDelegate extends DelegateBase private void doRematch() { - String phone = null; - String btAddr = null; - String relayID = null; - if ( m_gi.serverRole != DeviceRole.SERVER_STANDALONE ) { - CommsAddrRec[] addrs = XwJNI.comms_getAddrs( m_jniGamePtr ); - for ( CommsAddrRec addr : addrs ) { - if ( addr.contains( CommsConnType.COMMS_CONN_BT ) ) { - Assert.assertNull( btAddr ); - btAddr = addr.bt_btAddr; - } - if ( addr.contains( CommsConnType.COMMS_CONN_SMS ) ) { - Assert.assertNull( phone ); - phone = addr.sms_phone; - } - if ( addr.contains( CommsConnType.COMMS_CONN_RELAY ) ) { - Assert.assertNull( relayID ); - relayID = m_summary.relayID; + if ( XWApp.REMATCH_SUPPORTED ) { + String phone = null; + String btAddr = null; + String relayID = null; + if ( m_gi.serverRole != DeviceRole.SERVER_STANDALONE ) { + CommsAddrRec[] addrs = XwJNI.comms_getAddrs( m_jniGamePtr ); + for ( CommsAddrRec addr : addrs ) { + if ( addr.contains( CommsConnType.COMMS_CONN_BT ) ) { + Assert.assertNull( btAddr ); + btAddr = addr.bt_btAddr; + } + if ( addr.contains( CommsConnType.COMMS_CONN_SMS ) ) { + Assert.assertNull( phone ); + phone = addr.sms_phone; + } + if ( addr.contains( CommsConnType.COMMS_CONN_RELAY ) ) { + Assert.assertNull( relayID ); + relayID = m_summary.relayID; + } } } - } - Intent intent = GamesListDelegate - .makeRematchIntent( m_activity, m_rowid, m_connTypes, btAddr, - phone, relayID ); - if ( null != intent ) { - startActivity( intent ); - finish(); + Intent intent = GamesListDelegate + .makeRematchIntent( m_activity, m_rowid, m_connTypes, btAddr, + phone, relayID ); + if ( null != intent ) { + startActivity( intent ); + finish(); + } } } private void tryRematchInvites() { - if ( !m_rematchInvitesSent ) { + if ( XWApp.REMATCH_SUPPORTED && !m_rematchInvitesSent ) { m_rematchInvitesSent = true; Assert.assertNotNull( m_summary ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/CommsTransport.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/CommsTransport.java index 2ea8daf37..596be5745 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/CommsTransport.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/CommsTransport.java @@ -453,8 +453,6 @@ public class CommsTransport implements TransportProcs, Assert.fail(); break; } - DbgUtils.logf( "sendForAddr(addr=%s)=>%d", conType.toString(), - nSent ); return nSent; } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBHelper.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBHelper.java index 7f3b657ef..e9b02e756 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBHelper.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBHelper.java @@ -60,7 +60,6 @@ public class DBHelper extends SQLiteOpenHelper { public static final String GAMEID = "GAMEID"; public static final String REMOTEDEVS = "REMOTEDEVS"; public static final String EXTRAS = "EXTRAS"; - public static final String JSON_EXTRAS = "JSON_EXTRAS"; public static final String DICTLANG = "DICTLANG"; public static final String DICTLIST = "DICTLIST"; public static final String HASMSGS = "HASMSGS"; diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java index d0c85587f..05d710ef5 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java @@ -373,19 +373,21 @@ public class DBUtils { public static void addRematchInfo( Context context, long rowid, String btAddr, String phone, String relayID ) { - GameLock lock = new GameLock( rowid, true ).lock(); - GameSummary summary = getSummary( context, lock ); - if ( null != btAddr ) { - summary.putStringExtra( GameSummary.EXTRA_REMATCH_BTADDR, btAddr ); + if ( XWApp.REMATCH_SUPPORTED ) { + GameLock lock = new GameLock( rowid, true ).lock(); + GameSummary summary = getSummary( context, lock ); + if ( null != btAddr ) { + summary.putStringExtra( GameSummary.EXTRA_REMATCH_BTADDR, btAddr ); + } + if ( null != phone ) { + summary.putStringExtra( GameSummary.EXTRA_REMATCH_PHONE, phone ); + } + if ( null != relayID ) { + summary.putStringExtra( GameSummary.EXTRA_REMATCH_RELAY, relayID ); + } + saveSummary( context, lock, summary ); + lock.unlock(); } - if ( null != phone ) { - summary.putStringExtra( GameSummary.EXTRA_REMATCH_PHONE, phone ); - } - if ( null != relayID ) { - summary.putStringExtra( GameSummary.EXTRA_REMATCH_RELAY, relayID ); - } - saveSummary( context, lock, summary ); - lock.unlock(); } public static int countGamesUsingLang( Context context, int lang ) @@ -718,7 +720,7 @@ public class DBUtils { cursor.close(); db.close(); } - DbgUtils.logf( "getMostRecentCreate(%d) => %H", gameID, result ); + return result; } @@ -763,7 +765,6 @@ public class DBUtils { long[][] rowIDss = new long[1][]; String[] relayIDs = getRelayIDs( context, rowIDss ); boolean result = null != relayIDs && 0 < relayIDs.length; - DbgUtils.logf( "haveRelayGames() => %b", result ); return result; } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java index 698341e4c..2524c0603 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java @@ -194,8 +194,7 @@ public class DlgDelegate { protected void showDialog( DlgID dlgID ) { if ( !m_activity.isFinishing() ) { - int id = dlgID.ordinal(); - m_activity.showDialog( id ); + m_activity.showDialog( dlgID.ordinal() ); } } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DwnldDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DwnldDelegate.java index f2a8ab6f2..872faff6e 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DwnldDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DwnldDelegate.java @@ -67,7 +67,6 @@ public class DwnldDelegate extends ListDelegateBase { public interface OnGotLcDictListener { void gotDictInfo( boolean success, String lc, String name ); - } public DwnldDelegate( ListDelegator delegator, Bundle savedInstanceState ) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfigActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfigActivity.java index 394153f9a..1a722438c 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfigActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfigActivity.java @@ -24,12 +24,10 @@ import android.os.Bundle; public class GameConfigActivity extends XWActivity { - private GameConfigDelegate m_dlgt; - @Override public void onCreate( Bundle savedInstanceState ) { - m_dlgt = new GameConfigDelegate( this, savedInstanceState ); - super.onCreate( savedInstanceState, m_dlgt ); + super.onCreate( savedInstanceState, + new GameConfigDelegate( this, savedInstanceState ) ); } // onCreate } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java index 952c17833..32bcef305 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java @@ -601,9 +601,9 @@ public class GameUtils { public static void launchEmailInviteActivity( Activity activity, NetLaunchInfo nli ) { - DbgUtils.logf( "launchEmailInviteActivity: nli=%s", nli.makeLaunchJSON() ); + // DbgUtils.logf( "launchEmailInviteActivity: nli=%s", nli.makeLaunchJSON() ); Uri gameUri = nli.makeLaunchUri( activity ); - DbgUtils.logf( "launchEmailInviteActivity: uri=%s", gameUri ); + // DbgUtils.logf( "launchEmailInviteActivity: uri=%s", gameUri ); String msgString = null == gameUri ? null : gameUri.toString(); if ( null != msgString ) { diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListActivity.java index c1b747414..06c3eb169 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListActivity.java @@ -48,9 +48,9 @@ public class GamesListActivity extends XWListActivity { // Trying to debug situation where two of this activity are running at // once. finish()ing when Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT is // passed is not the fix, but perhaps there's another - int flags = getIntent().getFlags(); - DbgUtils.logf( "GamesListActivity.onCreate(this=%H): flags=0x%x", - this, flags ); + // int flags = getIntent().getFlags(); + // DbgUtils.logf( "GamesListActivity.onCreate(this=%H): flags=0x%x", + // this, flags ); } // onCreate // called when we're brought to the front (probably as a result of diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java index fa44989c3..3d28f99f0 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java @@ -1847,28 +1847,30 @@ public class GamesListDelegate extends ListDelegateBase // used to connect. private void startRematch( Intent intent ) { - long rowid = intent.getLongExtra( REMATCH_ROWID_EXTRA, -1 ); - if ( XWApp.REMATCH_SUPPORTED && -1 != rowid ) { - String btAddr = intent.getStringExtra( REMATCH_BTADDR_EXTRA ); - String phone = intent.getStringExtra( REMATCH_PHONE_EXTRA ); - String relayID = intent.getStringExtra( REMATCH_RELAYID_EXTRA ); - long newid; - if ( null == btAddr && null == phone && null == relayID ) { - // this will juggle if the preference is set - newid = GameUtils.dupeGame( m_activity, rowid ); - } else { - int bits = intent.getIntExtra( REMATCH_ADDRS_EXTRA, -1 ); - CommsConnTypeSet addrs = new CommsConnTypeSet( bits ); + if ( XWApp.REMATCH_SUPPORTED ) { + long rowid = intent.getLongExtra( REMATCH_ROWID_EXTRA, -1 ); + if ( -1 != rowid ) { + String btAddr = intent.getStringExtra( REMATCH_BTADDR_EXTRA ); + String phone = intent.getStringExtra( REMATCH_PHONE_EXTRA ); + String relayID = intent.getStringExtra( REMATCH_RELAYID_EXTRA ); + long newid; + if ( null == btAddr && null == phone && null == relayID ) { + // this will juggle if the preference is set + newid = GameUtils.dupeGame( m_activity, rowid ); + } else { + int bits = intent.getIntExtra( REMATCH_ADDRS_EXTRA, -1 ); + CommsConnTypeSet addrs = new CommsConnTypeSet( bits ); - long groupID = DBUtils.getGroupForGame( m_activity, rowid ); - String gameName = "rematch"; // FIX ME :-) - newid = GameUtils.makeNewMultiGame( m_activity, groupID, addrs, - gameName ); + long groupID = DBUtils.getGroupForGame( m_activity, rowid ); + String gameName = "rematch"; // FIX ME :-) + newid = GameUtils.makeNewMultiGame( m_activity, groupID, + addrs, gameName ); - DBUtils.addRematchInfo( m_activity, newid, btAddr, phone, - relayID ); + DBUtils.addRematchInfo( m_activity, newid, btAddr, phone, + relayID ); + } + launchGame( newid ); } - launchGame( newid ); } } @@ -2104,12 +2106,6 @@ public class GamesListDelegate extends ListDelegateBase launchGame( rowid, true ); } - // private void makeNewBTGame( NetLaunchInfo nli ) - // { - // long rowid = GameUtils.makeNewBTGame( m_activity, nli ); - // launchGame( rowid, true ); - // } - private void tryStartsFromIntent( Intent intent ) { startFirstHasDict( intent ); @@ -2128,17 +2124,6 @@ public class GamesListDelegate extends ListDelegateBase if ( summary.conTypes.contains( CommsAddrRec.CommsConnType.COMMS_CONN_RELAY ) && summary.roomName.length() == 0 ) { Assert.fail(); - // If it's unconfigured and of the type RelayGameActivity - // can handle send it there, otherwise use the full-on - // config. - // Class clazz; - - // if ( RelayGameDelegate.isSimpleGame( summary ) ) { - // clazz = RelayGameActivity.class; - // } else { - // clazz = GameConfigActivity.class; - // } - // GameUtils.doConfig( m_activity, rowid, clazz ); } else { if ( checkWarnNoDict( rowid ) ) { launchGame( rowid ); @@ -2273,18 +2258,21 @@ public class GamesListDelegate extends ListDelegateBase String btAddr, String phone, String relayID ) { - DbgUtils.logf( "makeRematchIntent(btAddr=%s; phone=%s)", btAddr, phone ); - Intent intent = makeSelfIntent( context ); - intent.putExtra( REMATCH_ROWID_EXTRA, rowid ); - intent.putExtra( REMATCH_ADDRS_EXTRA, addrTypes.toInt() ); - if ( null != btAddr ) { - intent.putExtra( REMATCH_BTADDR_EXTRA, btAddr ); - } - if ( null != phone ) { - intent.putExtra( REMATCH_PHONE_EXTRA, phone ); - } - if ( null != relayID ) { - intent.putExtra( REMATCH_RELAYID_EXTRA, relayID ); + Intent intent = null; + if ( XWApp.REMATCH_SUPPORTED ) { + DbgUtils.logf( "makeRematchIntent(btAddr=%s; phone=%s)", btAddr, phone ); + intent = makeSelfIntent( context ); + intent.putExtra( REMATCH_ROWID_EXTRA, rowid ); + intent.putExtra( REMATCH_ADDRS_EXTRA, addrTypes.toInt() ); + if ( null != btAddr ) { + intent.putExtra( REMATCH_BTADDR_EXTRA, btAddr ); + } + if ( null != phone ) { + intent.putExtra( REMATCH_PHONE_EXTRA, phone ); + } + if ( null != relayID ) { + intent.putExtra( REMATCH_RELAYID_EXTRA, relayID ); + } } return intent; } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetLaunchInfo.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetLaunchInfo.java index c1e74d866..26b7bb712 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetLaunchInfo.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetLaunchInfo.java @@ -235,7 +235,7 @@ public class NetLaunchInfo { this( gi ); for ( CommsConnType typ : summary.conTypes.getTypes() ) { - DbgUtils.logf( "NetLaunchInfo(): got type %s", typ.toString() ); + // DbgUtils.logf( "NetLaunchInfo(): got type %s", typ.toString() ); switch( typ ) { case COMMS_CONN_BT: addBTInfo(); @@ -268,7 +268,7 @@ public class NetLaunchInfo { String result = m_inviteID; if ( null == result ) { result = GameUtils.formatGameID( m_gameID ); - DbgUtils.logf( "inviteID(): m_inviteID null so substituting %s", result ); + // DbgUtils.logf( "inviteID(): m_inviteID null so substituting %s", result ); } return result; } @@ -279,7 +279,7 @@ public class NetLaunchInfo { if ( 0 == result ) { Assert.assertNotNull( m_inviteID ); result = Integer.parseInt( m_inviteID, 16 ); - DbgUtils.logf( "gameID(): m_gameID -1 so substituting %d", result ); + // DbgUtils.logf( "gameID(): m_gameID -1 so substituting %d", result ); m_gameID = result; } Assert.assertTrue( 0 != result ); @@ -465,10 +465,11 @@ public class NetLaunchInfo { } Uri result = ub.build(); - // Now test - DbgUtils.logf( "testing %s...", result.toString() ); - NetLaunchInfo instance = new NetLaunchInfo( context, result ); - Assert.assertTrue( instance.isValid() ); + if ( BuildConfig.DEBUG ) { // Test... + DbgUtils.logf( "testing %s...", result.toString() ); + NetLaunchInfo instance = new NetLaunchInfo( context, result ); + Assert.assertTrue( instance.isValid() ); + } return result; } @@ -505,7 +506,7 @@ public class NetLaunchInfo { public boolean isValid() { - DbgUtils.logf( "NetLaunchInfo(%s).isValid() => %b", toString(), m_valid ); + // DbgUtils.logf( "NetLaunchInfo(%s).isValid() => %b", toString(), m_valid ); return m_valid; } @@ -531,7 +532,7 @@ public class NetLaunchInfo { private void calcValid() { boolean valid = hasCommon() && null != m_addrs; - DbgUtils.logf( "calcValid(%s)", toString() ); + // DbgUtils.logf( "calcValid(%s)", toString() ); if ( valid ) { for ( Iterator iter = m_addrs.iterator(); valid && iter.hasNext(); ) { diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetStateCache.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetStateCache.java index 181f4da2d..6dd49af74 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetStateCache.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetStateCache.java @@ -101,8 +101,8 @@ public class NetStateCache { NetworkInfo ni = connMgr.getActiveNetworkInfo(); s_netAvail = ni != null && ni.isAvailable() && ni.isConnected(); - DbgUtils.logf( "NetStateCache.initIfNot(): set s_netAvail = %b", - s_netAvail ); + // DbgUtils.logf( "NetStateCache.initIfNot(): set s_netAvail = %b", + // s_netAvail ); s_receiver = new PvtBroadcastReceiver(); IntentFilter filter = new IntentFilter(); @@ -132,7 +132,6 @@ public class NetStateCache { @Override public void onReceive( final Context context, Intent intent ) { - DbgUtils.logf( "NetStateCache.onReceive()" ); DbgUtils.assertOnUIThread(); if ( intent.getAction(). @@ -159,8 +158,6 @@ public class NetStateCache { if ( s_netAvail != netAvail ) { s_netAvail = netAvail; // keep current in case we're asked - DbgUtils.logf( "NetStateCache.onReceive(): set s_netAvail" - + " = %b", s_netAvail ); // We want to wait for WAIT_STABLE_MILLIS of inactivity // before informing listeners. So each time there's a diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/RelayReceiver.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/RelayReceiver.java index 608ea875c..7bb8bd05f 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/RelayReceiver.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/RelayReceiver.java @@ -43,7 +43,6 @@ public class RelayReceiver extends BroadcastReceiver { public static void setTimer( Context context, long interval_millis ) { - DbgUtils.logf( "RelayReceiver.restartTimer(%d)", interval_millis ); AlarmManager am = (AlarmManager)context.getSystemService( Context.ALARM_SERVICE ); @@ -56,7 +55,6 @@ public class RelayReceiver extends BroadcastReceiver { long fire_millis = SystemClock.elapsedRealtime() + interval_millis; am.set( AlarmManager.ELAPSED_REALTIME_WAKEUP, fire_millis, pi ); } else { - DbgUtils.logf( "RelayReceiver.restartTimer(): cancelling" ); // will happen if user's set getProxyIntervalSeconds to return 0 am.cancel( pi ); } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/RelayService.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/RelayService.java index 36ca20402..459050853 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/RelayService.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/RelayService.java @@ -588,7 +588,7 @@ public class RelayService extends XWService if ( !skipAck ) { sendAckIf( header ); } - DbgUtils.logf( "RelayService.gotPacket: cmd=%s", header.m_cmd.toString() ); + // DbgUtils.logf( "RelayService.gotPacket: cmd=%s", header.m_cmd.toString() ); switch ( header.m_cmd ) { case XWPDEV_UNAVAIL: int unavail = dis.readInt(); @@ -614,8 +614,8 @@ public class RelayService extends XWService case XWPDEV_REGRSP: str = getVLIString( dis ); short maxIntervalSeconds = dis.readShort(); - DbgUtils.logf( "got relayid %s, maxInterval %d", str, - maxIntervalSeconds ); + // DbgUtils.logf( "got relayid %s, maxInterval %d", str, + // maxIntervalSeconds ); setMaxIntervalSeconds( maxIntervalSeconds ); XWPrefs.setRelayDevID( this, str ); s_registered = true; diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/SMSReceiver.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/SMSReceiver.java index f7adc6303..21c009f48 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/SMSReceiver.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/SMSReceiver.java @@ -43,13 +43,11 @@ public class SMSReceiver extends BroadcastReceiver { for ( int ii = 0; ii < pdus.length; ++ii ) { SmsMessage sms = SmsMessage.createFromPdu((byte[])pdus[ii]); - if ( null == sms ) { - continue; + if ( null != sms ) { + String phone = sms.getOriginatingAddress(); + byte[] body = sms.getUserData(); + SMSService.handleFrom( context, body, phone ); } - - String phone = sms.getOriginatingAddress(); - byte[] body = sms.getUserData(); - SMSService.handleFrom( context, body, phone ); } } } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWConnAddrPreference.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWConnAddrPreference.java index 94740fe95..f4fd77d26 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWConnAddrPreference.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWConnAddrPreference.java @@ -87,7 +87,6 @@ public class XWConnAddrPreference extends DialogPreference { public void onClick( DialogInterface dialog, int which ) { if ( AlertDialog.BUTTON_POSITIVE == which ) { - DbgUtils.logf( "ok pressed" ); CommsConnTypeSet curSet = m_view.getTypes(); XWPrefs.setAddrTypes( m_context, curSet ); setSummary( curSet.toString( m_context ) ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/GameSummary.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/GameSummary.java index d82e8dec0..11117d820 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/GameSummary.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/GameSummary.java @@ -30,6 +30,7 @@ import org.json.JSONObject; import org.eehouse.android.xw4.DbgUtils; import org.eehouse.android.xw4.R; import org.eehouse.android.xw4.Utils; +import org.eehouse.android.xw4.XWApp; import org.eehouse.android.xw4.jni.CommsAddrRec.CommsConnType; import org.eehouse.android.xw4.jni.CommsAddrRec.CommsConnTypeSet; import org.eehouse.android.xw4.jni.CurGameInfo.DeviceRole; @@ -429,17 +430,19 @@ public class GameSummary { public boolean hasRematchInfo() { boolean found = false; - String[] keys = { EXTRA_REMATCH_BTADDR, - EXTRA_REMATCH_PHONE, - EXTRA_REMATCH_RELAY, - }; - for ( String key : keys ) { - found = null != getStringExtra( key ); - if ( found ) { - break; + if ( XWApp.REMATCH_SUPPORTED ) { + String[] keys = { EXTRA_REMATCH_BTADDR, + EXTRA_REMATCH_PHONE, + EXTRA_REMATCH_RELAY, + }; + for ( String key : keys ) { + found = null != getStringExtra( key ); + if ( found ) { + break; + } } + DbgUtils.logf( "hasRematchInfo() => %b", found ); } - DbgUtils.logf( "hasRematchInfo() => %b", found ); return found; } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/UtilCtxtImpl.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/UtilCtxtImpl.java index 2959f8886..0152fcce2 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/UtilCtxtImpl.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/UtilCtxtImpl.java @@ -234,7 +234,6 @@ public class UtilCtxtImpl implements UtilCtxt { if ( 0 != pluralsId ) { result = LocUtils.getQuantityString( m_context, pluralsId, quantity ); } - DbgUtils.logf( "UtilCtxtImpl.getUserQuantityString() => %s", result ); return result; } @@ -303,7 +302,6 @@ public class UtilCtxtImpl implements UtilCtxt { { Assert.assertTrue( XWApp.SMSSUPPORTED ); boolean same = PhoneNumberUtils.compare( m_context, num1, num2 ); - DbgUtils.logf( "phoneNumbersSame => %b", same ); return same; }