cleanup and asserts

This commit is contained in:
Eric House 2022-05-13 18:05:01 -07:00
parent 2937aed7e1
commit 90eabd45c0
3 changed files with 10 additions and 1 deletions

View file

@ -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();

View file

@ -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 ) );

View file

@ -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