Example #1
0
 public static ActFmSyncThread getInstance() {
   if (instance == null) {
     synchronized (ActFmSyncThread.class) {
       if (instance == null) {
         initializeSyncComponents(
             PluginServices.getTaskDao(),
             PluginServices.getTagDataDao(),
             PluginServices.getUserActivityDao(),
             PluginServices.getTaskAttachmentDao(),
             PluginServices.getTaskListMetadataDao());
       }
     }
   }
   return instance;
 }
Example #2
0
 private static NowBriefed<?> instantiateNowBriefed(JSONObject json) {
   String table = json.optString("table");
   if (NameMaps.TABLE_ID_TASKS.equals(table))
     return new NowBriefed<Task>(json, PluginServices.getTaskDao());
   else if (NameMaps.TABLE_ID_TAGS.equals(table))
     return new NowBriefed<TagData>(json, PluginServices.getTagDataDao());
   else if (NameMaps.TABLE_ID_USER_ACTIVITY.equals(table))
     return new NowBriefed<UserActivity>(json, PluginServices.getUserActivityDao());
   else if (NameMaps.TABLE_ID_USERS.equals(table))
     return new NowBriefed<User>(json, PluginServices.getUserDao());
   else if (NameMaps.TABLE_ID_ATTACHMENTS.equals(table))
     return new NowBriefed<TaskAttachment>(json, PluginServices.getTaskAttachmentDao());
   else if (NameMaps.TABLE_ID_TASK_LIST_METADATA.equals(table))
     return new NowBriefed<TaskListMetadata>(json, PluginServices.getTaskListMetadataDao());
   else return null;
 }