Commit 79ead07d authored by Roberta's avatar Roberta

catch

parent 95e0f85f
...@@ -43,8 +43,8 @@ import java.util.List; ...@@ -43,8 +43,8 @@ import java.util.List;
* *
**/ **/
public class EncounterBasedCommunication { public class EncounterBasedCommunication {
public static final long CHANGE_EPOCH_TIME = 2*60000; public static final long CHANGE_EPOCH_TIME = 1*60000;
public static final long SCAN_BATCH_INTERVAL = (long) (2 * 60000); public static final long SCAN_BATCH_INTERVAL = (long) (1 * 60000);
public static final int REQUEST_ENABLE_BT = 1; public static final int REQUEST_ENABLE_BT = 1;
public static final int REQUEST_ACCESS_FINE_LOCATION = 2; public static final int REQUEST_ACCESS_FINE_LOCATION = 2;
private static final String TAG = EncounterBasedCommunication.class.getSimpleName(); private static final String TAG = EncounterBasedCommunication.class.getSimpleName();
......
...@@ -4,6 +4,7 @@ import android.content.ContentResolver; ...@@ -4,6 +4,7 @@ import android.content.ContentResolver;
import android.content.ContentValues; import android.content.ContentValues;
import android.content.Context; import android.content.Context;
import android.database.Cursor; import android.database.Cursor;
import android.database.sqlite.SQLiteConstraintException;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
...@@ -96,7 +97,11 @@ public class EncounterEntriesBridge extends AbstractEncountersBridge<MEncounterE ...@@ -96,7 +97,11 @@ public class EncounterEntriesBridge extends AbstractEncountersBridge<MEncounterE
values.put(PEncounterEntries.Columns.otherTopicHandle, ""); values.put(PEncounterEntries.Columns.otherTopicHandle, "");
values.put(PEncounterEntries.Columns.shouldPostNonceToLink, shouldPostNonceToLink); values.put(PEncounterEntries.Columns.shouldPostNonceToLink, shouldPostNonceToLink);
values.put(PEncounterEntries.Columns.userHandle, userHandle); values.put(PEncounterEntries.Columns.userHandle, userHandle);
context.getContentResolver().insert(EncounterHistoryAPM.getContentURI(EncounterHistoryAPM.encounterEntries), values); try {
context.getContentResolver().insert(EncounterHistoryAPM.getContentURI(EncounterHistoryAPM.encounterEntries), values);
} catch (SQLiteConstraintException e) {
Log.d(TAG, "Duplicate insert attempted");
}
} }
public void updateEndTime(long pkid, long endTime) { public void updateEndTime(long pkid, long endTime) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment