remove some asserts from non-DEBUG builds

I don't want to be bitten by a default: Assert.fail() again.
This commit is contained in:
Eric House 2020-01-10 15:35:34 -08:00
parent 8291b70842
commit dfb33c01af
42 changed files with 112 additions and 112 deletions

View file

@ -23,9 +23,9 @@ package org.eehouse.android.xw4;
public class Assert { public class Assert {
private static final String TAG = Assert.class.getSimpleName(); private static final String TAG = Assert.class.getSimpleName();
public static void fail() { public static void fail() { assertTrue(false); }
assertTrue(false);
} public static void failDbg() { assertFalse( BuildConfig.DEBUG ); }
public static void assertFalse(boolean val) public static void assertFalse(boolean val)
{ {

View file

@ -496,7 +496,7 @@ public class BTService extends XWJIService {
break; break;
default: default:
Assert.fail(); Assert.failDbg();
} }
} else { } else {
Log.d( TAG, "onHandleWorkImpl(): BT disabled so doing nothing" ); Log.d( TAG, "onHandleWorkImpl(): BT disabled so doing nothing" );
@ -732,7 +732,7 @@ public class BTService extends XWJIService {
mHelper.postEvent( event, dev ); mHelper.postEvent( event, dev );
} }
} catch ( InterruptedException ex ) { } catch ( InterruptedException ex ) {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
} }
@ -1225,7 +1225,7 @@ public class BTService extends XWJIService {
default: default:
Log.e( TAG, "handleReply(cmd=%s) case not handled", cmd ); Log.e( TAG, "handleReply(cmd=%s) case not handled", cmd );
Assert.assertFalse( BuildConfig.DEBUG ); // fired Assert.failDbg(); // fired
} }
if ( null != evt ) { if ( null != evt ) {
@ -1281,7 +1281,7 @@ public class BTService extends XWJIService {
op.dos.writeInt( gameID ); op.dos.writeInt( gameID );
append( BTCmd.PING, gameID, op ); append( BTCmd.PING, gameID, op );
} catch ( IOException ioe ) { } catch ( IOException ioe ) {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
return this; return this;
} }
@ -1299,7 +1299,7 @@ public class BTService extends XWJIService {
} }
append( BTCmd.INVITE, op ); append( BTCmd.INVITE, op );
} catch ( IOException ioe ) { } catch ( IOException ioe ) {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
@ -1312,7 +1312,7 @@ public class BTService extends XWJIService {
op.dos.write( buf, 0, buf.length ); op.dos.write( buf, 0, buf.length );
append( BTCmd.MESG_SEND, gameID, msgID, op ); append( BTCmd.MESG_SEND, gameID, msgID, op );
} catch ( IOException ioe ) { } catch ( IOException ioe ) {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
@ -1323,7 +1323,7 @@ public class BTService extends XWJIService {
op.dos.writeInt( gameID ); op.dos.writeInt( gameID );
append( BTCmd.MESG_GAMEGONE, gameID, op ); append( BTCmd.MESG_GAMEGONE, gameID, op );
} catch ( IOException ioe ) { } catch ( IOException ioe ) {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
@ -1446,7 +1446,7 @@ public class BTService extends XWJIService {
? (short)inStream.available() : inStream.readShort(); ? (short)inStream.available() : inStream.readShort();
if ( isLen >= MAX_PACKET_LEN ) { if ( isLen >= MAX_PACKET_LEN ) {
Log.e( TAG, "packet too big; dropping!!!" ); Log.e( TAG, "packet too big; dropping!!!" );
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} else { } else {
byte[] data = new byte[isLen]; byte[] data = new byte[isLen];
inStream.readFully( data ); inStream.readFully( data );
@ -1494,7 +1494,7 @@ public class BTService extends XWJIService {
processor.receiveGameGone( gameID, socket ); processor.receiveGameGone( gameID, socket );
break; break;
default: default:
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
break; break;
} }
} else { } else {
@ -1502,7 +1502,7 @@ public class BTService extends XWJIService {
+ " skipping %d bytes", cmdOrd, oneLen ); + " skipping %d bytes", cmdOrd, oneLen );
if ( oneLen <= dis.available() ) { if ( oneLen <= dis.available() ) {
dis.readFully( new byte[oneLen] ); dis.readFully( new byte[oneLen] );
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
@ -1520,7 +1520,7 @@ public class BTService extends XWJIService {
} catch ( Exception ex ) { } catch ( Exception ex ) {
Log.e( TAG, "dispatchAll() got ex: %s", ex ); Log.e( TAG, "dispatchAll() got ex: %s", ex );
Log.ex( TAG, ex ); Log.ex( TAG, ex );
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
Log.d( TAG, "dispatchAll() done" ); Log.d( TAG, "dispatchAll() done" );
} }

View file

@ -172,7 +172,7 @@ public class BiDiSockWrap {
Log.ex( TAG, ioe ); Log.ex( TAG, ioe );
closeSocket(); closeSocket();
} catch ( InterruptedException ie ) { } catch ( InterruptedException ie ) {
Assert.fail(); Assert.failDbg();
} }
Log.d( TAG, "write thread exiting" ); Log.d( TAG, "write thread exiting" );
} }

View file

@ -588,7 +588,7 @@ public class BoardCanvas extends Canvas implements DrawCtx {
sSaveMethod = cls.getDeclaredMethod( "save", new Class[] {int.class} ); sSaveMethod = cls.getDeclaredMethod( "save", new Class[] {int.class} );
} catch ( NoSuchMethodException | ClassNotFoundException ex ) { } catch ( NoSuchMethodException | ClassNotFoundException ex ) {
Log.e( TAG, "%s", ex ); Log.e( TAG, "%s", ex );
Assert.fail(); Assert.failDbg();
} }
} }
@ -599,7 +599,7 @@ public class BoardCanvas extends Canvas implements DrawCtx {
} catch ( java.lang.reflect.InvocationTargetException } catch ( java.lang.reflect.InvocationTargetException
| IllegalAccessException ex ) { | IllegalAccessException ex ) {
Log.e( TAG, "%s", ex ); Log.e( TAG, "%s", ex );
Assert.fail(); Assert.failDbg();
} }
} }
} }

