AB test persistent reminders preference

pull/14/head
Sam Bosley 12 years ago
parent 1ec1cc53f5
commit fe3241022b

@ -31,6 +31,8 @@ import com.todoroo.astrid.dao.TaskDao;
import com.todoroo.astrid.dao.TaskDao.TaskCriteria; import com.todoroo.astrid.dao.TaskDao.TaskCriteria;
import com.todoroo.astrid.data.Task; import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.data.TaskApiDao; import com.todoroo.astrid.data.TaskApiDao;
import com.todoroo.astrid.service.abtesting.ABChooser;
import com.todoroo.astrid.service.abtesting.ABTests;
import com.todoroo.astrid.utility.Constants; import com.todoroo.astrid.utility.Constants;
@ -114,7 +116,8 @@ public final class ReminderService {
Preferences.setIfUnset(prefs, editor, r, R.string.p_rmd_default_random_hours, 0); Preferences.setIfUnset(prefs, editor, r, R.string.p_rmd_default_random_hours, 0);
Preferences.setIfUnset(prefs, editor, r, R.string.p_rmd_time, 18); Preferences.setIfUnset(prefs, editor, r, R.string.p_rmd_time, 18);
Preferences.setIfUnset(prefs, editor, r, R.string.p_rmd_nagging, true); Preferences.setIfUnset(prefs, editor, r, R.string.p_rmd_nagging, true);
Preferences.setIfUnset(prefs, editor, r, R.string.p_rmd_persistent, true); Preferences.setIfUnset(prefs, editor, r, R.string.p_rmd_persistent,
ABChooser.readChoiceForTest(ABTests.AB_TEST_PERSISTENT_REMINDERS) != 0);
editor.commit(); editor.commit();
preferencesInitialized = true; preferencesInitialized = true;

@ -119,7 +119,10 @@ public class ABTests {
bundles.put(testKey, bundle); bundles.put(testKey, bundle);
} }
private void initialize() { public static final String AB_TEST_PERSISTENT_REMINDERS = "android_persist_rmd"; //$NON-NLS-1$
private void initialize() {
addTest(AB_TEST_PERSISTENT_REMINDERS, new int[] { 1, 1 },
new int[] { 0, 1 }, new String[] { "rmd-not-persistent", "rmd-persistent" }); //$NON-NLS-1$ //$NON-NLS-2$
} }
} }

@ -20,6 +20,8 @@ import com.todoroo.astrid.core.PluginServices;
import com.todoroo.astrid.data.Task; import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.data.User; import com.todoroo.astrid.data.User;
import com.todoroo.astrid.service.ThemeService; import com.todoroo.astrid.service.ThemeService;
import com.todoroo.astrid.service.abtesting.ABChooser;
import com.todoroo.astrid.service.abtesting.ABTests;
public class AstridPreferences { public class AstridPreferences {
@ -64,6 +66,9 @@ public class AstridPreferences {
Preferences.setIfUnset(prefs, editor, r, R.string.p_ideas_tab_enabled, true); Preferences.setIfUnset(prefs, editor, r, R.string.p_ideas_tab_enabled, true);
Preferences.setIfUnset(prefs, editor, r, R.string.p_end_at_deadline, true); Preferences.setIfUnset(prefs, editor, r, R.string.p_end_at_deadline, true);
Preferences.setIfUnset(prefs, editor, r, R.string.p_rmd_persistent,
ABChooser.readChoiceForTest(ABTests.AB_TEST_PERSISTENT_REMINDERS) != 0);
if ("white-blue".equals(Preferences.getStringValue(R.string.p_theme))) { //$NON-NLS-1$ migrate from when white-blue wasn't the default if ("white-blue".equals(Preferences.getStringValue(R.string.p_theme))) { //$NON-NLS-1$ migrate from when white-blue wasn't the default
Preferences.setString(R.string.p_theme, ThemeService.THEME_WHITE); Preferences.setString(R.string.p_theme, ThemeService.THEME_WHITE);
} }

Loading…
Cancel
Save