merge with master
[platform/core/system/sync-agent.git] / src / fw-plugins / common-public / account / src / plugin_interface.c
index c170dde..850e660 100755 (executable)
@@ -59,7 +59,7 @@
 #define FW_CALENDAR    1
 #define FW_MEMO                        2
 #define FW_CONTENT_COUNT       3
-
+#define FW_TASK                                11
 #define MAX_ACCOUNT_COUNT      20
 
 static const char *agent_name = 0;
@@ -100,6 +100,7 @@ EXPORT_API void sync_agent_plugin_add_platform_account(int fw_account_id)
        int slp_contact_id = sync_agent_plugin_get_service_account_id(FW_CONTACT, fw_account_id);
        int slp_calendar_id = sync_agent_plugin_get_service_account_id(FW_CALENDAR, fw_account_id);
        int slp_memo_id = sync_agent_plugin_get_service_account_id(FW_MEMO, fw_account_id);
+       int slp_task_id = sync_agent_plugin_get_service_account_id(FW_TASK, fw_account_id);
 
        /*
         * if not existed ?
@@ -134,6 +135,16 @@ EXPORT_API void sync_agent_plugin_add_platform_account(int fw_account_id)
                _set_account_id_fw(FW_MEMO, slp_id, memo_index, fw_account_id);
        }
 
+       if (slp_task_id == -100) {
+               _set_account_id_service(FW_TASK, fw_account_id, slp_id);
+               int task_index = _increase_account_count_fw(FW_TASK, slp_id);
+               if (task_index < 1 || task_index > MAX_ACCOUNT_COUNT) {
+                       _DEBUG_ERROR("[account_plugIn] _increase_account_count_fw() returned OUT OF BOUND int !!!");
+                       return;
+               }
+               _set_account_id_fw(FW_TASK, slp_id, task_index, fw_account_id);
+       }
+
        _EXTERN_FUNC_EXIT;
 }