View file

@ -1322,7 +1322,7 @@ public class BoardDelegate extends DelegateBase
break; break;
default: default:
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
} }
@ -1788,7 +1788,7 @@ public class BoardDelegate extends DelegateBase
id = R.string.bonus_w3x; id = R.string.bonus_w3x;
break; break;
default: default:
Assert.fail(); Assert.failDbg();
} }
if ( 0 != id ) { if ( 0 != id ) {
@ -1970,7 +1970,7 @@ public class BoardDelegate extends DelegateBase
case ERR_NO_EMPTY_TRADE: case ERR_NO_EMPTY_TRADE:
// This should not be possible as the button's // This should not be possible as the button's
// disabled when no tiles selected. // disabled when no tiles selected.
Assert.fail(); Assert.failDbg();
break; break;
case ERR_TOO_MANY_TRADE: case ERR_TOO_MANY_TRADE:
int nLeft = XwJNI.server_countTilesInPool( m_jniGamePtr ); int nLeft = XwJNI.server_countTilesInPool( m_jniGamePtr );
@ -2382,7 +2382,7 @@ public class BoardDelegate extends DelegateBase
break; break;
default: default:
Log.w( TAG, "tickle: unexpected type %s", typ.toString() ); Log.w( TAG, "tickle: unexpected type %s", typ.toString() );
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
@ -2499,7 +2499,7 @@ public class BoardDelegate extends DelegateBase
break; break;
default: default:
Assert.fail(); Assert.failDbg();
} }
showDialogFragment( dlgID, dlgTitle, txt ); showDialogFragment( dlgID, dlgTitle, txt );

View file

@ -447,7 +447,7 @@ public class CommsTransport implements TransportProcs,
nSent = NFCUtils.addMsgFor( buf, gameID ); nSent = NFCUtils.addMsgFor( buf, gameID );
break; break;
default: default:
Assert.fail(); Assert.failDbg();
break; break;
} }
Log.d( TAG, "sendForAddr(typ=%s, len=%d) => %d", conType, Log.d( TAG, "sendForAddr(typ=%s, len=%d) => %d", conType,

View file

@ -131,7 +131,7 @@ public class ConnViaViewLayout extends LinearLayout {
enabled = WiDirWrapper.enabled(); enabled = WiDirWrapper.enabled();
break; break;
default: default:
Assert.fail(); Assert.failDbg();
break; break;
} }
@ -170,7 +170,7 @@ public class ConnViaViewLayout extends LinearLayout {
keyID = R.string.key_na_comms_p2p; keyID = R.string.key_na_comms_p2p;
break; break;
default: default:
Assert.fail(); Assert.failDbg();
break; break;
} }

View file

@ -49,7 +49,7 @@ public class DBAlert extends XWDialogFragment {
if ( null != obj && !(obj instanceof Serializable) ) { if ( null != obj && !(obj instanceof Serializable) ) {
Log.d( TAG, "OOPS: %s not Serializable", Log.d( TAG, "OOPS: %s not Serializable",
obj.getClass().getName() ); obj.getClass().getName() );
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
} }

View file

@ -387,7 +387,7 @@ public class DBUtils {
} }
saveSummary( context, lock, summary ); saveSummary( context, lock, summary );
} else { } else {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
Log.e( TAG, "addRematchInfo(%d): unable to lock game" ); Log.e( TAG, "addRematchInfo(%d): unable to lock game" );
} }
} }
@ -1126,7 +1126,7 @@ public class DBUtils {
deleteGame( context, lock ); deleteGame( context, lock );
} else { } else {
Log.e( TAG, "deleteGame: unable to lock rowid %d", rowid ); Log.e( TAG, "deleteGame: unable to lock rowid %d", rowid );
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
} }
@ -2239,7 +2239,7 @@ public class DBUtils {
updateStmt.execute(); updateStmt.execute();
} catch ( Exception ex ) { } catch ( Exception ex ) {
Log.ex( TAG, ex ); Log.ex( TAG, ex );
Assert.fail(); Assert.failDbg();
} }
} }
} }

