instrumentation

pull/14/head
Tim Su 14 years ago
parent e92ae2593a
commit d8762eca7c

@ -73,6 +73,7 @@ import com.todoroo.astrid.helper.TaskAdapterAddOnManager;
import com.todoroo.astrid.notes.NotesDecorationExposer;
import com.todoroo.astrid.notes.NotesPlugin;
import com.todoroo.astrid.service.StartupService;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.timers.TimerDecorationExposer;
import com.todoroo.astrid.utility.Constants;
@ -1033,6 +1034,9 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
if(onCompletedTaskListener != null)
onCompletedTaskListener.onCompletedTask(task, newState);
if(newState)
StatisticsService.reportEvent("task-completed-v2"); //$NON-NLS-1$
}
}

@ -22,6 +22,7 @@ import com.todoroo.astrid.data.TaskApiDao;
import com.todoroo.astrid.reminders.Notifications;
import com.todoroo.astrid.reminders.ReminderService;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.utility.AstridPreferences;
/**
* Data Access layer for {@link Task}-related operations.
@ -201,8 +202,14 @@ public class TaskDao extends DatabaseDao<Task> {
ContentValues values = item.getSetValues();
boolean result = super.createNew(item);
if(result)
if(result) {
StatisticsService.reportEvent("dao-task-created"); //$NON-NLS-1$
if(Preferences.getBoolean(AstridPreferences.P_FIRST_ACTION, true)) {
StatisticsService.reportEvent("user-first-task"); //$NON-NLS-1$
Preferences.setBoolean(AstridPreferences.P_FIRST_ACTION, false);
}
afterSave(item, values);
}
return result;
}
@ -271,7 +278,6 @@ public class TaskDao extends DatabaseDao<Task> {
* @param values
*/
private static void afterComplete(Task task, ContentValues values) {
StatisticsService.reportEvent("task-completed"); //$NON-NLS-1$
Notifications.cancelNotifications(task.getId());
}

@ -14,6 +14,8 @@ public class AstridPreferences {
private static final String P_CURRENT_VERSION = "cv"; //$NON-NLS-1$
public static final String P_FIRST_ACTION = "fa"; //$NON-NLS-1$
/** Set preference defaults, if unset. called at startup */
public static void setPreferenceDefaults() {
Context context = ContextManager.getContext();

Loading…
Cancel
Save