cleanup: remove commented out code etc.

This commit is contained in:
Eric House 2016-06-28 06:05:31 -07:00
parent 3bc60c59d0
commit f66fa5f75a
14 changed files with 17 additions and 67 deletions

View file

@ -53,7 +53,6 @@ import org.eehouse.android.xw4.jni.CommsAddrRec.CommsConnType;
import org.eehouse.android.xw4.jni.CommsAddrRec;
import org.eehouse.android.xw4.jni.LastMoveInfo;
import org.eehouse.android.xw4.jni.XwJNI;
import org.eehouse.android.xw4.jni.JNIThread;
import org.eehouse.android.xw4.loc.LocUtils;
import org.eehouse.android.xw4.XWService.ReceiveResult;

View file

@ -155,7 +155,7 @@ public class BoardView extends View implements BoardHandler, SyncedDraw {
if ( m_boardDlgt.isPortrait() != (m_dims.height > m_dims.width) ) {
// square possible; will break above!
Assert.assertTrue( m_dims.height != m_dims.width );
DbgUtils.logf( "onMeasure: discarding m_dims" );
DbgUtils.logdf( "onMeasure: discarding m_dims" );
if ( ++m_dimsTossCount < 4 ) {
m_dims = null;
m_layoutWidth = m_layoutHeight = 0;
@ -204,7 +204,7 @@ public class BoardView extends View implements BoardHandler, SyncedDraw {
ConnStatusHandler.draw( m_context, canvas, getResources(),
m_connTypes, m_isSolo );
} else {
DbgUtils.logf( "BoardView.onDraw(): board not laid out yet" );
DbgUtils.logdf( "BoardView.onDraw(): board not laid out yet" );
}
}
}
@ -215,15 +215,15 @@ public class BoardView extends View implements BoardHandler, SyncedDraw {
final int height = getHeight();
boolean layoutDone = width == m_layoutWidth && height == m_layoutHeight;
if ( layoutDone ) {
DbgUtils.logf( "layoutBoardOnce(): layoutDone true" );
DbgUtils.logdf( "layoutBoardOnce(): layoutDone true" );
} else if ( null == m_gi ) {
// nothing to do either
DbgUtils.logf( "layoutBoardOnce(): no m_gi" );
DbgUtils.logdf( "layoutBoardOnce(): no m_gi" );
} else if ( null == m_jniThread ) {
// nothing to do either
DbgUtils.logf( "layoutBoardOnce(): no m_jniThread" );
DbgUtils.logdf( "layoutBoardOnce(): no m_jniThread" );
} else if ( null == m_dims ) {
DbgUtils.logf( "layoutBoardOnce(): null m_dims" );
DbgUtils.logdf( "layoutBoardOnce(): null m_dims" );
// m_canvas = null;
// need to synchronize??
Paint paint = new Paint();
@ -234,12 +234,12 @@ public class BoardView extends View implements BoardHandler, SyncedDraw {
int timerWidth = scratch.width();
int fontWidth =
Math.min(m_defaultFontHt, timerWidth / timerTxt.length());
DbgUtils.logf( "layoutBoardOnce(): posting JNICmd.CMD_LAYOUT(w=%d, h=%d)", width, height );
DbgUtils.logdf( "layoutBoardOnce(): posting JNICmd.CMD_LAYOUT(w=%d, h=%d)", width, height );
handle( JNIThread.JNICmd.CMD_LAYOUT, width, height,
fontWidth, m_defaultFontHt );
// We'll be back....
} else {
DbgUtils.logf( "layoutBoardOnce(): DOING IT" );
DbgUtils.logdf( "layoutBoardOnce(): DOING IT" );
// If board size has changed we need a new bitmap
int bmHeight = 1 + m_dims.height;
int bmWidth = 1 + m_dims.width;
@ -273,7 +273,7 @@ public class BoardView extends View implements BoardHandler, SyncedDraw {
m_layoutHeight = height;
layoutDone = true;
}
DbgUtils.logf( "layoutBoardOnce()=>%b", layoutDone );
DbgUtils.logdf( "layoutBoardOnce()=>%b", layoutDone );
return layoutDone;
} // layoutBoardOnce
@ -286,7 +286,7 @@ public class BoardView extends View implements BoardHandler, SyncedDraw {
public void startHandling( Activity parent, JNIThread thread,
CommsConnTypeSet connTypes )
{
DbgUtils.logf( "BoardView.startHandling(thread=%H)", thread );
DbgUtils.logdf( "BoardView.startHandling(thread=%H)", thread );
m_parent = parent;
m_jniThread = thread;
m_jniGamePtr = thread.getGamePtr();

View file

@ -66,7 +66,6 @@ public class ChatDelegate extends DelegateBase {
@Override
protected void init( Bundle savedInstanceState )
{
DbgUtils.logf( "ChatDelegate.init()" );
if ( BuildConstants.CHAT_SUPPORTED ) {
m_edit = (EditText)findViewById( R.id.chat_edit );
m_edit.addTextChangedListener( new TextWatcher() {
@ -103,7 +102,6 @@ public class ChatDelegate extends DelegateBase {
addRow( pair.msg, pair.playerIndx );
}
}
// scrollDown();
String title = getString( R.string.chat_title_fmt,
GameUtils.getName( m_activity, m_rowid ) );
@ -193,16 +191,7 @@ public class ChatDelegate extends DelegateBase {
m_edit.setText( null );
m_jniThreadRef.sendChat( text );
// if ( null != jniThread ) {
// jniThread.handle( JNIThread.JNICmd.CMD_SENDCHAT, text );
// } else {
// Intent result = new Intent();
// result.putExtra( BoardDelegate.INTENT_KEY_CHAT, text );
// setResult( Activity.RESULT_OK, result );
// finish();
// }
}
// finish();
break;
default:
handled = false;

View file

@ -160,7 +160,7 @@ public class GameLock {
if ( DEBUG_LOCKS ) {
DbgUtils.logf( "lock %H overlocked", this );
}
Assert.fail(); // firing
Assert.fail();
}
}
// DbgUtils.logf( "GameLock.lock(%s) done", m_path );

View file

@ -1126,14 +1126,6 @@ public class GameUtils {
return rint;
}
// public static void postSelfNotification( Context context, long rowid )
// {
// Assert.assertTrue( BuildConfig.DEBUG );
// Intent intent = GamesListDelegate.makeRowidIntent( context, rowid );
// Utils.postNotification( context, intent, "launch",
// String.format("%d", rowid), (int)rowid );
// }
public static void postMoveNotification( Context context, long rowid,
BackMoveResult bmr,
boolean isTurnNow )

View file

@ -919,7 +919,6 @@ public class GamesListDelegate extends ListDelegateBase
protected void init( Bundle savedInstanceState )
{
m_origTitle = getTitle();
Assert.assertTrue( m_origTitle.equals( getString(R.string.app_name) ) );
m_handler = new Handler();
// Next line useful if contents of DB are crashing app on start
@ -956,13 +955,6 @@ public class GamesListDelegate extends ListDelegateBase
getDictForLangIf();
} // init
// protected View onCreateView( Bundle savedInstanceState )
// {
// View result = inflate( R.layout.game_list );
// // init( savedInstanceState );
// return result;
// }
// called when we're brought to the front (probably as a result of
// notification)
protected void onNewIntent( Intent intent )
@ -1101,13 +1093,11 @@ public class GamesListDelegate extends ListDelegateBase
public void itemClicked( SelectableItem.LongClickHandler clicked,
GameSummary summary )
{
DbgUtils.logf( "GamesListDelegate.itemClicked()" );
// We need a way to let the user get back to the basic-config
// dialog in case it was dismissed. That way it to check for
// an empty room name.
if ( clicked instanceof GameListItem ) {
long rowid = ((GameListItem)clicked).getRowID();
DbgUtils.logf( "GamesListDelegate.itemClicked(%d)", rowid );
if ( ! m_launchedGames.contains( rowid ) ) {
showNotAgainDlgThen( R.string.not_again_newselect,
R.string.key_notagain_newselect,
@ -1325,7 +1315,7 @@ public class GamesListDelegate extends ListDelegateBase
@Override
public boolean onPrepareOptionsMenu( Menu menu )
{
int nGamesSelected = m_selGames.size(); // NPE!
int nGamesSelected = m_selGames.size();
int nGroupsSelected = m_selGroupIDs.size();
int groupCount = m_adapter.getGroupCount();
m_menuPrepared = 0 == nGamesSelected || 0 == nGroupsSelected;
@ -2276,12 +2266,6 @@ public class GamesListDelegate extends ListDelegateBase
{
boolean madeGame = DBUtils.ROWID_NOTFOUND != m_missingDictRowId;
if ( madeGame ) {
// if ( R.id.games_game_reset == m_missingDictMenuId ) {
// long[] rowIDs = { m_missingDictRowId };
// doConfirmReset( rowIDs );
// } else {
// launchGame( m_missingDictRowId );
// }
// save in case checkWarnNoDict needs to set them
long rowID = m_missingDictRowId;
int menuID = m_missingDictMenuId;
@ -2300,10 +2284,6 @@ public class GamesListDelegate extends ListDelegateBase
private void launchGame( long rowid, boolean invited )
{
// DbgUtils.logf( "launchGame(%d)", rowid );
// if ( ! m_launchedGames.contains( rowid ) ) {
// m_launchedGames.add( rowid );
// m_delegator.launchGame( rowid, invited );
if ( ! m_launchedGames.contains( rowid ) ) {
m_launchedGames.add( rowid );
if ( m_adapter.inExpandedGroup( rowid ) ) {
@ -2339,7 +2319,6 @@ public class GamesListDelegate extends ListDelegateBase
{
GameSummary summary = (GameSummary)params[1];
long rowid = (Long)params[0];
DbgUtils.logf( "GamesListDelegate.doOpenGame(%d)", rowid );
if ( summary.conTypes.contains( CommsAddrRec.CommsConnType.COMMS_CONN_RELAY )
&& summary.roomName.length() == 0 ) {

View file

@ -31,7 +31,7 @@ public class OnBootReceiver extends BroadcastReceiver {
{
if ( null != intent && null != intent.getAction()
&& intent.getAction().equals( Intent.ACTION_BOOT_COMPLETED ) ) {
DbgUtils.logf( "OnBootReceiver: got ACTION_BOOT_COMPLETED" );
DbgUtils.logdf( "OnBootReceiver: got ACTION_BOOT_COMPLETED" );
startTimers( context );
}
}

View file

@ -240,7 +240,6 @@ public class PrefsDelegate extends DelegateBase
@Override
public void dlgButtonClicked( Action action, int button, Object[] params )
{
DbgUtils.logf( "PrefsDelegate.dlgButtonClicked(%s)", action.toString() );
boolean handled = AlertDialog.BUTTON_POSITIVE == button;
if ( handled ) {
switch ( action ) {

View file

@ -555,7 +555,6 @@ public class RelayService extends XWService
DatagramPacket packet =
new DatagramPacket( buf, buf.length );
try {
Assert.assertTrue( relayEnabled( RelayService.this ) );
m_UDPSocket.receive( packet );
resetExitTimer();
gotPacket( packet );
@ -584,7 +583,6 @@ public class RelayService extends XWService
int port = XWPrefs.getDefaultRelayPort( this );
String host = XWPrefs.getDefaultRelayHost( this );
try {
Assert.assertTrue( relayEnabled( this ) );
m_UDPSocket = new DatagramSocket();
m_UDPSocket.setSoTimeout(30 * 1000); // timeout so we can log
@ -626,7 +624,6 @@ public class RelayService extends XWService
}
try {
Assert.assertTrue( relayEnabled( RelayService.this ) );
DatagramPacket outPacket = outData.assemble();
m_UDPSocket.send( outPacket );
int pid = outData.m_packetID;

View file

@ -85,9 +85,6 @@ public class SMSInviteDelegate extends InviteDelegate {
protected void init( Bundle savedInstanceState )
{
// super.init( R.id.button_invite, R.id.button_add,
// R.id.button_clear, R.id.invite_desc,
// R.string.invite_sms_desc_fmt );
String msg = getString( R.string.button_invite );
msg = getQuantityString( R.plurals.invite_sms_desc_fmt, m_nMissing,
m_nMissing, msg );

View file

@ -289,7 +289,7 @@ public class SMSService extends XWService {
return s_showToasts;
}
@Override // abstract
@Override
protected MultiMsgSink getSink( long rowid )
{
return new SMSMsgSink( this );

View file

@ -293,7 +293,6 @@ public class StudyListDelegate extends ListDelegateBase
}
}
DbgUtils.logf( "creating studylist adapter" );
ArrayAdapter<String> adapter = new
ArrayAdapter<String>( m_activity,
android.R.layout.simple_spinner_item,

View file

@ -38,7 +38,7 @@ public class XWApp extends Application {
public static final boolean REMATCH_SUPPORTED = true;
public static final boolean RELAYINVITE_SUPPORTED = false;
public static final boolean ATTACH_SUPPORTED = false;
public static final boolean LOG_LIFECYLE = true;
public static final boolean LOG_LIFECYLE = false;
public static final boolean DEBUG_EXP_TIMERS = false;
public static final boolean GCM_IGNORED = false;
public static final boolean UDP_ENABLED = true;

View file

@ -61,7 +61,6 @@ public class XWConnAddrPreference extends DialogPreference {
m_view.configure( XWPrefs.getAddrTypes( m_context ),
new ConnViaViewLayout.CheckEnabledWarner() {
public void warnDisabled( CommsConnType typ ) {
String msg;
switch( typ ) {
case COMMS_CONN_SMS:
activity.showConfirmThen( R.string.warn_sms_disabled,
@ -75,7 +74,7 @@ public class XWConnAddrPreference extends DialogPreference {
R.string.button_later,
Action.ENABLE_BT_DO );
case COMMS_CONN_RELAY:
msg = LocUtils
String msg = LocUtils
.getString( m_context, R.string
.warn_relay_disabled );
msg += "\n\n" + LocUtils