View file

@ -100,7 +100,7 @@ public class DelegateBase implements DlgClickNotify,
public Activity getActivity() { return m_activity; } public Activity getActivity() { return m_activity; }
// Does nothing unless overridden. These belong in an interface. // Does nothing unless overridden. These belong in an interface.
protected void init( Bundle savedInstanceState ) { Assert.fail(); } protected void init( Bundle savedInstanceState ) { Assert.failDbg(); }
protected void onSaveInstanceState( Bundle outState ) {} protected void onSaveInstanceState( Bundle outState ) {}
public boolean onPrepareOptionsMenu( Menu menu ) { return false; } public boolean onPrepareOptionsMenu( Menu menu ) { return false; }
public boolean onOptionsItemSelected( MenuItem item ) { return false; } public boolean onOptionsItemSelected( MenuItem item ) { return false; }
@ -176,7 +176,7 @@ public class DelegateBase implements DlgClickNotify,
} }
if ( this != result ) { if ( this != result ) {
Log.d( TAG, "%s.curThis() => " + result, this.toString() ); Log.d( TAG, "%s.curThis() => " + result, this.toString() );
Assert.fail(); Assert.failDbg();
} }
return result; return result;
} }
@ -188,7 +188,7 @@ public class DelegateBase implements DlgClickNotify,
inflater.inflate( m_optionsMenuID, menu ); inflater.inflate( m_optionsMenuID, menu );
LocUtils.xlateMenu( m_activity, menu ); LocUtils.xlateMenu( m_activity, menu );
} else { } else {
Assert.fail(); Assert.failDbg();
} }
return handled; return handled;
@ -504,7 +504,7 @@ public class DelegateBase implements DlgClickNotify,
df = InviteChoicesAlert.newInstance( state ); df = InviteChoicesAlert.newInstance( state );
break; break;
default: default:
Assert.fail(); Assert.failDbg();
} }
show( df ); show( df );
@ -516,7 +516,7 @@ public class DelegateBase implements DlgClickNotify,
if ( m_activity instanceof XWActivity ) { if ( m_activity instanceof XWActivity ) {
((XWActivity)m_activity).show( df ); ((XWActivity)m_activity).show( df );
} else { } else {
Assert.assertTrue( !BuildConfig.DEBUG ); Assert.failDbg();
} }
} }

View file

@ -319,7 +319,7 @@ public class DictUtils {
context.deleteFile( name ); context.deleteFile( name );
break; break;
default: default:
Assert.fail(); Assert.failDbg();
} }
if ( null != path ) { if ( null != path ) {
@ -441,7 +441,7 @@ public class DictUtils {
path = context.getFileStreamPath( name ); path = context.getFileStreamPath( name );
break; break;
default: default:
Assert.fail(); Assert.failDbg();
path = null; path = null;
} }
return path; return path;

View file

@ -279,7 +279,7 @@ public class DictsDelegate extends ListDelegateBase
item.setComment( m_onServerStr ); item.setComment( m_onServerStr );
} else { } else {
Assert.fail(); Assert.failDbg();
} }
item.setText( name ); item.setText( name );
@ -1029,7 +1029,7 @@ public class DictsDelegate extends ListDelegateBase
++results[SEL_REMOTE]; ++results[SEL_REMOTE];
} else { } else {
Log.d( TAG, "obj is a: " + obj ); Log.d( TAG, "obj is a: " + obj );
Assert.fail(); Assert.failDbg();
} }
} }
Log.i( TAG, "countSelDicts() => {loc: %d; remote: %d}", Log.i( TAG, "countSelDicts() => {loc: %d; remote: %d}",

View file

@ -177,7 +177,7 @@ abstract class DlgDelegateAlert extends XWDialogFragment {
default: default:
Log.e( TAG, "unexpected button %d", button ); Log.e( TAG, "unexpected button %d", button );
// ignore on release builds // ignore on release builds
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
} }

View file

@ -67,7 +67,7 @@ public class DlgState implements Parcelable {
if ( null != obj && !(obj instanceof Serializable) ) { if ( null != obj && !(obj instanceof Serializable) ) {
Log.d( TAG, "OOPS: %s not Serializable", Log.d( TAG, "OOPS: %s not Serializable",
obj.getClass().getName() ); obj.getClass().getName() );
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
} }
@ -178,7 +178,7 @@ public class DlgState implements Parcelable {
Assert.assertFalse(newState == this); Assert.assertFalse(newState == this);
if ( !this.equals(newState) ) { if ( !this.equals(newState) ) {
Log.d( TAG, "restore failed!!: %s => %s", this, newState ); Log.d( TAG, "restore failed!!: %s => %s", this, newState );
Assert.fail(); Assert.failDbg();
} }
} }
} }

