getRelayIDs -> getRelayIDNoMsgs to allow option of querying all, even

those already flagged as having new data.  The idea is that there
might be still newer data available, e.g. chat messages, that should
be fetched.
This commit is contained in:
Andy2 2011-02-09 06:45:45 -08:00
parent cf65d9baec
commit b4d0774aa7

View file

@ -260,7 +260,7 @@ public class DBUtils {
return result; return result;
} }
public static String[] getRelayIDNoMsgs( Context context ) public static String[] getRelayIDs( Context context, boolean noMsgs )
{ {
String[] result = null; String[] result = null;
initDB( context ); initDB( context );
@ -269,8 +269,10 @@ public class DBUtils {
synchronized( s_dbHelper ) { synchronized( s_dbHelper ) {
SQLiteDatabase db = s_dbHelper.getReadableDatabase(); SQLiteDatabase db = s_dbHelper.getReadableDatabase();
String[] columns = { DBHelper.RELAYID }; String[] columns = { DBHelper.RELAYID };
String selection = DBHelper.RELAYID + " NOT null AND " String selection = DBHelper.RELAYID + " NOT null";
+ "NOT " + DBHelper.HASMSGS; if ( noMsgs ) {
selection += " AND NOT " + DBHelper.HASMSGS;
}
Cursor cursor = db.query( DBHelper.TABLE_NAME_SUM, columns, Cursor cursor = db.query( DBHelper.TABLE_NAME_SUM, columns,
selection, null, null, null, null ); selection, null, null, null, null );