diff --git a/astrid/src/com/todoroo/astrid/dao/ABTestEventDao.java b/astrid/src/com/todoroo/astrid/dao/ABTestEventDao.java index 0ecb9bfbf..0083ed19c 100644 --- a/astrid/src/com/todoroo/astrid/dao/ABTestEventDao.java +++ b/astrid/src/com/todoroo/astrid/dao/ABTestEventDao.java @@ -57,6 +57,7 @@ public class ABTestEventDao extends DatabaseDao { long now = DateUtilities.now(); for (int i = lastRecordedTimeIntervalIndex + 1; i <= currentTimeIntervalIndex; i++) { item.clearValue(ABTestEvent.ID); + item.setValue(ABTestEvent.REPORTED, 0); item.setValue(ABTestEvent.TIME_INTERVAL, ABTestEvent.TIME_INTERVALS[i]); item.setValue(ABTestEvent.DATE_RECORDED, now); createNew(item); diff --git a/astrid/src/com/todoroo/astrid/data/ABTestEvent.java b/astrid/src/com/todoroo/astrid/data/ABTestEvent.java index 476484d0b..06aa942af 100644 --- a/astrid/src/com/todoroo/astrid/data/ABTestEvent.java +++ b/astrid/src/com/todoroo/astrid/data/ABTestEvent.java @@ -84,14 +84,20 @@ public class ABTestEvent extends AbstractModel { public static final LongProperty DATE_RECORDED = new LongProperty( TABLE, "dateRecorded"); + /** Whether or not this data point has been reported to the server */ + public static final IntegerProperty REPORTED = new IntegerProperty( + TABLE, "reported"); // 0 if not yet reported, 1 if reported successfully + /** List of all properties for this model */ public static final Property[] PROPERTIES = generateProperties(Task.class); - private static final ContentValues defaultValues = new ContentValues(); + private static final ContentValues defaultValues = new ContentValues(); + static { // initialize with default values + defaultValues.put(REPORTED.name, 0); } @Override