View file

@ -305,7 +305,7 @@ public class GameConfigDelegate extends DelegateBase
.show(); .show();
break; break;
default: default:
Assert.fail(); Assert.failDbg();
} }
} }
}, null, this ); }, null, this );
@ -527,7 +527,7 @@ public class GameConfigDelegate extends DelegateBase
setLangSpinnerSelection( langName ); setLangSpinnerSelection( langName );
break; break;
default: default:
Assert.fail(); Assert.failDbg();
} }
} }
} }
@ -559,7 +559,7 @@ public class GameConfigDelegate extends DelegateBase
private void loadGame( XwJNI.GamePtr gamePtr ) private void loadGame( XwJNI.GamePtr gamePtr )
{ {
if ( null == gamePtr ) { if ( null == gamePtr ) {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} else { } else {
m_gameStarted = XwJNI.model_getNMoves( gamePtr ) > 0 m_gameStarted = XwJNI.model_getNMoves( gamePtr ) > 0
|| XwJNI.comms_isConnected( gamePtr ); || XwJNI.comms_isConnected( gamePtr );
@ -775,7 +775,7 @@ public class GameConfigDelegate extends DelegateBase
break; break;
default: default:
Log.w( TAG, "unknown v: " + view.toString() ); Log.w( TAG, "unknown v: " + view.toString() );
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
} // onClick } // onClick
@ -1047,7 +1047,7 @@ public class GameConfigDelegate extends DelegateBase
default: default:
Log.w( TAG, "setSmartnessSpinner got %d from getRobotSmartness()", Log.w( TAG, "setSmartnessSpinner got %d from getRobotSmartness()",
m_gi.getRobotSmartness() ); m_gi.getRobotSmartness() );
Assert.fail(); Assert.failDbg();
} }
m_smartnessSpinner.setSelection( setting ); m_smartnessSpinner.setSelection( setting );
} }
@ -1058,7 +1058,7 @@ public class GameConfigDelegate extends DelegateBase
case 1: return 13; case 1: return 13;
case 2: return 11; case 2: return 11;
default: default:
Assert.fail(); Assert.failDbg();
} }
return -1; return -1;
} }
@ -1078,7 +1078,7 @@ public class GameConfigDelegate extends DelegateBase
selection = 2; selection = 2;
break; break;
default: default:
Assert.fail(); Assert.failDbg();
break; break;
} }
Assert.assertTrue( size == positionToSize(selection) ); Assert.assertTrue( size == positionToSize(selection) );
@ -1185,7 +1185,7 @@ public class GameConfigDelegate extends DelegateBase
case FORCE_REMOTE: case FORCE_REMOTE:
return R.layout.force_remote; return R.layout.force_remote;
} }
Assert.fail(); Assert.failDbg();
return 0; return 0;
} }

View file

@ -184,7 +184,7 @@ public class GameListItem extends LinearLayout
} }
break; break;
default: default:
Assert.assertFalse(BuildConfig.DEBUG); Assert.failDbg();
break; break;
} }
} }

View file

