diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java b/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java index e2b33323f..1eded0215 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java @@ -60,9 +60,13 @@ import com.todoroo.astrid.data.User; import com.todoroo.astrid.helper.AsyncImageView; import com.todoroo.astrid.service.AstridDependencyInjector; import com.todoroo.astrid.service.MetadataService; +import com.todoroo.astrid.service.StatisticsConstants; +import com.todoroo.astrid.service.StatisticsService; import com.todoroo.astrid.service.TagDataService; import com.todoroo.astrid.service.TaskService; import com.todoroo.astrid.service.ThemeService; +import com.todoroo.astrid.service.abtesting.ABChooser; +import com.todoroo.astrid.service.abtesting.ABOptions; import com.todoroo.astrid.tags.TagService; import com.todoroo.astrid.ui.PeopleContainer; import com.todoroo.astrid.ui.PeopleContainer.OnAddNewPersonListener; @@ -93,6 +97,8 @@ public class EditPeopleControlSet extends PopupControlSet { @Autowired TagDataService tagDataService; + @Autowired ABChooser abChooser; + private final Fragment fragment; private final PeopleContainer sharedWithContainer; @@ -388,12 +394,18 @@ public class EditPeopleControlSet extends PopupControlSet { new JSONObject().put("default_picture", R.drawable.icn_friends) .put(CONTACT_CHOOSER_USER, true)); int contactsIndex = addUnassigned ? 2 : 1; - coreUsers.add(contactsIndex, contactPickerUser); + boolean addedContacts = true; + if (abChooser.getChoiceForOption(ABOptions.AB_OPTION_CONTACTS_PICKER_ENABLED) == 0) + coreUsers.add(contactsIndex, contactPickerUser); + else + addedContacts = false; for (AssignedChangedListener l : listeners) { if (l.shouldShowTaskRabbit()) { taskRabbitUser = new AssignedToUser(activity.getString(R.string.actfm_EPA_task_rabbit), new JSONObject().put("default_picture", R.drawable.task_rabbit_image)); int taskRabbitIndex = addUnassigned ? 3 : 2; + if (!addedContacts) + taskRabbitIndex--; coreUsers.add(taskRabbitIndex, taskRabbitUser); if(l.didPostToTaskRabbit()){ assignedIndex = taskRabbitIndex; @@ -782,6 +794,11 @@ public class EditPeopleControlSet extends PopupControlSet { task.putTransitory(TaskService.TRANS_ASSIGNED, true); + if (assignedView == assignedCustom) + StatisticsService.reportEvent(StatisticsConstants.TASK_ASSIGNED_EMAIL); + else if (task.getValue(Task.USER_ID) != Task.USER_ID_SELF) + StatisticsService.reportEvent(StatisticsConstants.TASK_ASSIGNED_PICKER); + if(sharedToast != null) toast = (toast != null) ? toast + "\n" + sharedToast : sharedToast + "\n"; showSaveToast(toast); diff --git a/astrid/src/com/todoroo/astrid/service/StatisticsConstants.java b/astrid/src/com/todoroo/astrid/service/StatisticsConstants.java index 6fc22418b..e442fcc98 100644 --- a/astrid/src/com/todoroo/astrid/service/StatisticsConstants.java +++ b/astrid/src/com/todoroo/astrid/service/StatisticsConstants.java @@ -48,6 +48,8 @@ public class StatisticsConstants { public static final String TASK_CREATED_TASKLIST = "task-created-tasklist"; public static final String ACTFM_LOGIN_SHOW = "actfm-login-show"; public static final String ACTFM_TASK_SHARED = "actfm-task-shared"; + public static final String TASK_ASSIGNED_EMAIL = "task-assigned-email"; + public static final String TASK_ASSIGNED_PICKER = "task-assigned-picker"; public static final String PRODUCTEEV_LOGIN = "producteev-login"; public static final String PRODUCTEEV_SIGNUP = "producteev-signup"; public static final String TASK_SNOOZE = "task-snooze"; diff --git a/astrid/src/com/todoroo/astrid/service/abtesting/ABOptions.java b/astrid/src/com/todoroo/astrid/service/abtesting/ABOptions.java index c322941ff..62d10a953 100644 --- a/astrid/src/com/todoroo/astrid/service/abtesting/ABOptions.java +++ b/astrid/src/com/todoroo/astrid/service/abtesting/ABOptions.java @@ -169,14 +169,26 @@ public class ABOptions { private void initialize() { // Set up //Calls to addOption go here addOption(AB_OPTION_SWIPE_ENABLED_KEY, AB_OPTION_SWIPE_ENABLED_PROBS, AB_OPTION_SWIPE_ENABLED_DESC, AB_OPTION_SWIPE_ENABLED_EVENTS); + addOption(AB_OPTION_CONTACTS_PICKER_ENABLED, AB_OPTION_CONTACTS_ENABLED_PROBS, AB_OPTION_CONTACTS_ENABLED_DESC, AB_OPTION_CONTACTS_ENABLED_EVENTS); } public static final String AB_OPTION_SWIPE_ENABLED_KEY = "swipeEnabled"; //$NON-NLS-1$ private static final int[] AB_OPTION_SWIPE_ENABLED_PROBS = { 1, 1 }; - @SuppressWarnings("nls") - private static final String[] AB_OPTION_SWIPE_ENABLED_DESC = { "swipe-lists-enabled", "swipe-lists-disabled" }; + private static final String[] AB_OPTION_SWIPE_ENABLED_DESC = { "swipe-lists-enabled", "swipe-lists-disabled" }; //$NON-NLS-1$//$NON-NLS-2$ private static final String[] AB_OPTION_SWIPE_ENABLED_EVENTS = { StatisticsConstants.APP_OPEN_THREE_DAYS, StatisticsConstants.APP_OPEN_ONE_WEEK, StatisticsConstants.APP_OPEN_TWO_WEEKS, StatisticsConstants.APP_OPEN_THREE_WEEKS }; + + public static final String AB_OPTION_CONTACTS_PICKER_ENABLED = "contactsEnabled"; //$NON-NLS-1$ + private static final int[] AB_OPTION_CONTACTS_ENABLED_PROBS = { 1, 1 }; + private static final String[] AB_OPTION_CONTACTS_ENABLED_DESC = { "contacts-enabled", "contacts-disabled" }; //$NON-NLS-1$//$NON-NLS-2$ + private static final String[] AB_OPTION_CONTACTS_ENABLED_EVENTS = { StatisticsConstants.APP_OPEN_THREE_DAYS, + StatisticsConstants.APP_OPEN_ONE_WEEK, + StatisticsConstants.APP_OPEN_TWO_WEEKS, + StatisticsConstants.APP_OPEN_THREE_WEEKS, + StatisticsConstants.TASK_ASSIGNED_EMAIL, + StatisticsConstants.TASK_ASSIGNED_PICKER }; + + }