cleanup after code review

This commit is contained in:
Eric House 2014-08-20 07:10:40 -07:00
parent a464b61a15
commit e7af6949fe
5 changed files with 11 additions and 29 deletions

View file

@ -288,13 +288,10 @@ public class DBUtils {
values.put( DBHelper.DICTLANG, summary.dictLang );
values.put( DBHelper.GAMEID, summary.gameID );
values.put( DBHelper.GAME_OVER, summary.gameOver? 1 : 0 );
// DbgUtils.logf("saveSummary(%d): lastMoveTime: %s", rowid,
// DbgUtils.secondsToDateStr(summary.lastMoveTime) );
values.put( DBHelper.LASTMOVE, summary.lastMoveTime );
long nextNag = summary.nextTurnIsLocal() ?
NagTurnReceiver.figureNextNag( 1000*(long)summary.lastMoveTime )
: 0;
DbgUtils.logf( "setting nag time for %d: %d", rowid, nextNag );
values.put( DBHelper.NEXTNAG, nextNag );
values.put( DBHelper.DICTLIST, summary.dictNames(DICTS_SEP) );
@ -1041,7 +1038,6 @@ public class DBUtils {
cursor.close();
db.close();
}
DbgUtils.logf( "getNextNag()=>%s", DbgUtils.millisToDateStr(result) );
return result;
}
@ -1061,7 +1057,6 @@ public class DBUtils {
updateStmt.bindLong( 1, info.m_nextNag );
updateStmt.bindLong( 2, info.m_rowid );
updateStmt.execute();
DbgUtils.logf( "updated rowid %d nextnag to %d", info.m_rowid, info.m_nextNag );
}
db.close();
}
@ -1150,7 +1145,6 @@ public class DBUtils {
String query = "SELECT rowid, groupname as groups_groupname, "
+ " groups.expanded as groups_expanded FROM groups";
DbgUtils.logf( "query: %s", query );
initDB( context );
synchronized( s_dbHelper ) {
@ -1276,7 +1270,6 @@ public class DBUtils {
cursor.close();
db.close();
}
DbgUtils.logf( "DBUtils.countGames()=>%d", result );
return result;
}

View file

@ -145,17 +145,17 @@ public class DbgUtils {
}
}
public static String secondsToDateStr( long seconds )
{
return millisToDateStr( seconds * 1000 );
}
// public static String secondsToDateStr( long seconds )
// {
// return millisToDateStr( seconds * 1000 );
// }
public static String millisToDateStr( long millis )
{
Time tim = new Time();
tim.set( millis );
return tim.format2445();
}
// public static String millisToDateStr( long millis )
// {
// Time tim = new Time();
// tim.set( millis );
// return tim.format2445();
// }
// public static String toString( long[] longs )
// {

View file

@ -48,7 +48,6 @@ public class NagTurnReceiver extends BroadcastReceiver {
@Override
public void onReceive( Context context, Intent intent )
{
DbgUtils.logf( "NagTurnReceiver.onReceive() called" );
// loop through all games testing who's been sitting on a turn
NeedsNagInfo[] needNagging = DBUtils.getNeedNagging( context );
if ( null != needNagging ) {
@ -89,7 +88,6 @@ public class NagTurnReceiver extends BroadcastReceiver {
private static void restartTimer( Context context, long atMillis )
{
DbgUtils.logf( "NagTurnReceiver.restartTimer() called" );
AlarmManager am =
(AlarmManager)context.getSystemService( Context.ALARM_SERVICE );
@ -97,8 +95,6 @@ public class NagTurnReceiver extends BroadcastReceiver {
PendingIntent pi = PendingIntent.getBroadcast( context, 0, intent, 0 );
long now = new Date().getTime(); // in milliseconds
DbgUtils.logf( "NagTurnReceiver: setting alarm %d seconds in future",
(atMillis - now) / 1000 );
am.set( AlarmManager.RTC, atMillis, pi );
}
@ -123,8 +119,6 @@ public class NagTurnReceiver extends BroadcastReceiver {
}
}
DbgUtils.logf( "figureNextNag => %d (%s)", result,
DbgUtils.millisToDateStr(result) );
return result;
}
}

View file

@ -21,8 +21,6 @@ package org.eehouse.android.xw4;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Activity;
import android.app.ListActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
@ -38,10 +36,9 @@ import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Spinner;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.Iterator;
import java.util.Set;
import junit.framework.Assert;

View file

@ -63,8 +63,6 @@ public class LocItemEditDelegate extends DelegateBase implements TextWatcher {
protected void init( Bundle savedInstanceState )
{
// setContentView( R.layout.loc_item_edit );
String key = getIntent().getStringExtra( KEY );
m_key = key;