@ -159,7 +159,7 @@ public class GamesListDelegate extends ListDelegateBase
if ( BuildConfig.DEBUG && ggi.m_count != children.size() ) { if ( BuildConfig.DEBUG && ggi.m_count != children.size() ) {
Log.e( TAG, "m_count: %d != size: %d", Log.e( TAG, "m_count: %d != size: %d",
ggi.m_count, children.size() ); ggi.m_count, children.size() );
Assert.fail(); Assert.failDbg();
} }
} }
} }
@ -200,7 +200,7 @@ public class GamesListDelegate extends ListDelegateBase
item.setSelected( m_mySIS.selGames.contains( rec.m_rowID ) ); item.setSelected( m_mySIS.selGames.contains( rec.m_rowID ) );
result = item; result = item;
} else { } else {
Assert.fail(); Assert.failDbg();
} }
return result; return result;
} }
@ -1204,7 +1204,7 @@ public class GamesListDelegate extends ListDelegateBase
mkListAdapter(); mkListAdapter();
break; break;
default: default:
Assert.fail(); Assert.failDbg();
break; break;
} }
} }
@ -1267,7 +1267,7 @@ public class GamesListDelegate extends ListDelegateBase
long groupID = ((GameListGroup)obj).getGroupID(); long groupID = ((GameListGroup)obj).getGroupID();
selected = m_mySIS.selGroupIDs.contains( groupID ); selected = m_mySIS.selGroupIDs.contains( groupID );
} else { } else {
Assert.fail(); Assert.failDbg();
selected = false; selected = false;
} }
return selected; return selected;
@ -1685,7 +1685,7 @@ public class GamesListDelegate extends ListDelegateBase
long groupID = ((GameListGroup)targetView).getGroupID(); long groupID = ((GameListGroup)targetView).getGroupID();
selected = m_mySIS.selGroupIDs.contains( groupID ); selected = m_mySIS.selGroupIDs.contains( groupID );
} else { } else {
Assert.fail(); Assert.failDbg();
} }
if ( 0 != id ) { if ( 0 != id ) {
@ -1736,7 +1736,7 @@ public class GamesListDelegate extends ListDelegateBase
selIds[0] = ((GameListGroup)targetView).getGroupID(); selIds[0] = ((GameListGroup)targetView).getGroupID();
handled = handleSelGroupsItem( itemID, selIds ); handled = handleSelGroupsItem( itemID, selIds );
} else { } else {
Assert.fail(); Assert.failDbg();
} }
} }
@ -2360,7 +2360,7 @@ public class GamesListDelegate extends ListDelegateBase
startNewNetGame( nli ); startNewNetGame( nli );
result = true; result = true;
} else { } else {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
return result; return result;
@ -2592,7 +2592,7 @@ public class GamesListDelegate extends ListDelegateBase
if ( summary.conTypes.contains( CommsConnType.COMMS_CONN_RELAY ) if ( summary.conTypes.contains( CommsConnType.COMMS_CONN_RELAY )
&& summary.roomName.length() == 0 ) { && summary.roomName.length() == 0 ) {
Assert.fail(); Assert.failDbg();
} else { } else {
try { try {
if ( checkWarnNoDict( rowid ) ) { if ( checkWarnNoDict( rowid ) ) {

View file

@ -159,7 +159,7 @@ public class LookupAlertView extends LinearLayout
} else if ( STATE_URLS == m_state ) { } else if ( STATE_URLS == m_state ) {
m_urlIndex = position; m_urlIndex = position;
} else { } else {
Assert.fail(); Assert.failDbg();
} }
switchState( 1 ); switchState( 1 );
} }
@ -220,7 +220,7 @@ public class LookupAlertView extends LinearLayout
switchState( -1 ); switchState( -1 );
break; break;
default: default:
Assert.fail(); Assert.failDbg();
break; break;
} }
} // switchState } // switchState

View file

@ -115,7 +115,7 @@ public class MultiMsgSink implements TransportProcs {
nSent = sendViaNFC( buf, gameID ); nSent = sendViaNFC( buf, gameID );
break; break;
default: default:
Assert.fail(); Assert.failDbg();
break; break;
} }
Log.i( TAG, "transportSend(): sent %d bytes for game %d/%x via %s", Log.i( TAG, "transportSend(): sent %d bytes for game %d/%x via %s",

View file

@ -293,7 +293,7 @@ public class NBSProto {
break; break;
default: default:
Log.w( TAG, "unexpected cmd %s", msg.cmd ); Log.w( TAG, "unexpected cmd %s", msg.cmd );
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
break; break;
} }
} }
@ -364,7 +364,7 @@ public class NBSProto {
} catch ( IllegalArgumentException iae ) { } catch ( IllegalArgumentException iae ) {
Log.w( TAG, "sendBuffers(%s): %s", phone, iae.toString() ); Log.w( TAG, "sendBuffers(%s): %s", phone, iae.toString() );
} catch ( NullPointerException npe ) { } catch ( NullPointerException npe ) {
Assert.assertFalse( BuildConfig.DEBUG ); // shouldn't be trying to do this!!! Assert.failDbg(); // shouldn't be trying to do this!!!
} catch ( java.lang.SecurityException se ) { } catch ( java.lang.SecurityException se ) {
getHelper().postEvent( MultiEvent.SMS_SEND_FAILED_NOPERMISSION ); getHelper().postEvent( MultiEvent.SMS_SEND_FAILED_NOPERMISSION );
} catch ( Exception ee ) { } catch ( Exception ee ) {

View file

@ -108,7 +108,7 @@ public class NFCCardService extends HostApduService {
} }
} }
} catch ( IOException ioe ) { } catch ( IOException ioe ) {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
} }
@ -129,7 +129,7 @@ public class NFCCardService extends HostApduService {
} }
} }
} catch ( IOException ioe ) { } catch ( IOException ioe ) {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
byte[] result = baos.toByteArray(); byte[] result = baos.toByteArray();

View file

@ -112,7 +112,7 @@ public class NFCUtils {
intent.setAction( NFC_TO_SELF_ACTION ) intent.setAction( NFC_TO_SELF_ACTION )
.putExtra( NFC_TO_SELF_DATA, data ); .putExtra( NFC_TO_SELF_DATA, data );
} else { } else {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
@ -168,7 +168,7 @@ public class NFCUtils {
} }
result = baos.toByteArray(); result = baos.toByteArray();
} catch ( IOException ioe ) { } catch ( IOException ioe ) {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
Log.d( TAG, "formatMsgs(gameID=%d) => %s", gameID, DbgUtils.hexDump( result ) ); Log.d( TAG, "formatMsgs(gameID=%d) => %s", gameID, DbgUtils.hexDump( result ) );
@ -429,12 +429,12 @@ public class NFCUtils {
break; break;
default: default:
Log.e( TAG, "unexpected reply %d", body[0] ); Log.e( TAG, "unexpected reply %d", body[0] );
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
break; break;
} }
break; break;
default: default:
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
break; break;
} }
} }
@ -492,7 +492,7 @@ public class NFCUtils {
dos.writeInt( num ); dos.writeInt( num );
dos.flush(); dos.flush();
} catch ( IOException ioe ) { } catch ( IOException ioe ) {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
result = baos.toByteArray(); result = baos.toByteArray();
} }
@ -692,7 +692,7 @@ public class NFCUtils {
} }
} }
} catch ( IOException ioe ) { } catch ( IOException ioe ) {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
return result; return result;
} }
@ -736,7 +736,7 @@ public class NFCUtils {
} }
remember( msgID, token ); remember( msgID, token );
} catch ( IOException ioe ) { } catch ( IOException ioe ) {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
return result; return result;
} }

