Finalize some ab tests

pull/14/head
Sam Bosley 12 years ago
parent 8ed243ed67
commit 166c143747

@ -242,6 +242,7 @@ public class StartupService {
}
}).start();
AstridPreferences.resetPreferencesFromAbTests(latestSetVersion);
AstridPreferences.setPreferenceDefaults();
CalendarStartupReceiver.scheduleCalendarAlarms(context, false); // This needs to be after set preference defaults for the purposes of ab testing

@ -119,10 +119,6 @@ public class ABTests {
bundles.put(testKey, bundle);
}
public static final String AB_SIMPLE_TASK_ROW = "android_simple_task_row"; //$NON-NLS-1$
public static final String AB_CALENDAR_REMINDERS = "android_cal_reminders"; //$NON-NLS-1$
public static final String AB_FEATURED_LISTS = "android_featured_lists"; //$NON-NLS-1$
public static final String AB_SOCIAL_REMINDERS = "android_social_reminders"; //$NON-NLS-1$
@ -136,12 +132,6 @@ public class ABTests {
addTest(AB_FEATURED_LISTS, new int[] { 1, 1 },
new int[] { 1, 1 }, new String[] { "featured-lists-disabled", "featured-lists-enabled" }); //$NON-NLS-1$ //$NON-NLS-2$
addTest(AB_SIMPLE_TASK_ROW, new int[] { 1, 1 },
new int[] { 1, 0 }, new String[] { "original-row-style", "simple-row-style" }); //$NON-NLS-1$ //$NON-NLS-2$
addTest(AB_CALENDAR_REMINDERS, new int[] { 3, 1 },
new int[] { 3, 1 }, new String[] { "no-cal-reminders", "show-cal-reminders" }); //$NON-NLS-1$ //$NON-NLS-2$
addTest(AB_SOCIAL_REMINDERS, new int[] { 1, 1 },
new int[] { 1, 1 }, new String[] { "no-faces", "show-faces" }); //$NON-NLS-1$ //$NON-NLS-2$

@ -24,6 +24,7 @@ import com.todoroo.astrid.data.TagData;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.data.User;
import com.todoroo.astrid.service.ThemeService;
import com.todoroo.astrid.service.UpgradeService;
import com.todoroo.astrid.service.abtesting.ABChooser;
import com.todoroo.astrid.service.abtesting.ABTests;
import com.todoroo.astrid.tags.reusable.FeaturedListFilterExposer;
@ -76,11 +77,9 @@ public class AstridPreferences {
Preferences.setIfUnset(prefs, editor, r, R.string.p_show_featured_lists,
ABChooser.readChoiceForTest(ABTests.AB_FEATURED_LISTS) != 0);
Preferences.setIfUnset(prefs, editor, r, R.string.p_taskRowStyle,
ABChooser.readChoiceForTest(ABTests.AB_SIMPLE_TASK_ROW) != 0);
Preferences.setIfUnset(prefs, editor, r, R.string.p_taskRowStyle, false);
Preferences.setIfUnset(prefs, editor, r, R.string.p_calendar_reminders,
ABChooser.readChoiceForTest(ABTests.AB_CALENDAR_REMINDERS) != 0);
Preferences.setIfUnset(prefs, editor, r, R.string.p_calendar_reminders, true);
Preferences.setIfUnset(prefs, editor, r, R.string.p_social_reminders,
ABChooser.readChoiceForTest(ABTests.AB_SOCIAL_REMINDERS) != 0);
@ -117,6 +116,17 @@ public class AstridPreferences {
editor.commit();
}
/**
* Reset preferences based on archived AB tests
* @param fromVersion
*/
public static void resetPreferencesFromAbTests(long fromVersion) {
Context context = ContextManager.getContext();
if (fromVersion < UpgradeService.V4_4_2) {
Preferences.clear(context.getString(R.string.p_calendar_reminders));
}
}
private static void setShowFriendsView() {
// Show friends view if necessary
boolean showFriends = false;

Loading…
Cancel
Save