|
@@ -1221,7 +1221,13 @@ public class HostageDBOpenHelper extends SQLiteOpenHelper {
|
|
|
|
|
|
record.setId(Integer.parseInt(cursor.getString(11)));
|
|
|
//record.setAttack_id(cursor.getLong(12));
|
|
|
- record.setType(MessageRecord.TYPE.valueOf(cursor.getString(13)));
|
|
|
+ String v = cursor.getString(13);
|
|
|
+ if (v != null && !v.equals("RECEIVE")) {
|
|
|
+ record.setType(TYPE.SEND);
|
|
|
+ //record.setType(MessageRecord.TYPE.valueOf(v));
|
|
|
+ } else {
|
|
|
+ record.setType(TYPE.RECEIVE);
|
|
|
+ }
|
|
|
record.setTimestamp(cursor.getLong(14));
|
|
|
record.setPacket(cursor.getString(15));
|
|
|
|
|
@@ -1883,7 +1889,7 @@ public class HostageDBOpenHelper extends SQLiteOpenHelper {
|
|
|
for (SyncDevice sDevice : updatedDevices){
|
|
|
String deviceID = sDevice.getDeviceID();
|
|
|
Long maxID = deviceMap.get(deviceID);
|
|
|
- String selectQuery = "SELECT * FROM " + AttackEntry.TABLE_NAME + " A " + " NATURAL JOIN " + PacketEntry.TABLE_NAME + " P "
|
|
|
+ String selectQuery = "SELECT * FROM " + AttackEntry.TABLE_NAME + " A " + " , " + PacketEntry.TABLE_NAME + " P "
|
|
|
+ " WHERE "
|
|
|
+" ( "
|
|
|
+ "A." + AttackEntry.COLUMN_NAME_ATTACK_ID + " = " + " P."+ PacketEntry.COLUMN_NAME_ATTACK_ID
|