View file

@ -154,7 +154,7 @@ public class NagTurnReceiver extends BroadcastReceiver {
} }
} }
} else { } else {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
return result; return result;
} }

View file

@ -223,7 +223,7 @@ public class NetLaunchInfo implements Serializable {
default: default:
doAdd = false; doAdd = false;
Log.d( TAG, "unexpected type: %s", typ ); Log.d( TAG, "unexpected type: %s", typ );
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
if ( doAdd ) { if ( doAdd ) {
m_addrs.add( typ ); m_addrs.add( typ );
@ -301,7 +301,7 @@ public class NetLaunchInfo implements Serializable {
addNFCInfo(); addNFCInfo();
break; break;
default: default:
Assert.fail(); Assert.failDbg();
break; break;
} }
} }
@ -457,7 +457,7 @@ public class NetLaunchInfo implements Serializable {
case COMMS_CONN_NFC: case COMMS_CONN_NFC:
break; break;
default: default:
Assert.fail(); Assert.failDbg();
break; break;
} }
} }
@ -516,7 +516,7 @@ public class NetLaunchInfo implements Serializable {
break; break;
default: default:
doAdd = false; doAdd = false;
Assert.fail(); Assert.failDbg();
} }
if ( doAdd ) { if ( doAdd ) {
m_addrs.add( typ ); m_addrs.add( typ );
@ -654,14 +654,14 @@ public class NetLaunchInfo implements Serializable {
das.writeUTF( makeLaunchJSON() ); das.writeUTF( makeLaunchJSON() );
result = bas.toByteArray(); result = bas.toByteArray();
} catch ( java.io.IOException ex ) { } catch ( java.io.IOException ex ) {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
return result; return result;
} }
public static void putExtras( Intent intent, int gameID, String btAddr ) public static void putExtras( Intent intent, int gameID, String btAddr )
{ {
Assert.fail(); Assert.failDbg();
} }
public void freezeAddrs() public void freezeAddrs()

View file

@ -112,7 +112,7 @@ public class NetUtils {
} }
} }
} catch ( JSONException ex ) { } catch ( JSONException ex ) {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
} }

View file

@ -95,7 +95,7 @@ public class Perms23 {
PackageManager.GET_PERMISSIONS ) PackageManager.GET_PERMISSIONS )
.requestedPermissions; .requestedPermissions;
if ( pis == null ) { if ( pis == null ) {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} else { } else {
String manifestName = perm.getString(); String manifestName = perm.getString();
for ( int ii = 0; !result && ii < pis.length; ++ii ) { for ( int ii = 0; !result && ii < pis.length; ++ii ) {
@ -456,7 +456,7 @@ public class Perms23 {
break; break;
default: default:
Log.e( TAG, "bannedWithWorkaround(): unexpected perm %s", perm ); Log.e( TAG, "bannedWithWorkaround(): unexpected perm %s", perm );
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
break; break;
} }
} }

View file

@ -151,8 +151,8 @@ public class PrefsActivity extends PreferenceActivity
return getIntent().getExtras(); return getIntent().getExtras();
} }
public boolean inDPMode() { Assert.fail(); return false; } public boolean inDPMode() { Assert.failDbg(); return false; }
public void addFragment( XWFragment fragment, Bundle extras ) { Assert.fail(); } public void addFragment( XWFragment fragment, Bundle extras ) { Assert.failDbg(); }
public void addFragmentForResult( XWFragment fragment, Bundle extras, public void addFragmentForResult( XWFragment fragment, Bundle extras,
RequestCode code ) { Assert.fail(); } RequestCode code ) { Assert.failDbg(); }
} }

