From 03b4ebf308b9173b0eb16721e4a34a13ff18c5ec Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Tue, 10 Jul 2012 20:16:52 -0700 Subject: [PATCH] Report ab test event info when updating tag members --- .../astrid/actfm/sync/ActFmSyncService.java | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java index b7644cd7a..269c2c3d8 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java @@ -431,14 +431,7 @@ public final class ActFmSyncService { } if (sharing) { - JSONArray abTestInfo = abTestEventReportingService.getTestsWithVariantsArray(); - try { - for (int i = 0; i < abTestInfo.length(); i++) { - params.add("ab_variants[]"); params.add(abTestInfo.getString(i)); - } - } catch (JSONException e) { - Log.e("Error parsing AB test info", abTestInfo.toString(), e); - } + addAbTestEventInfo(params); } if(Flags.checkAndClear(Flags.TAGS_CHANGED) || newlyCreated) { @@ -499,6 +492,17 @@ public final class ActFmSyncService { taskDao.saveExistingWithSqlConstraintCheck(task); } + private void addAbTestEventInfo(List params) { + JSONArray abTestInfo = abTestEventReportingService.getTestsWithVariantsArray(); + try { + for (int i = 0; i < abTestInfo.length(); i++) { + params.add("ab_variants[]"); params.add(abTestInfo.getString(i)); + } + } catch (JSONException e) { + Log.e("Error parsing AB test info", abTestInfo.toString(), e); + } + } + /** * Synchronize complete task with server * @param task id @@ -590,6 +594,9 @@ public final class ActFmSyncService { } params.add(array); } + + addAbTestEventInfo(params); + } catch (JSONException e) { throw new RuntimeException(e); }