mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
cleanup: move db access into doInBackground()
This commit is contained in:
parent
5326d42438
commit
757c5b4ece
1 changed files with 5 additions and 6 deletions
|
@ -485,9 +485,7 @@ public class GameUtils {
|
|||
}
|
||||
|
||||
if ( force ) {
|
||||
HashMap<Long,CommsConnTypeSet> games =
|
||||
DBUtils.getGamesWithSendsPending( context );
|
||||
new ResendTask( context, games, filter, proc ).execute();
|
||||
new ResendTask( context, filter, proc ).execute();
|
||||
|
||||
System.arraycopy( sendTimes, 0, /* src */
|
||||
sendTimes, 1, /* dest */
|
||||
|
@ -1264,11 +1262,10 @@ public class GameUtils {
|
|||
private CommsConnType m_filter;
|
||||
private int m_nSent = 0;
|
||||
|
||||
public ResendTask( Context context, HashMap<Long,CommsConnTypeSet> games,
|
||||
CommsConnType filter, ResendDoneProc proc )
|
||||
public ResendTask( Context context, CommsConnType filter,
|
||||
ResendDoneProc proc )
|
||||
{
|
||||
m_context = context;
|
||||
m_games = games;
|
||||
m_filter = filter;
|
||||
m_doneProc = proc;
|
||||
}
|
||||
|
@ -1276,6 +1273,8 @@ public class GameUtils {
|
|||
@Override
|
||||
protected Void doInBackground( Void... unused )
|
||||
{
|
||||
m_games = DBUtils.getGamesWithSendsPending( m_context );
|
||||
|
||||
Iterator<Long> iter = m_games.keySet().iterator();
|
||||
while ( iter.hasNext() ) {
|
||||
long rowid = iter.next();
|
||||
|
|
Loading…
Reference in a new issue