View file

@ -237,7 +237,7 @@ public class PrefsDelegate extends DelegateBase
makeOkOnlyBuilder( R.string.after_restart ).show(); makeOkOnlyBuilder( R.string.after_restart ).show();
break; break;
default: default:
Assert.fail(); Assert.failDbg();
break; break;
} }
} }
@ -275,7 +275,7 @@ public class PrefsDelegate extends DelegateBase
break; break;
default: default:
Assert.fail(); Assert.failDbg();
} }
} }

View file

@ -526,7 +526,7 @@ public class RelayService extends XWJIService
stopSelf(); stopSelf();
break; break;
default: default:
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
@ -554,7 +554,7 @@ public class RelayService extends XWJIService
s_UDPSocket = udpSocket; s_UDPSocket = udpSocket;
} catch( SocketException se ) { } catch( SocketException se ) {
Log.ex( TAG, se ); Log.ex( TAG, se );
Assert.fail(); Assert.failDbg();
} catch( java.net.UnknownHostException uhe ) { } catch( java.net.UnknownHostException uhe ) {
Log.ex( TAG, uhe ); Log.ex( TAG, uhe );
Log.e( TAG, "connectSocketOnce(): %s", uhe.getMessage() ); Log.e( TAG, "connectSocketOnce(): %s", uhe.getMessage() );
@ -629,7 +629,7 @@ public class RelayService extends XWJIService
long sentMS = packet.getSentMS(); long sentMS = packet.getSentMS();
if ( prevSentMS > sentMS ) { if ( prevSentMS > sentMS ) {
Log.e( TAG, "error: prevSentMS: %d > sentMS: %d", prevSentMS, sentMS ); Log.e( TAG, "error: prevSentMS: %d > sentMS: %d", prevSentMS, sentMS );
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
continue; continue;
} }
@ -705,7 +705,7 @@ public class RelayService extends XWJIService
CommsConnType.COMMS_CONN_RELAY, CommsConnType.COMMS_CONN_RELAY,
succeeded ); succeeded );
} catch ( JSONException ex ) { } catch ( JSONException ex ) {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
} }
@ -785,7 +785,7 @@ public class RelayService extends XWJIService
// DbgUtils.logf( "startFetchThreadIfNotUDP()" ); // DbgUtils.logf( "startFetchThreadIfNotUDP()" );
boolean handled = relayEnabled( this ) && !BuildConfig.UDP_ENABLED; boolean handled = relayEnabled( this ) && !BuildConfig.UDP_ENABLED;
if ( handled && null == m_fetchThread ) { if ( handled && null == m_fetchThread ) {
Assert.assertFalse( BuildConfig.DEBUG ); // NOT using this now! Assert.failDbg(); // NOT using this now!
m_fetchThread = new Thread( null, new Runnable() { m_fetchThread = new Thread( null, new Runnable() {
@Override @Override
@ -804,7 +804,7 @@ public class RelayService extends XWJIService
{ {
while ( null != m_fetchThread ) { while ( null != m_fetchThread ) {
Log.w( TAG, "2: m_fetchThread NOT NULL; WHAT TO DO???" ); Log.w( TAG, "2: m_fetchThread NOT NULL; WHAT TO DO???" );
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
try { try {
Thread.sleep( 20 ); Thread.sleep( 20 );
} catch( java.lang.InterruptedException ie ) { } catch( java.lang.InterruptedException ie ) {
@ -1240,7 +1240,7 @@ public class RelayService extends XWJIService
private void fetchAndProcess() private void fetchAndProcess()
{ {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
long[][] rowIDss = new long[1][]; long[][] rowIDss = new long[1][];
String[] relayIDs = DBUtils.getRelayIDs( this, rowIDss ); String[] relayIDs = DBUtils.getRelayIDs( this, rowIDss );
if ( null != relayIDs && 0 < relayIDs.length ) { if ( null != relayIDs && 0 < relayIDs.length ) {
@ -1428,7 +1428,7 @@ public class RelayService extends XWJIService
// Need to deal with this case by sending multiple // Need to deal with this case by sending multiple
// packets. It WILL happen. // packets. It WILL happen.
Log.w( TAG, "dropping send for lack of space; FIX ME!!" ); Log.w( TAG, "dropping send for lack of space; FIX ME!!" );
Assert.fail(); Assert.failDbg();
break; break;
} }
// got space; now write it // got space; now write it
@ -1594,7 +1594,7 @@ public class RelayService extends XWJIService
startUDPReadThreadOnce(); startUDPReadThreadOnce();
registerWithRelay( -1 ); registerWithRelay( -1 );
} else { } else {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
stopUDPReadThread(); stopUDPReadThread();
startFetchThreadIfNotUDP(); startFetchThreadIfNotUDP();
} }

View file

@ -116,7 +116,7 @@ public class SMSInviteDelegate extends InviteDelegate {
result = R.string.invite_sms_desc; result = R.string.invite_sms_desc;
break; break;
default: default:
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
break; break;
} }
return result; return result;

View file

@ -162,7 +162,7 @@ public class TilePickAlert extends XWDialogFragment
DlgClickNotify notify = (DlgClickNotify)activity; DlgClickNotify notify = (DlgClickNotify)activity;
notify.onPosButton( m_action, m_state, m_selTiles ); notify.onPosButton( m_action, m_state, m_selTiles );
} else { } else {
Assert.assertTrue( !BuildConfig.DEBUG ); Assert.failDbg();
} }
dismiss(); dismiss();
} }

View file

@ -169,7 +169,7 @@ public class Toolbar implements BoardContainer.SizeChangeListener {
} else if ( listener instanceof View.OnLongClickListener ) { } else if ( listener instanceof View.OnLongClickListener ) {
button.setOnLongClickListener( (View.OnLongClickListener)listener ); button.setOnLongClickListener( (View.OnLongClickListener)listener );
} else { } else {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
return success; return success;

View file

@ -684,7 +684,7 @@ public class Utils {
result = base64Encode( bas.toByteArray() ); result = base64Encode( bas.toByteArray() );
} catch ( Exception ex ) { } catch ( Exception ex ) {
Log.ex( TAG, ex ); Log.ex( TAG, ex );
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
return result; return result;
} }

View file

@ -86,7 +86,7 @@ public class WiDirInviteDelegate extends InviteDelegate
protected void onBarButtonClicked( int id ) protected void onBarButtonClicked( int id )
{ {
// not implemented yet as there's no bar button // not implemented yet as there's no bar button
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
@Override @Override

View file

@ -621,7 +621,7 @@ public class WiDirService extends XWService {
break; break;
default: default:
Assert.fail(); Assert.failDbg();
} }
} }
} }
@ -1163,7 +1163,7 @@ public class WiDirService extends XWService {
} }
getMgr().requestGroupInfo( sChannel, sGroupListener ); getMgr().requestGroupInfo( sChannel, sGroupListener );
} else { } else {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }

View file

@ -261,13 +261,13 @@ public class XWActivity extends FragmentActivity
public void addFragment( XWFragment fragment, Bundle extras ) public void addFragment( XWFragment fragment, Bundle extras )
{ {
Assert.fail(); Assert.failDbg();
} }
public void addFragmentForResult( XWFragment fragment, Bundle extras, public void addFragmentForResult( XWFragment fragment, Bundle extras,
RequestCode request ) RequestCode request )
{ {
Assert.fail(); Assert.failDbg();
} }
protected void show( XWDialogFragment df ) protected void show( XWDialogFragment df )

View file

@ -92,7 +92,7 @@ public class XWConnAddrPreference extends DialogPreference {
.show(); .show();
break; break;
default: default:
Assert.fail(); Assert.failDbg();
break; break;
} }
} }

