Browse Source

removed grouping of the unsynced attack records

Julien Clauter 9 years ago
parent
commit
e0ae5074e9

+ 3 - 1
src/de/tudarmstadt/informatik/hostage/persistence/HostageDBOpenHelper.java

@@ -1578,7 +1578,7 @@ public class HostageDBOpenHelper extends SQLiteOpenHelper {
                 +" ( "
                     + " A." + AttackEntry.COLUMN_NAME_DEVICE + " IN " + updatedDeviceMap.keySet()
                 + " ) "
-                + " GROUP BY " + AttackEntry.TABLE_NAME + "." + AttackEntry.COLUMN_NAME_DEVICE
+                //+ " GROUP BY " + AttackEntry.TABLE_NAME + "." + AttackEntry.COLUMN_NAME_DEVICE
                 + " ORDER BY " + AttackEntry.TABLE_NAME + "." + AttackEntry.COLUMN_NAME_SYNC_ID + " DESC";
         SQLiteDatabase db = this.getReadableDatabase();
         Cursor cursor = db.rawQuery(selectQuery, null);
@@ -1590,6 +1590,8 @@ public class HostageDBOpenHelper extends SQLiteOpenHelper {
                 // Adding record to list
                 if (record.getSync_id() > updatedDeviceMap.get(record.getDevice())) {
                     recordList.add(record);
+                } else {
+                    break;
                 }
             } while (cursor.moveToNext());
         }