|
|
|
@ -50,6 +50,7 @@ import com.todoroo.astrid.reminders.ReengagementService;
|
|
|
|
|
import com.todoroo.astrid.reminders.ReminderStartupReceiver;
|
|
|
|
|
import com.todoroo.astrid.service.abtesting.ABChooser;
|
|
|
|
|
import com.todoroo.astrid.service.abtesting.ABTestInvoker;
|
|
|
|
|
import com.todoroo.astrid.service.abtesting.ABTests;
|
|
|
|
|
import com.todoroo.astrid.utility.AstridPreferences;
|
|
|
|
|
import com.todoroo.astrid.utility.Constants;
|
|
|
|
|
import com.todoroo.astrid.widget.TasksWidget.WidgetUpdateService;
|
|
|
|
@ -93,6 +94,8 @@ public class StartupService {
|
|
|
|
|
|
|
|
|
|
@Autowired ABChooser abChooser;
|
|
|
|
|
|
|
|
|
|
@Autowired ABTests abTests;
|
|
|
|
|
|
|
|
|
|
@Autowired ABTestInvoker abTestInvoker;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -188,6 +191,15 @@ public class StartupService {
|
|
|
|
|
final int finalLatestVersion = latestSetVersion;
|
|
|
|
|
|
|
|
|
|
// For any uninitialized ab test, make sure an option is chosen
|
|
|
|
|
if (!AstridPreferences.useTabletLayout(context)
|
|
|
|
|
&& Preferences.getIntegerFromString(R.string.p_swipe_lists_performance_key, 0) == 0) { // Have to add this here because a non-null context is needed
|
|
|
|
|
abTests.addTest(ABTests.AB_SWIPE_BETWEEN, new int[] { 3, 1 },
|
|
|
|
|
new int[] { 3, 1 }, new String[] { "swipe-disabled", "swipe-enabled" }); //$NON-NLS-1$ //$NON-NLS-2$
|
|
|
|
|
|
|
|
|
|
// Haven't yet initialized this test--need to clear the pref once so setIfUnset will trigger correctly in setPreferenceDefaults
|
|
|
|
|
if (ABChooser.readChoiceForTest(ABTests.AB_SWIPE_BETWEEN) == ABChooser.NO_OPTION)
|
|
|
|
|
Preferences.clear(context.getString(R.string.p_swipe_lists_performance_key));
|
|
|
|
|
}
|
|
|
|
|
abChooser.makeChoicesForAllTests(latestSetVersion == 0, taskService.getUserActivationStatus());
|
|
|
|
|
|
|
|
|
|
abTestInvoker.reportAcquisition();
|
|
|
|
|