View file

@ -139,7 +139,7 @@ abstract class XWDialogFragment extends DialogFragment {
if ( null != listener ) { if ( null != listener ) {
listener.onClick( getDialog(), button ); listener.onClick( getDialog(), button );
} else { } else {
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
} }
} }

View file

@ -208,7 +208,7 @@ abstract class XWFragment extends Fragment implements Delegator {
public void finish() public void finish()
{ {
Assert.fail(); Assert.failDbg();
} }
public void setTitle() { m_dlgt.setTitle(); } public void setTitle() { m_dlgt.setTitle(); }

View file

@ -83,7 +83,7 @@ public class CommsAddrRec {
case COMMS_CONN_NFC: case COMMS_CONN_NFC:
id = R.string.invite_choice_nfc; break; id = R.string.invite_choice_nfc; break;
default: default:
Assert.assertFalse( BuildConfig.DEBUG ); Assert.failDbg();
} }
return ( 0 == id ) ? toString() : LocUtils.getString( context, id ); return ( 0 == id ) ? toString() : LocUtils.getString( context, id );
@ -408,7 +408,7 @@ public class CommsAddrRec {
case COMMS_CONN_NFC: case COMMS_CONN_NFC:
break; break;
default: default:
Assert.fail(); Assert.failDbg();
} }
} }
} }

View file

@ -81,7 +81,7 @@ public class DUtilCtxt {
DevID.clearRelayDevID( m_context ); DevID.clearRelayDevID( m_context );
break; break;
default: default:
Assert.fail(); Assert.failDbg();
break; break;
} }
} }

View file

@ -733,7 +733,7 @@ public class JNIThread extends Thread implements AutoCloseable {
break; break;
default: default:
Log.w( TAG, "dropping cmd: %s", elem.m_cmd.toString() ); Log.w( TAG, "dropping cmd: %s", elem.m_cmd.toString() );
Assert.fail(); Assert.failDbg();
} }
if ( draw ) { if ( draw ) {