From 90eabd45c0c4f9f3a80ee6df92ec034852285921 Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 13 May 2022 18:05:01 -0700 Subject: [PATCH] cleanup and asserts --- .../main/java/org/eehouse/android/xw4/BoardDelegate.java | 2 +- .../java/org/eehouse/android/xw4/GamesListDelegate.java | 2 ++ .../java/org/eehouse/android/xw4/jni/CommsAddrRec.java | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java index eb614bbb0..4e818cd41 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java @@ -187,7 +187,7 @@ public class BoardDelegate extends DelegateBase private void alertOrderIncrIfAt( StartAlertOrder ord ) { - Log.d( TAG, "alertOrderIncrIfAt(%s)", ord ); + // Log.d( TAG, "alertOrderIncrIfAt(%s)", ord ); if ( alertOrderAt( ord ) ) { m_mySIS.mAlertOrder = ord.values()[ord.ordinal() + 1]; doNext(); diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java index 93f1bfdc4..61d725453 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java @@ -2511,6 +2511,7 @@ public class GamesListDelegate extends ListDelegateBase { if ( null != gameName && 0 < gameName.length() ) { Bundle extras = m_rematchExtras; + // should default be 0 not -1, which is all bits set ?? PENDING int bits = extras.getInt( REMATCH_ADDRS_EXTRA, -1 ); final CommsConnTypeSet addrs = new CommsConnTypeSet( bits ); boolean hasSMS = addrs.contains( CommsConnType.COMMS_CONN_SMS ); @@ -3084,6 +3085,7 @@ public class GamesListDelegate extends ListDelegateBase .putExtra( REMATCH_NEWNAME_EXTRA, newName ); if ( null != addrTypes ) { + Assert.assertTrueNR( !addrTypes.contains( CommsConnType.COMMS_CONN_RELAY ) ); intent.putExtra( REMATCH_ADDRS_EXTRA, addrTypes.toInt() ); if ( null != btAddr ) { Assert.assertTrue( addrTypes.contains( CommsConnType.COMMS_CONN_BT ) ); diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/CommsAddrRec.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/CommsAddrRec.java index 11decd269..599185c41 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/CommsAddrRec.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/CommsAddrRec.java @@ -26,6 +26,7 @@ import android.text.TextUtils; import org.eehouse.android.xw4.Assert; import org.eehouse.android.xw4.BTUtils; import org.eehouse.android.xw4.BuildConfig; +import org.eehouse.android.xw4.DbgUtils; import org.eehouse.android.xw4.GameUtils; import org.eehouse.android.xw4.Log; import org.eehouse.android.xw4.NFCUtils; @@ -138,6 +139,12 @@ public class CommsAddrRec implements Serializable { int ord = value.ordinal(); if ( 0 != (bits & (1 << (ord - 1)))) { add( value ); + if ( BuildConfig.NON_RELEASE + && CommsConnType.COMMS_CONN_RELAY == value ) { + // I've seen this.... + Log.e( TAG, "still have RELAY bit" ); + DbgUtils.printStack( TAG ); + } } } } else if ( bits < values.length ) { // don't crash