mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-04 20:46:28 +01:00
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:
parent
8291b70842
commit
dfb33c01af
42 changed files with 112 additions and 112 deletions
|
@ -23,9 +23,9 @@ package org.eehouse.android.xw4;
|
|||
public class Assert {
|
||||
private static final String TAG = Assert.class.getSimpleName();
|
||||
|
||||
public static void fail() {
|
||||
assertTrue(false);
|
||||
}
|
||||
public static void fail() { assertTrue(false); }
|
||||
|
||||
public static void failDbg() { assertFalse( BuildConfig.DEBUG ); }
|
||||
|
||||
public static void assertFalse(boolean val)
|
||||
{
|
||||
|
|
|
@ -496,7 +496,7 @@ public class BTService extends XWJIService {
|
|||
break;
|
||||
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
} else {
|
||||
Log.d( TAG, "onHandleWorkImpl(): BT disabled so doing nothing" );
|
||||
|
@ -732,7 +732,7 @@ public class BTService extends XWJIService {
|
|||
mHelper.postEvent( event, dev );
|
||||
}
|
||||
} catch ( InterruptedException ex ) {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1225,7 +1225,7 @@ public class BTService extends XWJIService {
|
|||
|
||||
default:
|
||||
Log.e( TAG, "handleReply(cmd=%s) case not handled", cmd );
|
||||
Assert.assertFalse( BuildConfig.DEBUG ); // fired
|
||||
Assert.failDbg(); // fired
|
||||
}
|
||||
|
||||
if ( null != evt ) {
|
||||
|
@ -1281,7 +1281,7 @@ public class BTService extends XWJIService {
|
|||
op.dos.writeInt( gameID );
|
||||
append( BTCmd.PING, gameID, op );
|
||||
} catch ( IOException ioe ) {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
@ -1299,7 +1299,7 @@ public class BTService extends XWJIService {
|
|||
}
|
||||
append( BTCmd.INVITE, op );
|
||||
} 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 );
|
||||
append( BTCmd.MESG_SEND, gameID, msgID, op );
|
||||
} catch ( IOException ioe ) {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1323,7 +1323,7 @@ public class BTService extends XWJIService {
|
|||
op.dos.writeInt( gameID );
|
||||
append( BTCmd.MESG_GAMEGONE, gameID, op );
|
||||
} catch ( IOException ioe ) {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1446,7 +1446,7 @@ public class BTService extends XWJIService {
|
|||
? (short)inStream.available() : inStream.readShort();
|
||||
if ( isLen >= MAX_PACKET_LEN ) {
|
||||
Log.e( TAG, "packet too big; dropping!!!" );
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
} else {
|
||||
byte[] data = new byte[isLen];
|
||||
inStream.readFully( data );
|
||||
|
@ -1494,7 +1494,7 @@ public class BTService extends XWJIService {
|
|||
processor.receiveGameGone( gameID, socket );
|
||||
break;
|
||||
default:
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
@ -1502,7 +1502,7 @@ public class BTService extends XWJIService {
|
|||
+ " skipping %d bytes", cmdOrd, oneLen );
|
||||
if ( oneLen <= dis.available() ) {
|
||||
dis.readFully( new byte[oneLen] );
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1520,7 +1520,7 @@ public class BTService extends XWJIService {
|
|||
} catch ( Exception ex ) {
|
||||
Log.e( TAG, "dispatchAll() got ex: %s", ex );
|
||||
Log.ex( TAG, ex );
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
Log.d( TAG, "dispatchAll() done" );
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ public class BiDiSockWrap {
|
|||
Log.ex( TAG, ioe );
|
||||
closeSocket();
|
||||
} catch ( InterruptedException ie ) {
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
Log.d( TAG, "write thread exiting" );
|
||||
}
|
||||
|
|
|
@ -588,7 +588,7 @@ public class BoardCanvas extends Canvas implements DrawCtx {
|
|||
sSaveMethod = cls.getDeclaredMethod( "save", new Class[] {int.class} );
|
||||
} catch ( NoSuchMethodException | ClassNotFoundException 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
|
||||
| IllegalAccessException ex ) {
|
||||
Log.e( TAG, "%s", ex );
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1322,7 +1322,7 @@ public class BoardDelegate extends DelegateBase
|
|||
|
||||
break;
|
||||
default:
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1788,7 +1788,7 @@ public class BoardDelegate extends DelegateBase
|
|||
id = R.string.bonus_w3x;
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
|
||||
if ( 0 != id ) {
|
||||
|
@ -1970,7 +1970,7 @@ public class BoardDelegate extends DelegateBase
|
|||
case ERR_NO_EMPTY_TRADE:
|
||||
// This should not be possible as the button's
|
||||
// disabled when no tiles selected.
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
break;
|
||||
case ERR_TOO_MANY_TRADE:
|
||||
int nLeft = XwJNI.server_countTilesInPool( m_jniGamePtr );
|
||||
|
@ -2382,7 +2382,7 @@ public class BoardDelegate extends DelegateBase
|
|||
break;
|
||||
default:
|
||||
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;
|
||||
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
|
||||
showDialogFragment( dlgID, dlgTitle, txt );
|
||||
|
|
|
@ -447,7 +447,7 @@ public class CommsTransport implements TransportProcs,
|
|||
nSent = NFCUtils.addMsgFor( buf, gameID );
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
Log.d( TAG, "sendForAddr(typ=%s, len=%d) => %d", conType,
|
||||
|
|
|
@ -131,7 +131,7 @@ public class ConnViaViewLayout extends LinearLayout {
|
|||
enabled = WiDirWrapper.enabled();
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ public class ConnViaViewLayout extends LinearLayout {
|
|||
keyID = R.string.key_na_comms_p2p;
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ public class DBAlert extends XWDialogFragment {
|
|||
if ( null != obj && !(obj instanceof Serializable) ) {
|
||||
Log.d( TAG, "OOPS: %s not Serializable",
|
||||
obj.getClass().getName() );
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -387,7 +387,7 @@ public class DBUtils {
|
|||
}
|
||||
saveSummary( context, lock, summary );
|
||||
} else {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
Log.e( TAG, "addRematchInfo(%d): unable to lock game" );
|
||||
}
|
||||
}
|
||||
|
@ -1126,7 +1126,7 @@ public class DBUtils {
|
|||
deleteGame( context, lock );
|
||||
} else {
|
||||
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();
|
||||
} catch ( Exception ex ) {
|
||||
Log.ex( TAG, ex );
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ public class DelegateBase implements DlgClickNotify,
|
|||
public Activity getActivity() { return m_activity; }
|
||||
|
||||
// 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 ) {}
|
||||
public boolean onPrepareOptionsMenu( Menu menu ) { return false; }
|
||||
public boolean onOptionsItemSelected( MenuItem item ) { return false; }
|
||||
|
@ -176,7 +176,7 @@ public class DelegateBase implements DlgClickNotify,
|
|||
}
|
||||
if ( this != result ) {
|
||||
Log.d( TAG, "%s.curThis() => " + result, this.toString() );
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ public class DelegateBase implements DlgClickNotify,
|
|||
inflater.inflate( m_optionsMenuID, menu );
|
||||
LocUtils.xlateMenu( m_activity, menu );
|
||||
} else {
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
|
||||
return handled;
|
||||
|
@ -504,7 +504,7 @@ public class DelegateBase implements DlgClickNotify,
|
|||
df = InviteChoicesAlert.newInstance( state );
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
|
||||
show( df );
|
||||
|
@ -516,7 +516,7 @@ public class DelegateBase implements DlgClickNotify,
|
|||
if ( m_activity instanceof XWActivity ) {
|
||||
((XWActivity)m_activity).show( df );
|
||||
} else {
|
||||
Assert.assertTrue( !BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -319,7 +319,7 @@ public class DictUtils {
|
|||
context.deleteFile( name );
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
|
||||
if ( null != path ) {
|
||||
|
@ -441,7 +441,7 @@ public class DictUtils {
|
|||
path = context.getFileStreamPath( name );
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
path = null;
|
||||
}
|
||||
return path;
|
||||
|
|
|
@ -279,7 +279,7 @@ public class DictsDelegate extends ListDelegateBase
|
|||
item.setComment( m_onServerStr );
|
||||
|
||||
} else {
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
|
||||
item.setText( name );
|
||||
|
@ -1029,7 +1029,7 @@ public class DictsDelegate extends ListDelegateBase
|
|||
++results[SEL_REMOTE];
|
||||
} else {
|
||||
Log.d( TAG, "obj is a: " + obj );
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
Log.i( TAG, "countSelDicts() => {loc: %d; remote: %d}",
|
||||
|
|
|
@ -177,7 +177,7 @@ abstract class DlgDelegateAlert extends XWDialogFragment {
|
|||
default:
|
||||
Log.e( TAG, "unexpected button %d", button );
|
||||
// ignore on release builds
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ public class DlgState implements Parcelable {
|
|||
if ( null != obj && !(obj instanceof Serializable) ) {
|
||||
Log.d( TAG, "OOPS: %s not Serializable",
|
||||
obj.getClass().getName() );
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ public class DlgState implements Parcelable {
|
|||
Assert.assertFalse(newState == this);
|
||||
if ( !this.equals(newState) ) {
|
||||
Log.d( TAG, "restore failed!!: %s => %s", this, newState );
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -305,7 +305,7 @@ public class GameConfigDelegate extends DelegateBase
|
|||
.show();
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
}, null, this );
|
||||
|
@ -527,7 +527,7 @@ public class GameConfigDelegate extends DelegateBase
|
|||
setLangSpinnerSelection( langName );
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -559,7 +559,7 @@ public class GameConfigDelegate extends DelegateBase
|
|||
private void loadGame( XwJNI.GamePtr gamePtr )
|
||||
{
|
||||
if ( null == gamePtr ) {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
} else {
|
||||
m_gameStarted = XwJNI.model_getNMoves( gamePtr ) > 0
|
||||
|| XwJNI.comms_isConnected( gamePtr );
|
||||
|
@ -775,7 +775,7 @@ public class GameConfigDelegate extends DelegateBase
|
|||
break;
|
||||
default:
|
||||
Log.w( TAG, "unknown v: " + view.toString() );
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
} // onClick
|
||||
|
@ -1047,7 +1047,7 @@ public class GameConfigDelegate extends DelegateBase
|
|||
default:
|
||||
Log.w( TAG, "setSmartnessSpinner got %d from getRobotSmartness()",
|
||||
m_gi.getRobotSmartness() );
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
m_smartnessSpinner.setSelection( setting );
|
||||
}
|
||||
|
@ -1058,7 +1058,7 @@ public class GameConfigDelegate extends DelegateBase
|
|||
case 1: return 13;
|
||||
case 2: return 11;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
@ -1078,7 +1078,7 @@ public class GameConfigDelegate extends DelegateBase
|
|||
selection = 2;
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
Assert.assertTrue( size == positionToSize(selection) );
|
||||
|
@ -1185,7 +1185,7 @@ public class GameConfigDelegate extends DelegateBase
|
|||
case FORCE_REMOTE:
|
||||
return R.layout.force_remote;
|
||||
}
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ public class GameListItem extends LinearLayout
|
|||
}
|
||||
break;
|
||||
default:
|
||||
Assert.assertFalse(BuildConfig.DEBUG);
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
if ( BuildConfig.DEBUG && ggi.m_count != children.size() ) {
|
||||
Log.e( TAG, "m_count: %d != size: %d",
|
||||
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 ) );
|
||||
result = item;
|
||||
} else {
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -1204,7 +1204,7 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
mkListAdapter();
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1267,7 +1267,7 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
long groupID = ((GameListGroup)obj).getGroupID();
|
||||
selected = m_mySIS.selGroupIDs.contains( groupID );
|
||||
} else {
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
selected = false;
|
||||
}
|
||||
return selected;
|
||||
|
@ -1685,7 +1685,7 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
long groupID = ((GameListGroup)targetView).getGroupID();
|
||||
selected = m_mySIS.selGroupIDs.contains( groupID );
|
||||
} else {
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
|
||||
if ( 0 != id ) {
|
||||
|
@ -1736,7 +1736,7 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
selIds[0] = ((GameListGroup)targetView).getGroupID();
|
||||
handled = handleSelGroupsItem( itemID, selIds );
|
||||
} else {
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2360,7 +2360,7 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
startNewNetGame( nli );
|
||||
result = true;
|
||||
} else {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
@ -2592,7 +2592,7 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
|
||||
if ( summary.conTypes.contains( CommsConnType.COMMS_CONN_RELAY )
|
||||
&& summary.roomName.length() == 0 ) {
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
} else {
|
||||
try {
|
||||
if ( checkWarnNoDict( rowid ) ) {
|
||||
|
|
|
@ -159,7 +159,7 @@ public class LookupAlertView extends LinearLayout
|
|||
} else if ( STATE_URLS == m_state ) {
|
||||
m_urlIndex = position;
|
||||
} else {
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
switchState( 1 );
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ public class LookupAlertView extends LinearLayout
|
|||
switchState( -1 );
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
} // switchState
|
||||
|
|
|
@ -115,7 +115,7 @@ public class MultiMsgSink implements TransportProcs {
|
|||
nSent = sendViaNFC( buf, gameID );
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
Log.i( TAG, "transportSend(): sent %d bytes for game %d/%x via %s",
|
||||
|
|
|
@ -293,7 +293,7 @@ public class NBSProto {
|
|||
break;
|
||||
default:
|
||||
Log.w( TAG, "unexpected cmd %s", msg.cmd );
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -364,7 +364,7 @@ public class NBSProto {
|
|||
} catch ( IllegalArgumentException iae ) {
|
||||
Log.w( TAG, "sendBuffers(%s): %s", phone, iae.toString() );
|
||||
} 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 ) {
|
||||
getHelper().postEvent( MultiEvent.SMS_SEND_FAILED_NOPERMISSION );
|
||||
} catch ( Exception ee ) {
|
||||
|
|
|
@ -108,7 +108,7 @@ public class NFCCardService extends HostApduService {
|
|||
}
|
||||
}
|
||||
} catch ( IOException ioe ) {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ public class NFCCardService extends HostApduService {
|
|||
}
|
||||
}
|
||||
} catch ( IOException ioe ) {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
byte[] result = baos.toByteArray();
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ public class NFCUtils {
|
|||
intent.setAction( NFC_TO_SELF_ACTION )
|
||||
.putExtra( NFC_TO_SELF_DATA, data );
|
||||
} else {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -168,7 +168,7 @@ public class NFCUtils {
|
|||
}
|
||||
result = baos.toByteArray();
|
||||
} catch ( IOException ioe ) {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
Log.d( TAG, "formatMsgs(gameID=%d) => %s", gameID, DbgUtils.hexDump( result ) );
|
||||
|
@ -429,12 +429,12 @@ public class NFCUtils {
|
|||
break;
|
||||
default:
|
||||
Log.e( TAG, "unexpected reply %d", body[0] );
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -492,7 +492,7 @@ public class NFCUtils {
|
|||
dos.writeInt( num );
|
||||
dos.flush();
|
||||
} catch ( IOException ioe ) {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
result = baos.toByteArray();
|
||||
}
|
||||
|
@ -692,7 +692,7 @@ public class NFCUtils {
|
|||
}
|
||||
}
|
||||
} catch ( IOException ioe ) {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -736,7 +736,7 @@ public class NFCUtils {
|
|||
}
|
||||
remember( msgID, token );
|
||||
} catch ( IOException ioe ) {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -154,7 +154,7 @@ public class NagTurnReceiver extends BroadcastReceiver {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -223,7 +223,7 @@ public class NetLaunchInfo implements Serializable {
|
|||
default:
|
||||
doAdd = false;
|
||||
Log.d( TAG, "unexpected type: %s", typ );
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
if ( doAdd ) {
|
||||
m_addrs.add( typ );
|
||||
|
@ -301,7 +301,7 @@ public class NetLaunchInfo implements Serializable {
|
|||
addNFCInfo();
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -457,7 +457,7 @@ public class NetLaunchInfo implements Serializable {
|
|||
case COMMS_CONN_NFC:
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -516,7 +516,7 @@ public class NetLaunchInfo implements Serializable {
|
|||
break;
|
||||
default:
|
||||
doAdd = false;
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
if ( doAdd ) {
|
||||
m_addrs.add( typ );
|
||||
|
@ -654,14 +654,14 @@ public class NetLaunchInfo implements Serializable {
|
|||
das.writeUTF( makeLaunchJSON() );
|
||||
result = bas.toByteArray();
|
||||
} catch ( java.io.IOException ex ) {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void putExtras( Intent intent, int gameID, String btAddr )
|
||||
{
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
|
||||
public void freezeAddrs()
|
||||
|
|
|
@ -112,7 +112,7 @@ public class NetUtils {
|
|||
}
|
||||
}
|
||||
} catch ( JSONException ex ) {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ public class Perms23 {
|
|||
PackageManager.GET_PERMISSIONS )
|
||||
.requestedPermissions;
|
||||
if ( pis == null ) {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
} else {
|
||||
String manifestName = perm.getString();
|
||||
for ( int ii = 0; !result && ii < pis.length; ++ii ) {
|
||||
|
@ -456,7 +456,7 @@ public class Perms23 {
|
|||
break;
|
||||
default:
|
||||
Log.e( TAG, "bannedWithWorkaround(): unexpected perm %s", perm );
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -151,8 +151,8 @@ public class PrefsActivity extends PreferenceActivity
|
|||
return getIntent().getExtras();
|
||||
}
|
||||
|
||||
public boolean inDPMode() { Assert.fail(); return false; }
|
||||
public void addFragment( XWFragment fragment, Bundle extras ) { Assert.fail(); }
|
||||
public boolean inDPMode() { Assert.failDbg(); return false; }
|
||||
public void addFragment( XWFragment fragment, Bundle extras ) { Assert.failDbg(); }
|
||||
public void addFragmentForResult( XWFragment fragment, Bundle extras,
|
||||
RequestCode code ) { Assert.fail(); }
|
||||
RequestCode code ) { Assert.failDbg(); }
|
||||
}
|
||||
|
|
|
@ -237,7 +237,7 @@ public class PrefsDelegate extends DelegateBase
|
|||
makeOkOnlyBuilder( R.string.after_restart ).show();
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -275,7 +275,7 @@ public class PrefsDelegate extends DelegateBase
|
|||
break;
|
||||
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -526,7 +526,7 @@ public class RelayService extends XWJIService
|
|||
stopSelf();
|
||||
break;
|
||||
default:
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -554,7 +554,7 @@ public class RelayService extends XWJIService
|
|||
s_UDPSocket = udpSocket;
|
||||
} catch( SocketException se ) {
|
||||
Log.ex( TAG, se );
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
} catch( java.net.UnknownHostException uhe ) {
|
||||
Log.ex( TAG, uhe );
|
||||
Log.e( TAG, "connectSocketOnce(): %s", uhe.getMessage() );
|
||||
|
@ -629,7 +629,7 @@ public class RelayService extends XWJIService
|
|||
long sentMS = packet.getSentMS();
|
||||
if ( prevSentMS > sentMS ) {
|
||||
Log.e( TAG, "error: prevSentMS: %d > sentMS: %d", prevSentMS, sentMS );
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -705,7 +705,7 @@ public class RelayService extends XWJIService
|
|||
CommsConnType.COMMS_CONN_RELAY,
|
||||
succeeded );
|
||||
} catch ( JSONException ex ) {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -785,7 +785,7 @@ public class RelayService extends XWJIService
|
|||
// DbgUtils.logf( "startFetchThreadIfNotUDP()" );
|
||||
boolean handled = relayEnabled( this ) && !BuildConfig.UDP_ENABLED;
|
||||
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() {
|
||||
@Override
|
||||
|
@ -804,7 +804,7 @@ public class RelayService extends XWJIService
|
|||
{
|
||||
while ( null != m_fetchThread ) {
|
||||
Log.w( TAG, "2: m_fetchThread NOT NULL; WHAT TO DO???" );
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
try {
|
||||
Thread.sleep( 20 );
|
||||
} catch( java.lang.InterruptedException ie ) {
|
||||
|
@ -1240,7 +1240,7 @@ public class RelayService extends XWJIService
|
|||
|
||||
private void fetchAndProcess()
|
||||
{
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
long[][] rowIDss = new long[1][];
|
||||
String[] relayIDs = DBUtils.getRelayIDs( this, rowIDss );
|
||||
if ( null != relayIDs && 0 < relayIDs.length ) {
|
||||
|
@ -1428,7 +1428,7 @@ public class RelayService extends XWJIService
|
|||
// Need to deal with this case by sending multiple
|
||||
// packets. It WILL happen.
|
||||
Log.w( TAG, "dropping send for lack of space; FIX ME!!" );
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
// got space; now write it
|
||||
|
@ -1594,7 +1594,7 @@ public class RelayService extends XWJIService
|
|||
startUDPReadThreadOnce();
|
||||
registerWithRelay( -1 );
|
||||
} else {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
stopUDPReadThread();
|
||||
startFetchThreadIfNotUDP();
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@ public class SMSInviteDelegate extends InviteDelegate {
|
|||
result = R.string.invite_sms_desc;
|
||||
break;
|
||||
default:
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -162,7 +162,7 @@ public class TilePickAlert extends XWDialogFragment
|
|||
DlgClickNotify notify = (DlgClickNotify)activity;
|
||||
notify.onPosButton( m_action, m_state, m_selTiles );
|
||||
} else {
|
||||
Assert.assertTrue( !BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ public class Toolbar implements BoardContainer.SizeChangeListener {
|
|||
} else if ( listener instanceof View.OnLongClickListener ) {
|
||||
button.setOnLongClickListener( (View.OnLongClickListener)listener );
|
||||
} else {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
return success;
|
||||
|
|
|
@ -684,7 +684,7 @@ public class Utils {
|
|||
result = base64Encode( bas.toByteArray() );
|
||||
} catch ( Exception ex ) {
|
||||
Log.ex( TAG, ex );
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ public class WiDirInviteDelegate extends InviteDelegate
|
|||
protected void onBarButtonClicked( int id )
|
||||
{
|
||||
// not implemented yet as there's no bar button
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -621,7 +621,7 @@ public class WiDirService extends XWService {
|
|||
break;
|
||||
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1163,7 +1163,7 @@ public class WiDirService extends XWService {
|
|||
}
|
||||
getMgr().requestGroupInfo( sChannel, sGroupListener );
|
||||
} else {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -261,13 +261,13 @@ public class XWActivity extends FragmentActivity
|
|||
|
||||
public void addFragment( XWFragment fragment, Bundle extras )
|
||||
{
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
|
||||
public void addFragmentForResult( XWFragment fragment, Bundle extras,
|
||||
RequestCode request )
|
||||
{
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
|
||||
protected void show( XWDialogFragment df )
|
||||
|
|
|
@ -92,7 +92,7 @@ public class XWConnAddrPreference extends DialogPreference {
|
|||
.show();
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,7 +139,7 @@ abstract class XWDialogFragment extends DialogFragment {
|
|||
if ( null != listener ) {
|
||||
listener.onClick( getDialog(), button );
|
||||
} else {
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -208,7 +208,7 @@ abstract class XWFragment extends Fragment implements Delegator {
|
|||
|
||||
public void finish()
|
||||
{
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
|
||||
public void setTitle() { m_dlgt.setTitle(); }
|
||||
|
|
|
@ -83,7 +83,7 @@ public class CommsAddrRec {
|
|||
case COMMS_CONN_NFC:
|
||||
id = R.string.invite_choice_nfc; break;
|
||||
default:
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
Assert.failDbg();
|
||||
}
|
||||
|
||||
return ( 0 == id ) ? toString() : LocUtils.getString( context, id );
|
||||
|
@ -408,7 +408,7 @@ public class CommsAddrRec {
|
|||
case COMMS_CONN_NFC:
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ public class DUtilCtxt {
|
|||
DevID.clearRelayDevID( m_context );
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -733,7 +733,7 @@ public class JNIThread extends Thread implements AutoCloseable {
|
|||
break;
|
||||
default:
|
||||
Log.w( TAG, "dropping cmd: %s", elem.m_cmd.toString() );
|
||||
Assert.fail();
|
||||
Assert.failDbg();
|
||||
}
|
||||
|
||||
if ( draw ) {
|
||||
|
|
Loading…
Add table
Reference in a new issue