merge from tizen_2.4. 69/42969/1 accepted/tizen/mobile/20150707.035219 submit/tizen_mobile/20150706.121110
authorjiseob.jang <jiseob.jang@samsung.com>
Mon, 6 Jul 2015 11:28:16 +0000 (20:28 +0900)
committerjiseob.jang <jiseob.jang@samsung.com>
Mon, 6 Jul 2015 11:28:16 +0000 (20:28 +0900)
Change-Id: Iaf9a2871897b06b734ce3822a3cdec30daacfc5c
Signed-off-by: jiseob.jang <jiseob.jang@samsung.com>
29 files changed:
CMakeLists.txt [changed mode: 0755->0644]
INSTALL [deleted file]
LICENSE [changed mode: 0755->0644]
TC/utc-accounts-svc.c [deleted file]
accounts-svc.pc.in [deleted file]
include/account-error.h [changed mode: 0755->0644]
include/account-types.h [changed mode: 0755->0644]
include/account.h [changed mode: 0755->0644]
include/account_PG.h [changed mode: 0755->0644]
include/account_internal.h
include/account_product.h [changed mode: 0755->0644]
libaccount-service.manifest [new file with mode: 0644]
packaging/.libaccount-service.spec.swp [new file with mode: 0644]
packaging/libaccount-service.spec [changed mode: 0755->0644]
src/CMakeLists.txt [new file with mode: 0644]
src/account.c [new file with mode: 0644]
src/account_offline.c [new file with mode: 0644]
src/account_private_client.h [new file with mode: 0644]
src/accounts-svc.pc.in [new file with mode: 0644]
src/accounts/CMakeLists.txt [deleted file]
src/accounts/account_mgr.xml [deleted file]
src/accounts/accounts-svc.pc.in [deleted file]
src/accounts/client/CMakeLists.txt [deleted file]
src/accounts/client/account.c [deleted file]
src/accounts/client/accounts-svc.pc.in [deleted file]
src/accounts/common/account-private.h [deleted file]
src/accounts/common/account_ipc_marshal.c [deleted file]
src/accounts/common/account_ipc_marshal.h [deleted file]
src/accounts/common/dbg.h [deleted file]

old mode 100755 (executable)
new mode 100644 (file)
index b05275c..df26e00
@@ -2,10 +2,10 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(accounts-svc C)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-SET(EXEC_PREFIX "\${prefix}")
+SET(EXEC_PREFIX ${_prefix})
 #SET(LIBDIR "\${prefix}/lib")
 #SET(INCLUDEDIR "\${prefix}/include ")
 SET(VERSION_MAJOR 0)
 SET(VERSION "${VERSION_MAJOR}.3.0")
 
-ADD_SUBDIRECTORY(src/accounts)
+ADD_SUBDIRECTORY(src)
diff --git a/INSTALL b/INSTALL
deleted file mode 100755 (executable)
index ddf4e78..0000000
--- a/INSTALL
+++ /dev/null
@@ -1,33 +0,0 @@
-1. make the build directory
-
-  ex) 
-
-   $ mkdir build
-
-
-2. change the working directory to the build directory
-
-  ex)
-
-   $ cd build
-
-
-3. run 'cmake'
-
-  $ cmake ${SOURCE_DIR} -DCMAKE_INSTALL_PREFIX=/usr
-
-  ex)
-
-   $ cmake .. -DCMAKE_INSTALL_PREFIX=/usr
-
-   or
-
-   $ cmake ..
-
-
-4. make & make install
-
-  ex)
-
-   $ make -j 2 && make install
-
diff --git a/LICENSE b/LICENSE
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/TC/utc-accounts-svc.c b/TC/utc-accounts-svc.c
deleted file mode 100644 (file)
index 0466804..0000000
+++ /dev/null
@@ -1,4776 +0,0 @@
-#include "assert.h"
-#include <account.h>
-#include <account_internal.h>
-#include <account-types.h>
-#include <account-error.h>
-#include <string.h>
-#include <glib.h>
-
-#define TEST_PACKAGE_NAME               "core-accounts-svc-tests"      // app_id
-#define USER_NAME                                              "user_name"
-#define ICON_PATH                                              "/usr/share/icons/default/small/com.samsung.phone.png"
-
-#define check_fail(exp) \
-       if (!(exp)) { \
-               _is_fail = true; \
-               FILE *fp = fopen(ERR_LOG,"w"); \
-                       fprintf(fp, \
-                               "Assert fail in %s:%d\n", __FILE__, __LINE__); \
-                       fprintf(fp, \
-                               "Following expression is not true:\n" \
-                               "%s\n", #exp); \
-                       fclose(fp); \
-               return false; \
-       }
-
-#define check_fail_eq(var, ref) \
-       if (var != ref) { \
-               FILE *fp = fopen(ERR_LOG,"w"); \
-                       fprintf(fp, \
-                               "Assert fail in %s:%d\n", __FILE__, __LINE__); \
-                       fprintf(fp, \
-                               "Values \"%s\" and \"%s\" are not equal:\n" \
-                               "%s == %d, %s == %d\n", \
-                               #var, #ref, #var, (int)var, #ref, (int)ref); \
-                       fclose(fp); \
-               return false; \
-       }
-
-
-#define is_callback_fail() \
-       if (_is_fail == true) \
-               return 1;
-
-//& set: AccountsSvc
-static bool connected = false;
-static bool created = false;
-static account_h account = NULL;
-static GMainLoop* mainloop = NULL;
-static int _is_fail = true;
-static const char* package_name = TEST_PACKAGE_NAME;
-static const char* icon_path = ICON_PATH;
-static const char* label_default = "AccountTest";
-static const char* label_en_gb = "Application en-gb Test";
-static const char* contact_capability = ACCOUNT_SUPPORTS_CAPABILITY_CONTACT;
-static const char* calendar_capability = ACCOUNT_SUPPORTS_CAPABILITY_CALENDAR;
-static const char* user_name = USER_NAME;
-static const account_capability_state_e capability_state = ACCOUNT_CAPABILITY_ENABLED;
-
-static gboolean timeout_cb(gpointer data) {
-       printf("timeout!\n");
-       _is_fail = true;
-       g_main_loop_quit((GMainLoop*)data);
-       return FALSE;
-}
-
-void utc_account_startup(void)
-{
-       account_type_h account_type = NULL;
-       int account_type_id = -1;
-       int ret1 = ACCOUNT_ERROR_NONE, ret2 = ACCOUNT_ERROR_NONE;
-       ret1 = account_connect();
-       if (ACCOUNT_ERROR_NONE == ret1) {
-               connected = true;
-               ret2 = account_create(&account);
-               if (ACCOUNT_ERROR_NONE == ret2) {
-                       created = true;
-               }
-       }
-
-       if(account_type_query_app_id_exist(package_name) == ACCOUNT_ERROR_RECORD_NOT_FOUND) {
-               ret1 = account_type_create(&account_type);
-               assert_eq(ret1, ACCOUNT_ERROR_NONE);
-
-               ret1 = account_type_set_app_id_internal(account_type, package_name);
-               assert_eq(ret1, ACCOUNT_ERROR_NONE);
-
-               ret1 = account_type_set_service_provider_id_internal(account_type, "http://www.samsung.com/");
-               assert_eq(ret1, ACCOUNT_ERROR_NONE);
-
-               ret1 = account_type_set_multiple_account_support_internal(account_type, true);
-               assert_eq(ret1, ACCOUNT_ERROR_NONE);
-
-               ret1 = account_type_set_label_internal(account_type, label_default, NULL);
-               assert_eq(ret1, ACCOUNT_ERROR_NONE);
-
-               ret1 = account_type_set_label_internal(account_type, label_en_gb, "en_GB");
-               assert_eq(ret1, ACCOUNT_ERROR_NONE);
-
-               ret1 = account_type_set_icon_path_internal(account_type, icon_path);
-               assert_eq(ret1, ACCOUNT_ERROR_NONE);
-
-               ret1 = account_type_set_small_icon_path_internal(account_type, icon_path);
-               assert_eq(ret1, ACCOUNT_ERROR_NONE);
-
-               ret1 = account_type_set_provider_feature_internal(account_type, contact_capability);
-               assert_eq(ret1, ACCOUNT_ERROR_NONE);
-
-               ret1 = account_type_set_provider_feature_internal(account_type, calendar_capability);
-               assert_eq(ret1, ACCOUNT_ERROR_NONE);
-
-               ret1 = account_type_insert_to_db_internal(account_type, &account_type_id);
-               assert_eq(ret1, ACCOUNT_ERROR_NONE);
-
-               ret1 = account_type_destroy(account_type);
-               assert_eq(ret1, ACCOUNT_ERROR_NONE);
-       }
-}
-
-void utc_account_cleanup(void)
-{
-       int ret1 = ACCOUNT_ERROR_NONE, ret2 = ACCOUNT_ERROR_NONE;
-       ret1 = account_destroy(account);
-       if (ACCOUNT_ERROR_NONE == ret1) {
-               created = false;
-               ret2 = account_disconnect();
-               if (ACCOUNT_ERROR_NONE == ret2) {
-                       connected = false;
-               }
-       }
-}
-
-static void _account_free_text(char *text)
-{
-       if (text != NULL) {
-               free(text);
-               text = NULL;
-       }
-}
-
-int utc_account_connect_p(void)
-{
-       assert(connected);
-
-       return 0;
-}
-
-
-int utc_account_connect_n(void)
-{
-       /*
-          There is no way to test account_connect_n().
-        */
-       return 0;
-}
-
-int utc_account_connect_readonly_p(void)
-{
-       int ret = ACCOUNT_ERROR_NONE;
-       if(connected)
-       {
-               ret = account_disconnect();
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-       }
-
-       ret = account_connect_readonly();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_connect_readonly_n(void)
-{
-       /*
-          There is no way to test account_connect_readonly_n().
-        */
-       return 0;
-}
-
-int utc_account_disconnect_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       ret = account_disconnect();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_connect();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_disconnect_n(void)
-{
-       /*
-          There is no way to test account_disconnect_n().
-        */
-       return 0;
-}
-
-int utc_account_destroy_p(void)
-{
-       int ret = ACCOUNT_ERROR_NONE;
-       account_h account_data = NULL;
-       assert(connected);
-
-       ret = account_create(&account_data);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_destroy(account_data);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-
-int utc_account_destroy_n(void)
-{
-       assert(connected);
-       assert(created);
-       utc_account_cleanup();
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = rename("/opt/usr/dbspace/.account.db", "/opt/usr/dbspace/.account-tmp.db");
-
-       ret = rename("/opt/usr/dbspace/.account.db-journal", "/opt/usr/dbspace/.account-tmp.db-journal");
-
-       ret = account_destroy(NULL);
-
-       assert_neq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = rename("/opt/usr/dbspace/.account-tmp.db", "/opt/usr/dbspace/.account.db");
-       ret = rename("/opt/usr/dbspace/.account-tmp.db-journal", "/opt/usr/dbspace/.account.db-journal");
-
-       utc_account_startup();
-
-       return 0;
-}
-
-
-int utc_account_create_p(void)
-{
-       assert(connected);
-       assert(created);
-
-       return 0;
-}
-
-int utc_account_create_n(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_create(NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_insert_to_db_p(void)
-{
-       assert(connected);
-       assert(created);
-       int account_id = -1;
-       int ret = ACCOUNT_ERROR_NONE;
-       char* ret_user_name = NULL;
-       char* ret_package_name = NULL;
-       const char* display_name = "display_name";
-       char* ret_display_name = NULL;
-       const char* icon_path = "icon_path";
-       char* ret_icon_path = NULL;
-       const char* domain_name = "domain_name";
-       char* ret_domain_name = NULL;
-       const char* email_address = "email_address";
-       char* ret_email_address = NULL;
-       const char* source = "source";
-       char* ret_source = NULL;
-       const char* key = "key";
-       const char* value = "value";
-       char* ret_value = NULL;
-       const char* user_text = "user_text";
-       char* ret_user_text = NULL;
-       const char* access_token = "access_token";
-       char* ret_access_token = NULL;
-       const account_auth_type_e auth_type = ACCOUNT_AUTH_TYPE_OAUTH;
-       const account_auth_type_e ret_auth_type = 0;
-       const account_capability_state_e capability_state = ACCOUNT_CAPABILITY_ENABLED;
-       const account_capability_state_e ret_capability_state = 0;
-       const account_secrecy_state_e secrecy_state = ACCOUNT_SECRECY_VISIBLE;
-       const account_secrecy_state_e ret_secrecy_state = 0;
-       const account_sync_state_e sync_state = ACCOUNT_SYNC_STATUS_OFF;
-       const account_sync_state_e ret_sync_state = 0;
-       account_h ret_account = NULL;
-       int i = -1;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_display_name(account, display_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_icon_path(account, icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_domain_name(account, domain_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_email_address(account, email_address);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_source(account, source);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_custom(account, key, value);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_capability(account, contact_capability, capability_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_access_token(account, access_token);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       for (i = 0; i < 5; i++){
-               ret = account_set_user_text(account, i, user_text);
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-       }
-
-       for (i = 0; i < 5; i++){
-               ret = account_set_user_int(account, i, i*10);
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-       }
-
-       ret = account_set_auth_type(account, auth_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_secret(account, secrecy_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_sync_support(account, sync_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_insert_to_db(account, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_destroy(account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_create(&ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_query_account_by_account_id(account_id, &ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_user_name(ret_account, &ret_user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_user_name, user_name), 0);
-       _account_free_text(ret_user_name);
-
-       ret = account_get_package_name(ret_account, &ret_package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_package_name, package_name), 0);
-       _account_free_text(ret_package_name);
-
-       ret = account_get_display_name(ret_account, &ret_display_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_display_name, display_name), 0);
-       _account_free_text(ret_display_name);
-
-       ret = account_get_icon_path(ret_account, &ret_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_icon_path, icon_path), 0);
-       _account_free_text(ret_icon_path);
-
-       ret = account_get_domain_name(ret_account, &ret_domain_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_domain_name, domain_name), 0);
-       _account_free_text(ret_domain_name);
-
-       ret = account_get_email_address(ret_account, &ret_email_address);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_email_address, email_address), 0);
-       _account_free_text(ret_email_address);
-
-       ret = account_get_source(ret_account, &ret_source);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_source, source), 0);
-       _account_free_text(ret_source);
-
-       ret = account_get_custom(ret_account, key, &ret_value);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_value, value), 0);
-       _account_free_text(ret_value);
-
-       ret = account_get_capability(ret_account, contact_capability, &ret_capability_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(ret_capability_state, capability_state);
-
-       ret = account_get_access_token(ret_account, &ret_access_token);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_access_token, access_token), 0);
-       _account_free_text(ret_access_token);
-
-       for (i = 0; i < 5; i++){
-               ret = account_get_user_text(ret_account, i, &ret_user_text);
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-               assert_eq(strcmp(ret_user_text, user_text), 0);
-               _account_free_text(ret_user_text);
-       }
-
-       for (i = 0; i < 5; i++){
-               int ret_user_int = -1;
-               ret = account_get_user_int(ret_account, i, &ret_user_int);
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-               assert_eq(ret_user_int, i*10);
-       }
-
-       ret = account_get_auth_type(ret_account, &ret_auth_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(ret_auth_type, auth_type);
-
-       ret = account_get_secret(ret_account, &ret_secrecy_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(ret_secrecy_state, secrecy_state);
-
-       ret = account_get_sync_support(ret_account, &ret_sync_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(ret_sync_state, sync_state);
-
-       ret = account_delete_from_db_by_id(account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_insert_to_db_n(void)
-{
-       assert(connected);
-       assert(created);
-       int account_id = -1;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_insert_to_db(NULL, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_insert_to_db(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_set_display_name_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* display_name = "display_name";
-
-       ret = account_set_display_name(account, display_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_set_display_name_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* display_name = "display_name";
-
-       ret = account_set_display_name(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_set_display_name(NULL, display_name);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_set_user_name_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_set_user_name_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_user_name(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_set_user_name(NULL, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_set_icon_path_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* icon_path = "icon_path";
-
-       ret = account_set_icon_path(account, icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_set_icon_path_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* icon_path = "icon_path";
-
-       ret = account_set_icon_path(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_set_icon_path(NULL, icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_set_domain_name_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* domain_name = "domain_name";
-
-       ret = account_set_domain_name(account, domain_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_set_domain_name_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* domain_name = "domain_name";
-
-       ret = account_set_domain_name(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_set_domain_name(NULL, domain_name);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_set_email_address_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* email_address = "email_address";
-
-       ret = account_set_email_address(account, email_address);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_set_email_address_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* email_address = "email_address";
-
-       ret = account_set_email_address(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_set_email_address(NULL, email_address);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_set_source_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* source = "source";
-
-       ret = account_set_source(account, source);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_set_source_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* source = "source";
-
-       ret = account_set_source(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_set_source(NULL, source);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_set_custom_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* key = "key";
-       const char* value = "value";
-
-       ret = account_set_custom(account, key, value);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_set_custom_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* key = "key";
-       const char* value = "value";
-
-       ret = account_set_custom(account, NULL, value);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_set_custom(account, key, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_set_custom(NULL, key, value);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_get_custom_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* key = "key";
-       const char* value = "value";
-       char* ret_value = NULL;
-
-       ret = account_set_custom(account, key, value);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_custom(account, key, &ret_value);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_value, value), 0);
-       _account_free_text(ret_value);
-
-    return 0;
-}
-
-int utc_account_get_custom_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       char* returned_val = NULL;
-
-       ret = account_get_custom(account, NULL, &returned_val);
-       free(returned_val);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-static bool account_custom_cb_func (char* key, char* value, void *user_data) {
-       const char* original_value = (const char*)user_data;
-       if(strcmp(value, original_value) == 0) {
-               _is_fail = false;
-       }
-//     g_main_loop_quit(mainloop);
-//     mainloop = NULL;
-
-       return true;
-}
-
-int utc_account_get_custom_all_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* key = "key";
-       const char* value = "value";
-
-       ret = account_set_custom(account, key, value);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-//     mainloop = g_main_loop_new(NULL, FALSE);
-//     assert(mainloop);
-       ret = account_get_custom_all(account, account_custom_cb_func, value);
-//     assert_eq(_is_fail, false);
-       is_callback_fail();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-//     int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-//     g_main_loop_run(mainloop);
-//     g_source_remove(timeout_id);
-       _is_fail = true;
-
-       return 0;
-}
-
-int utc_account_get_custom_all_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_get_custom_all(account, NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_custom_all(NULL, account_custom_cb_func, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_set_package_name_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_set_package_name_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_package_name(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_set_package_name(NULL, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_set_access_token_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* access_token = "access_token";
-
-       ret = account_set_access_token(account, access_token);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_set_access_token_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_access_token(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_set_auth_type_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_auth_type(account, ACCOUNT_AUTH_TYPE_OAUTH);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_set_auth_type_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_auth_type(account, -999);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_set_auth_type(NULL, ACCOUNT_AUTH_TYPE_OAUTH);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_set_secret_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_secret(account, ACCOUNT_SECRECY_INVISIBLE);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_set_secret_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_secret(account, -999);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_set_secret(NULL, ACCOUNT_SECRECY_INVISIBLE);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_set_sync_support_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_sync_support(account, ACCOUNT_SYNC_STATUS_IDLE);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_set_sync_support_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_sync_support(account, -999);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_set_sync_support(NULL, ACCOUNT_SYNC_STATUS_IDLE);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_set_user_text_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* user_text = "user_text";
-
-       int i;
-       for ( i = 0; i < 5; i++){
-               ret = account_set_user_text(account, i, user_text);
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-       }
-
-       return 0;
-}
-
-int utc_account_set_user_text_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* user_text = "user_text";
-
-       int i;
-       for (i = 0; i < 5; i++){
-               ret = account_set_user_text(account, i, NULL);
-               assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-       }
-       ret = account_set_user_text(account, 100, user_text);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_set_user_text(NULL, 1, user_text);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_set_user_int_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       int i;
-       for (i = 0; i < 5; i++){
-               ret = account_set_user_int(account, i, 999);
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-       }
-
-       return 0;
-}
-
-int utc_account_set_user_int_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       int i;
-       for (i = 0; i < 5; i++){
-               ret = account_set_user_int(NULL, i, 999);
-               assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-       }
-       ret = account_set_user_int(account, 100, 999);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_set_capability_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_capability(account, contact_capability, ACCOUNT_CAPABILITY_ENABLED);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-
-int utc_account_set_capability_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_capability(NULL, contact_capability, ACCOUNT_CAPABILITY_ENABLED);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_set_capability(account, NULL, ACCOUNT_CAPABILITY_ENABLED);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_set_capability(account, contact_capability, -1);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-static bool capability_cb_func (const char* capability_type, account_capability_state_e capability_state, void *user_data) {
-       account_capability_state_e* _capability_state = (account_capability_state_e*)user_data;
-       if(capability_state == *_capability_state)
-               _is_fail = false;
-//     g_main_loop_quit(mainloop);
-//     mainloop = NULL;
-
-       return true;
-}
-
-int utc_account_get_capability_all_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       const account_capability_state_e capability_state = ACCOUNT_CAPABILITY_ENABLED;
-
-       ret = account_set_capability(account, contact_capability, capability_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-//     mainloop = g_main_loop_new(NULL, FALSE);
-//     assert(mainloop);
-       ret = account_get_capability_all(account, capability_cb_func, &capability_state);
-//     assert_eq(_is_fail, false);
-       is_callback_fail();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-//     int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-//     g_main_loop_run(mainloop);
-//     g_source_remove(timeout_id);
-       _is_fail = true;
-
-       return 0;
-}
-
-int utc_account_get_capability_all_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_get_capability_all(NULL, capability_cb_func, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_capability_all(account, NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_get_display_name_p(void)
-{
-       assert(connected);
-       assert(created);
-       const char* display_name = "display_name";
-       char * ret_display_name = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_display_name(account, display_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_display_name(account, &ret_display_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_display_name, display_name), 0);
-       _account_free_text(ret_display_name);
-
-       return 0;
-}
-
-int utc_account_get_display_name_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       char * display_name;
-
-       ret = account_get_display_name(NULL, &display_name);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_display_name(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_get_account_id_p(void)
-{
-       assert(connected);
-       assert(created);
-       int account_id = -1;
-       int ret_account_id = -2;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_insert_to_db(account, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_query_account_by_account_id(account_id, &account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_account_id(account, &ret_account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(account_id, ret_account_id);
-
-       ret = account_delete_from_db_by_id(account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_get_account_id_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       int account_id = -1;
-
-       ret = account_get_account_id(NULL, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_account_id(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_get_user_name_p(void)
-{
-       assert(connected);
-       assert(created);
-       char *ret_user_name;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_user_name(account, &ret_user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_user_name, user_name), 0);
-       _account_free_text(ret_user_name);
-
-       return 0;
-}
-
-int utc_account_get_user_name_n(void)
-{
-       assert(connected);
-       assert(created);
-       char *get_user_name;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_get_user_name(NULL, &get_user_name);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_user_name(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_get_icon_path_p(void)
-{
-       assert(connected);
-       assert(created);
-       char *ret_icon_path = NULL;
-       const char* icon_path = "icon_path";
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_icon_path(account, icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_icon_path(account, &ret_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_icon_path, icon_path), 0);
-       _account_free_text(ret_icon_path);
-
-       return 0;
-}
-
-int utc_account_get_icon_path_n(void)
-{
-       assert(connected);
-       assert(created);
-       char *ret_icon_path;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_get_icon_path(NULL, &ret_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_icon_path(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_get_domain_name_p(void)
-{
-       assert(connected);
-       assert(created);
-       char *ret_domain_name;
-       const char* domain_name = "domain_name";
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_domain_name(account, domain_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_domain_name(account, &ret_domain_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_domain_name, domain_name), 0);
-       _account_free_text(ret_domain_name);
-
-       return 0;
-}
-
-int utc_account_get_domain_name_n(void)
-{
-       assert(connected);
-       assert(created);
-       char *domain_name;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_get_domain_name(NULL, &domain_name);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_domain_name(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_get_email_address_p(void)
-{
-       assert(connected);
-       assert(created);
-       char *ret_email_address;
-       const char* email_address = "email_address";
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_email_address(account, email_address);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_email_address(account, &ret_email_address);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_email_address, email_address), 0);
-       _account_free_text(ret_email_address);
-
-       return 0;
-}
-
-int utc_account_get_email_address_n(void)
-{
-       assert(connected);
-       assert(created);
-       char *ret_email_address;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_get_email_address(NULL, &ret_email_address);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_email_address(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_get_source_p(void)
-{
-       assert(connected);
-       assert(created);
-       char *ret_source = NULL;
-       const char* source = "source";
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_source(account, source);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_source(account, &ret_source);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_source, source), 0);
-       _account_free_text(ret_source);
-
-       return 0;
-}
-
-int utc_account_get_source_n(void)
-{
-       assert(connected);
-       assert(created);
-       char *ret_source = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_get_source(NULL, &ret_source);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_source(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_get_package_name_p(void)
-{
-       assert(connected);
-       assert(created);
-       char *ret_package_name = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_package_name(account, &ret_package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_package_name, package_name), 0);
-       _account_free_text(ret_package_name);
-
-       return 0;
-}
-
-int utc_account_get_package_name_n(void)
-{
-       assert(connected);
-       assert(created);
-       char *ret_package_name = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_get_package_name(NULL, &ret_package_name);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_package_name(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_get_access_token_p(void)
-{
-       assert(connected);
-       assert(created);
-       char *ret_access_token = NULL;
-       const char* access_token = "access_token";
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_access_token(account, access_token);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_access_token(account, &ret_access_token);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(access_token, ret_access_token), 0);
-       _account_free_text(ret_access_token);
-
-       return 0;
-}
-
-int utc_account_get_access_token_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       char *ret_access_token = NULL;
-
-       ret = account_get_access_token(NULL, &ret_access_token);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_access_token(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_get_auth_type_p(void)
-{
-       assert(connected);
-       assert(created);
-       account_auth_type_e auth_type;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_auth_type(account, ACCOUNT_AUTH_TYPE_XAUTH);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_auth_type(account, &auth_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(auth_type, ACCOUNT_AUTH_TYPE_XAUTH);
-
-       return 0;
-}
-
-int utc_account_get_auth_type_n(void)
-{
-       assert(connected);
-       assert(created);
-       account_auth_type_e auth_type;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_get_auth_type(NULL, &auth_type);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_auth_type(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_get_secret_p(void)
-{
-       assert(connected);
-       assert(created);
-       account_secrecy_state_e secret;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_secret(account, ACCOUNT_SECRECY_INVISIBLE);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_secret(account, &secret);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(secret, ACCOUNT_SECRECY_INVISIBLE);
-
-       return 0;
-}
-
-int utc_account_get_sync_support_p(void)
-{
-       assert(connected);
-       assert(created);
-       account_sync_state_e sync_support;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_sync_support(account, ACCOUNT_SYNC_STATUS_IDLE);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_sync_support(account, &sync_support);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(sync_support, ACCOUNT_SYNC_STATUS_IDLE);
-
-       return 0;
-}
-
-int utc_account_get_secret_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       account_secrecy_state_e secret;
-
-       ret = account_get_secret(NULL, &secret);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_secret(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_get_sync_support_n(void)
-{
-       assert(connected);
-       assert(created);
-       account_sync_state_e sync_support;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_get_sync_support(NULL, &sync_support);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_sync_support(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_get_user_text_p(void)
-{
-       assert(connected);
-       assert(created);
-       char *ret_user_text = NULL;
-       const char* user_text = "user_text";
-       int ret = ACCOUNT_ERROR_NONE;
-
-       int i;
-       for ( i = 0; i < 5; i++){
-               ret = account_set_user_text(account, i, user_text);
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-       }
-       for ( i = 0; i < 5; i++){
-               ret = account_get_user_text(account, i, &ret_user_text);
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-               assert_eq(strcmp(ret_user_text, user_text), 0);
-               _account_free_text(ret_user_text);
-       }
-
-       return 0;
-}
-
-int utc_account_get_user_text_n(void)
-{
-       assert(connected);
-       assert(created);
-       char *ret_user_text = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_get_user_text(NULL, 0, &ret_user_text);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_user_text(account, 100, &ret_user_text);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_user_text(account, 0, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_get_user_int_p(void)
-{
-       assert(connected);
-       assert(created);
-       int user_int;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       int i;
-       for (i = 0; i < 5; i++){
-               ret = account_set_user_int(account, i, i*10);
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-       }
-
-       for (i = 0; i < 5; i++){
-               ret = account_get_user_int(account, i, &user_int);
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-               assert_eq(user_int, i*10);
-       }
-
-       return 0;
-}
-
-int utc_account_get_user_int_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_get_user_int(NULL, 0, 100);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_user_int(account, 100, 100);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_user_int(account, 0, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-static bool capability_call_back(const char* capability_type, account_capability_state_e capability_state, void *user_data)
-{
-       char* str = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       check_fail(user_data!=NULL);
-       check_fail(capability_type!=NULL);
-       account_capability_state_e _capability_state = ACCOUNT_CAPABILITY_ENABLED;
-       account_h account_data = *((account_h*)user_data);
-       const char* capability = contact_capability;
-
-       ret = account_get_package_name(account_data, &str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(str, package_name)==0);
-
-       ret = account_get_user_name(account_data, &str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(str, user_name)==0);
-
-       check_fail(strcmp(capability_type, capability)==0);
-       ret = account_get_capability(account_data, capability, &_capability_state);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(_capability_state == capability_state);
-
-       _is_fail = false;
-
-//     g_main_loop_quit(mainloop);
-//     mainloop = NULL;
-
-       return 0;
-}
-
-int utc_account_get_capability_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       account_capability_state_e value;
-
-       ret = account_set_capability(account, contact_capability, ACCOUNT_CAPABILITY_ENABLED);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_capability(account, contact_capability, &value);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(value, ACCOUNT_CAPABILITY_ENABLED);
-
-       return 0;
-}
-
-int utc_account_get_capability_n(void)
-{
-       int ret = ACCOUNT_ERROR_NONE;
-       account_capability_state_e value;
-
-       ret = account_get_capability(NULL, contact_capability, &value);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_capability(account, NULL, &value);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_get_capability(account, contact_capability, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-static bool account_call_back(account_h account, void *user_data)
-{
-       const char* key = "key";
-       char* str = NULL;
-       char* comparison_str = NULL;
-       int value = -1;
-       int comparison_value = -1;
-       int ret = ACCOUNT_ERROR_NONE;
-       int i = -1;
-       check_fail(user_data!=NULL);
-       account_h _account = *((account_h*)user_data);
-
-       ret = account_get_package_name(_account, &str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_get_package_name(account, &comparison_str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(str, comparison_str)==0);
-       _account_free_text(str);
-       _account_free_text(comparison_str);
-
-       ret = account_get_user_name(_account, &str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_get_user_name(account, &comparison_str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(str, comparison_str)==0);
-       _account_free_text(str);
-       _account_free_text(comparison_str);
-
-       ret = account_get_display_name(_account, &str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_get_display_name(account, &comparison_str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(str, comparison_str)==0);
-       _account_free_text(str);
-       _account_free_text(comparison_str);
-
-       ret = account_get_icon_path(_account, &str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_get_icon_path(account, &comparison_str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(str, comparison_str)==0);
-       _account_free_text(str);
-       _account_free_text(comparison_str);
-
-       ret = account_get_domain_name(_account, &str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_get_domain_name(account, &comparison_str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(str, comparison_str)==0);
-       _account_free_text(str);
-       _account_free_text(comparison_str);
-
-       ret = account_get_email_address(_account, &str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_get_email_address(account, &comparison_str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(str, comparison_str)==0);
-       _account_free_text(str);
-       _account_free_text(comparison_str);
-
-       ret = account_get_email_address(_account, &str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_get_email_address(account, &comparison_str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(str, comparison_str)==0);
-       _account_free_text(str);
-       _account_free_text(comparison_str);
-
-       ret = account_get_source(_account, &str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_get_source(account, &comparison_str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(str, comparison_str)==0);
-       _account_free_text(str);
-       _account_free_text(comparison_str);
-
-       ret = account_get_custom(_account, key, &str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_get_custom(account, key, &comparison_str);
-       check_fail_eq(ret, ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(str, comparison_str)==0);
-       _account_free_text(str);
-       _account_free_text(comparison_str);
-
-       ret = account_get_capability(_account, contact_capability, &value);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_get_capability(account, contact_capability, &comparison_value);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(value == comparison_value);
-
-       ret = account_get_access_token(_account, &str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_get_access_token(account, &comparison_str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(str, comparison_str)==0);
-       _account_free_text(str);
-       _account_free_text(comparison_str);
-
-       for (i = 0; i < 5; i++){
-               ret = account_get_user_text(_account, i, &str);
-               check_fail(ret == ACCOUNT_ERROR_NONE);
-               ret = account_get_user_text(account, i, &comparison_str);
-               check_fail(ret == ACCOUNT_ERROR_NONE);
-               check_fail(strcmp(str, comparison_str)==0);
-               _account_free_text(str);
-               _account_free_text(comparison_str);
-       }
-
-       for (i = 0; i < 5; i++){
-               ret = account_get_user_int(_account, i, &value);
-               check_fail(ret == ACCOUNT_ERROR_NONE);
-               ret = account_get_user_int(account, i, &comparison_value);
-               check_fail(ret == ACCOUNT_ERROR_NONE);
-               check_fail(value == comparison_value);
-       }
-
-       ret = account_get_auth_type(_account, &value);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_get_auth_type(account, &comparison_value);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(value == comparison_value);
-
-       ret = account_get_secret(_account, &value);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_get_secret(account, &comparison_value);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(value == comparison_value);
-
-       ret = account_get_sync_support(_account, &value);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_get_sync_support(account, &comparison_value);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(value == comparison_value);
-
-       _is_fail = false;
-
-//     g_main_loop_quit(mainloop);
-//     mainloop = NULL;
-
-       return true;
-}
-
-int utc_account_foreach_account_from_db_p(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-       int account_id = -1;
-       char* ret_user_name = NULL;
-       const char* display_name = "display_name";
-       const char* icon_path = "icon_path";
-       const char* domain_name = "domain_name";
-       const char* email_address = "email_address";
-       const char* source = "source";
-       const char* key = "key";
-       const char* value = "value";
-       const char* user_text = "user_text";
-       const char* access_token = "access_token";
-       const account_auth_type_e auth_type = ACCOUNT_AUTH_TYPE_OAUTH;
-       const account_capability_state_e capability_state = ACCOUNT_CAPABILITY_ENABLED;
-       const account_secrecy_state_e secrecy_state = ACCOUNT_SECRECY_VISIBLE;
-       const account_sync_state_e sync_state = ACCOUNT_SYNC_STATUS_OFF;
-       int i = -1;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_display_name(account, display_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_icon_path(account, icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_domain_name(account, domain_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_email_address(account, email_address);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_source(account, source);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_custom(account, key, value);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_capability(account, contact_capability, capability_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_access_token(account, access_token);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       for (i = 0; i < 5; i++){
-               ret = account_set_user_text(account, i, user_text);
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-       }
-
-       for (i = 0; i < 5; i++){
-               ret = account_set_user_int(account, i, i*10);
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-       }
-
-       ret = account_set_auth_type(account, auth_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_secret(account, secrecy_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_sync_support(account, sync_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_insert_to_db(account, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-//     mainloop = g_main_loop_new(NULL, FALSE);
-//     assert(mainloop);
-
-       ret = account_foreach_account_from_db(account_call_back, &account);
-//     assert_eq(_is_fail, false);
-       is_callback_fail();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_delete_from_db_by_id(account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-//     int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-//     g_main_loop_run(mainloop);
-//     g_source_remove(timeout_id);
-       _is_fail = true;
-
-       return 0;
-}
-
-int utc_account_foreach_account_from_db_n(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_foreach_account_from_db(NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_query_account_by_account_id_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       int account_id = -1;
-       account_h ret_account = NULL;
-       char* ret_user_name = NULL;
-       char* ret_package_name = NULL;
-       account_capability_state_e ret_capability_type = 0;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_capability(account, contact_capability, ACCOUNT_CAPABILITY_ENABLED);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_insert_to_db(account, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_create(&ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_query_account_by_account_id(account_id, &ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       ret = account_get_user_name(ret_account, &ret_user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       ret = account_get_package_name(ret_account, &ret_package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       ret = account_get_capability(ret_account, contact_capability, &ret_capability_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_user_name, user_name), 0);
-       assert_eq(strcmp(ret_package_name, package_name), 0);
-       assert_eq(ret_capability_type, ACCOUNT_CAPABILITY_ENABLED);
-       _account_free_text(ret_user_name);
-       _account_free_text(ret_package_name);
-       ret = account_destroy(ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_delete_from_db_by_id(account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_query_account_by_account_id_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_query_account_by_account_id(-999, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_query_account_by_user_name_p(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-       int account_id = -1;
-       char* ret_user_name = NULL;
-       const char* display_name = "display_name";
-       const char* icon_path = "icon_path";
-       const char* domain_name = "domain_name";
-       const char* email_address = "email_address";
-       const char* source = "source";
-       const char* key = "key";
-       const char* value = "value";
-       const char* user_text = "user_text";
-       const char* access_token = "access_token";
-       const account_auth_type_e auth_type = ACCOUNT_AUTH_TYPE_OAUTH;
-       const account_capability_state_e capability_state = ACCOUNT_CAPABILITY_ENABLED;
-       const account_secrecy_state_e secrecy_state = ACCOUNT_SECRECY_VISIBLE;
-       const account_sync_state_e sync_state = ACCOUNT_SYNC_STATUS_OFF;
-       int i = -1;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_display_name(account, display_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_icon_path(account, icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_domain_name(account, domain_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_email_address(account, email_address);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_source(account, source);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_custom(account, key, value);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_capability(account, contact_capability, capability_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_access_token(account, access_token);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       for (i = 0; i < 5; i++){
-               ret = account_set_user_text(account, i, user_text);
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-       }
-
-       for (i = 0; i < 5; i++){
-               ret = account_set_user_int(account, i, i*10);
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-       }
-
-       ret = account_set_auth_type(account, auth_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_secret(account, secrecy_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_sync_support(account, sync_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_insert_to_db(account, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-//     mainloop = g_main_loop_new(NULL, FALSE);
-//     assert(mainloop);
-
-       ret = account_query_account_by_user_name(account_call_back, user_name, &account);
-//     assert_eq(_is_fail, false);
-       is_callback_fail();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-//     int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-//     g_main_loop_run(mainloop);
-//     g_source_remove(timeout_id);
-       _is_fail = true;
-
-       ret = account_delete_from_db_by_id(account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_query_account_by_user_name_n(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_query_account_by_user_name(account_call_back, NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_query_account_by_user_name(NULL, user_name, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_query_account_by_package_name_p(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-       int account_id = -1;
-       char* ret_user_name = NULL;
-       const char* display_name = "display_name";
-       const char* icon_path = "icon_path";
-       const char* domain_name = "domain_name";
-       const char* email_address = "email_address";
-       const char* source = "source";
-       const char* key = "key";
-       const char* value = "value";
-       const char* user_text = "user_text";
-       const char* access_token = "access_token";
-       const account_auth_type_e auth_type = ACCOUNT_AUTH_TYPE_OAUTH;
-       const account_capability_state_e capability_state = ACCOUNT_CAPABILITY_ENABLED;
-       const account_secrecy_state_e secrecy_state = ACCOUNT_SECRECY_VISIBLE;
-       const account_sync_state_e sync_state = ACCOUNT_SYNC_STATUS_OFF;
-       int i = -1;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_display_name(account, display_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_icon_path(account, icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_domain_name(account, domain_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_email_address(account, email_address);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_source(account, source);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_custom(account, key, value);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_capability(account, contact_capability, capability_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_access_token(account, access_token);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       for (i = 0; i < 5; i++){
-               ret = account_set_user_text(account, i, user_text);
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-       }
-
-       for (i = 0; i < 5; i++){
-               ret = account_set_user_int(account, i, i*10);
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-       }
-
-       ret = account_set_auth_type(account, auth_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_secret(account, secrecy_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_sync_support(account, sync_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_insert_to_db(account, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-//     mainloop = g_main_loop_new(NULL, FALSE);
-//     assert(mainloop);
-
-       ret = account_query_account_by_package_name(account_call_back, package_name, &account);
-//     assert_eq(_is_fail, false);
-       is_callback_fail();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-//     int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-//     g_main_loop_run(mainloop);
-//     g_source_remove(timeout_id);
-       _is_fail = true;
-
-       ret = account_delete_from_db_by_id(account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_query_account_by_package_name_n(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_query_account_by_package_name(account_call_back, NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_query_account_by_package_name(NULL, package_name, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_query_account_by_capability_p(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-       int account_id = -1;
-       char* ret_user_name = NULL;
-       const char* display_name = "display_name";
-       const char* icon_path = "icon_path";
-       const char* domain_name = "domain_name";
-       const char* email_address = "email_address";
-       const char* source = "source";
-       const char* key = "key";
-       const char* value = "value";
-       const char* user_text = "user_text";
-       const char* access_token = "access_token";
-       const account_auth_type_e auth_type = ACCOUNT_AUTH_TYPE_OAUTH;
-       const account_capability_state_e capability_state = ACCOUNT_CAPABILITY_ENABLED;
-       const account_secrecy_state_e secrecy_state = ACCOUNT_SECRECY_VISIBLE;
-       const account_sync_state_e sync_state = ACCOUNT_SYNC_STATUS_OFF;
-       int i = -1;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_display_name(account, display_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_icon_path(account, icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_domain_name(account, domain_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_email_address(account, email_address);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_source(account, source);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_custom(account, key, value);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_capability(account, contact_capability, capability_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_access_token(account, access_token);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       for (i = 0; i < 5; i++){
-               ret = account_set_user_text(account, i, user_text);
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-       }
-
-       for (i = 0; i < 5; i++){
-               ret = account_set_user_int(account, i, i*10);
-               assert_eq(ret, ACCOUNT_ERROR_NONE);
-       }
-
-       ret = account_set_auth_type(account, auth_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_secret(account, secrecy_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_sync_support(account, sync_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_insert_to_db(account, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-//     mainloop = g_main_loop_new(NULL, FALSE);
-//     assert(mainloop);
-
-       ret = account_query_account_by_capability(account_call_back, contact_capability, capability_state, &account);
-//     assert_eq(_is_fail, false);
-       is_callback_fail();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-//     int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-//     g_main_loop_run(mainloop);
-//     g_source_remove(timeout_id);
-       _is_fail = true;
-
-       ret = account_delete_from_db_by_id(account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_query_account_by_capability_n(void)
-{
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_query_account_by_capability(NULL, contact_capability, ACCOUNT_CAPABILITY_ENABLED, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_query_account_by_capability(account_call_back, NULL, ACCOUNT_CAPABILITY_ENABLED, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_query_account_by_capability(account_call_back, contact_capability, -1, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-static bool account_cb_func(account_h account, void *user_data) {
-       char* str = NULL;
-       char* comparison_str = NULL;
-       int value = -1;
-       int comparison_value = -1;
-       int ret = ACCOUNT_ERROR_NONE;
-       check_fail(user_data!=NULL);
-       account_h _account = *((account_h*)user_data);
-
-       ret = account_get_package_name(_account, &str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_get_package_name(account, &comparison_str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(str, comparison_str)==0);
-       _account_free_text(str);
-       _account_free_text(comparison_str);
-
-       ret = account_get_user_name(_account, &str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_get_user_name(account, &comparison_str);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(str, comparison_str)==0);
-       _account_free_text(str);
-       _account_free_text(comparison_str);
-
-       ret = account_get_capability(_account, contact_capability, &value);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_get_capability(account, contact_capability, &comparison_value);
-       check_fail_eq(ret, ACCOUNT_ERROR_NONE);
-       check_fail(value == comparison_value);
-
-       _is_fail = false;
-//     g_main_loop_quit(mainloop);
-//     mainloop = NULL;
-
-       return true;
-}
-
-int utc_account_query_account_by_capability_type_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       int account_id = -1;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_capability(account, contact_capability, ACCOUNT_CAPABILITY_ENABLED);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_insert_to_db(account, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-//     mainloop = g_main_loop_new(NULL, FALSE);
-//     assert(mainloop);
-
-       ret = account_query_account_by_capability_type(account_cb_func, contact_capability, &account);
-//     assert_eq(_is_fail, false);
-       is_callback_fail();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-//     int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-//     g_main_loop_run(mainloop);
-//     g_source_remove(timeout_id);
-       _is_fail = true;
-
-       ret = account_delete_from_db_by_id(account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_query_account_by_capability_type_n(void)
-{
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* type = "type";
-
-       ret = account_query_account_by_capability_type(NULL, type, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_query_account_by_capability_type(account_cb_func, NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_query_capability_by_account_id_p(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       int account_id = -1;
-       account_capability_state_e capability_state = ACCOUNT_CAPABILITY_ENABLED;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_capability(account, contact_capability, capability_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_insert_to_db(account, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-//     mainloop = g_main_loop_new(NULL, FALSE);
-//     assert(mainloop);
-
-       ret = account_query_capability_by_account_id(capability_call_back, account_id, &account);
-//     assert_eq(_is_fail, false);
-       is_callback_fail();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-//     int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-//     g_main_loop_run(mainloop);
-//     g_source_remove(timeout_id);
-       _is_fail = true;
-
-       ret = account_delete_from_db_by_id(account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_query_capability_by_account_id_n(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_query_capability_by_account_id(capability_call_back, -1, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_query_capability_by_account_id(NULL, 1, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_get_total_count_from_db_p(void)
-{
-       assert(connected);
-       int count = -1;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_get_total_count_from_db(&count);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_get_total_count_from_db_n(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_get_total_count_from_db(NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_update_sync_status_by_id_p(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-       int account_id = -1;
-       account_h ret_account = NULL;
-       account_sync_state_e sync_state = -1;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_insert_to_db(account, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_update_sync_status_by_id(account_id, ACCOUNT_SYNC_STATUS_IDLE);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_create(&ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_query_account_by_account_id(account_id, &ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_sync_support(ret_account, &sync_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(sync_state, ACCOUNT_SYNC_STATUS_IDLE);
-
-       ret = account_destroy(ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_delete_from_db_by_id(account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_update_sync_status_by_id_n(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_update_sync_status_by_id(-1, ACCOUNT_SYNC_STATUS_IDLE);
-       assert_neq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_delete_from_db_by_id_p(void)
-{
-       assert(connected);
-       assert(created);
-       int account_id = -1;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_insert_to_db(account, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_delete_from_db_by_id(account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_delete_from_db_by_id_n(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_delete_from_db_by_id(-1);
-       assert_neq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_delete_from_db_by_user_name_p(void)
-{
-       assert(connected);
-       assert(created);
-       int account_id = -1;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_insert_to_db(account, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_delete_from_db_by_user_name(user_name, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_delete_from_db_by_user_name_n(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_delete_from_db_by_user_name(NULL, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_delete_from_db_by_package_name_p(void)
-{
-       assert(connected);
-       assert(created);
-
-       int account_id = -1;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_insert_to_db(account, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_delete_from_db_by_package_name(package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_delete_from_db_by_package_name_n(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_delete_from_db_by_package_name(NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_delete_from_db_by_package_name_without_permission_p(void)
-{
-       assert(connected);
-       assert(created);
-
-       int account_id = -1;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_insert_to_db(account, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_delete_from_db_by_package_name_without_permission(package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_delete_from_db_by_package_name_without_permission_n(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_delete_from_db_by_package_name_without_permission(NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_update_to_db_by_id_p(void)
-{
-       assert(connected);
-       assert(created);
-       int account_id = -1;
-       int ret = ACCOUNT_ERROR_NONE;
-       char* update_user_name = "update_user_name";
-       char* ret_user_name = NULL;
-       account_h ret_account = NULL;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_insert_to_db(account, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_user_name(account, update_user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_update_to_db_by_id(account, account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_create(&ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_query_account_by_account_id(account_id, &ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_user_name(account, &ret_user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_user_name, update_user_name), 0);
-
-       _account_free_text(ret_user_name);
-       ret = account_destroy(ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_delete_from_db_by_id(account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_update_to_db_by_id_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_update_to_db_by_id(account, -1);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_update_to_db_by_user_name_p(void)
-{
-       assert(connected);
-       assert(created);
-       int account_id = -1;
-       int ret = ACCOUNT_ERROR_NONE;
-       int value = -1;
-       char* ret_user_name = NULL;
-       account_h ret_account = NULL;
-       account_capability_state_e capability_state = ACCOUNT_CAPABILITY_ENABLED;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_insert_to_db(account, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_capability(account, contact_capability, capability_state);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_update_to_db_by_user_name(account, user_name, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_create(&ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_query_account_by_account_id(account_id, &ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_user_name(account, &ret_user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_user_name, user_name), 0);
-       _account_free_text(ret_user_name);
-
-       ret = account_get_capability(account, contact_capability, &value);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(value, ACCOUNT_CAPABILITY_ENABLED);
-
-       ret = account_destroy(ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_delete_from_db_by_id(account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_update_to_db_by_user_name_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_update_to_db_by_user_name(account, NULL, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-
-
-int utc_account_subscribe_create_p(void)
-{
-       assert(connected);
-       account_subscribe_h account_subscribe;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_subscribe_create(&account_subscribe);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_subscribe_notification(account_subscribe, NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_unsubscribe_notification(account_subscribe);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-
-int utc_account_subscribe_create_n(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_subscribe_create(NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-
-int utc_account_subscribe_notification_p(void)
-{
-       assert(connected);
-       account_subscribe_h account_subscribe;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_subscribe_create(&account_subscribe);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_subscribe_notification(account_subscribe, NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_unsubscribe_notification(account_subscribe);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-
-int utc_account_subscribe_notification_n(void)
-{
-       assert(connected);
-       account_subscribe_h account_subscribe;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_subscribe_create(&account_subscribe);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_subscribe_notification(NULL, NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_subscribe_notification(account_subscribe, NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_unsubscribe_notification(account_subscribe);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_unsubscribe_notification_p(void)
-{
-       assert(connected);
-       account_subscribe_h account_subscribe;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_subscribe_create(&account_subscribe);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_subscribe_notification(account_subscribe, NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_unsubscribe_notification(account_subscribe);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-
-int utc_account_unsubscribe_notification_n(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_unsubscribe_notification(NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_type_create_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_create_n(void)
-{
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_type_create(NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_type_destroy_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_destroy_n(void)
-{
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_type_destroy(NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_type_set_app_id_p(void)
-{
-       int ret = account_type_set_app_id(NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_app_id_n(void)
-{
-       int ret = account_type_set_app_id(NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_app_id_internal_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* app_id = "application_id";
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_app_id_internal(account_type, app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_app_id_internal_n(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* app_id = "application_id";
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_app_id_internal(NULL, app_id);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_set_app_id_internal(account_type, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_get_app_id_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* app_id = "application_id";
-       char* ret_app_id = NULL;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_app_id_internal(account_type, app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_get_app_id(account_type, &ret_app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_app_id, app_id), 0);
-       _account_free_text(ret_app_id);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_get_app_id_n(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       char* ret_app_id = NULL;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_get_app_id(NULL, &ret_app_id);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_get_app_id(account_type, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_icon_path_p(void)
-{
-       int ret = account_type_set_icon_path(NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_icon_path_n(void)
-{
-       int ret = account_type_set_icon_path(NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_icon_path_internal_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* icon_path = "icon_path";
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_icon_path_internal(account_type, icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_icon_path_internal_n(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* icon_path = "icon_path";
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_icon_path_internal(NULL, icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_set_icon_path_internal(account_type, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_get_icon_path_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       char* ret_icon_path = NULL;
-       const char* icon_path = "icon_path";
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_icon_path_internal(account_type, icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_get_icon_path(account_type, &ret_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_icon_path, icon_path), 0);
-       _account_free_text(ret_icon_path);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_get_icon_path_n(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       char* ret_icon_path = NULL;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_get_icon_path(NULL, &ret_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_get_icon_path(account_type, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_label_p(void)
-{
-       int ret = account_type_set_label(NULL, NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_label_n(void)
-{
-       int ret = account_type_set_label(NULL, NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_label_internal_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* label = "label";
-       const char* locale = "locale";
-       char* ret_label = NULL;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_label_internal(account_type, label, locale);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_label_internal_n(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* label = "label";
-       const char* locale = "locale";
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_label_internal(NULL, label, locale);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_set_label_internal(account_type, NULL, locale);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_set_label_internal(account_type, label, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_get_label_by_locale_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* label = "label";
-       const char* locale = "locale";
-       char* ret_label = NULL;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_label_internal(account_type, label, locale);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_get_label_by_locale(account_type, locale, &ret_label);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_label, label), 0);
-       _account_free_text(ret_label);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_get_label_by_locale_n(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       char* ret_label = NULL;
-       const char* locale = "locale";
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_get_label_by_locale(NULL, locale, &ret_label);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_get_label_by_locale(account_type, locale, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-static bool account_label_cb_func(char* app_id, char* label, char* locale, void *user_data) {
-       //this callback function checks that query function implements normally through confirmming whether same labels or not.
-       if(user_data != NULL)
-       {
-               const char* _label = (const char*)user_data;
-               if(strcmp(label, _label)==0)
-                       _is_fail = false;
-       }
-
-//     g_main_loop_quit(mainloop);
-//     mainloop = NULL;
-       return TRUE;
-}
-
-int utc_account_type_get_label_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* label = "label";
-       const char* locale = "locale";
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_label_internal(account_type, label, locale);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-//     mainloop = g_main_loop_new(NULL, FALSE);
-//     assert(mainloop);
-
-       ret = account_type_get_label(account_type, account_label_cb_func, (void*)label);
-//     assert_eq(_is_fail, false);
-       is_callback_fail();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-//     int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-//     g_main_loop_run(mainloop);
-//     g_source_remove(timeout_id);
-       _is_fail = true;
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_get_label_n(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_get_label(NULL, account_label_cb_func, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_get_label(account_type, NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_multiple_account_support_p(void)
-{
-       int ret = account_type_set_multiple_account_support(NULL, true);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_multiple_account_support_n(void)
-{
-       int ret = account_type_set_multiple_account_support(NULL, true);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_multiple_account_support_internal_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       int ret_val = -1;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_multiple_account_support_internal(account_type, true);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_multiple_account_support_internal_n(void)
-{
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_type_set_multiple_account_support_internal(NULL, true);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_type_get_multiple_account_support_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       int ret_val = 0;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_multiple_account_support_internal(account_type, true);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_get_multiple_account_support(account_type, &ret_val);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(ret_val, true);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_get_multiple_account_support_n(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       bool ret_val = true;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_get_multiple_account_support(NULL, &ret_val);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_get_multiple_account_support(account_type, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-static bool provider_feature_cb_func(char* app_id, char* key, void* user_data) {
-       //this callback function checks that query function implements normally through confirmming whether same provider feature or not.
-       if(user_data != NULL)
-       {
-               const char* _capability = (const char*)user_data;
-               check_fail(strcmp(key, _capability)==0)
-       }
-//     g_main_loop_quit(mainloop);
-//     mainloop = NULL;
-       _is_fail = false;
-
-       return TRUE;
-}
-
-int utc_account_type_set_provider_feature_p(void)
-{
-       int ret = account_type_set_provider_feature(NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return TRUE;
-}
-
-int utc_account_type_set_provider_feature_n(void)
-{
-       int ret = account_type_set_provider_feature(NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return TRUE;
-}
-
-int utc_account_type_set_provider_feature_internal_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* provider_feature = "provider_feature";
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_provider_feature_internal(account_type, provider_feature);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_provider_feature_internal_n(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* provider_feature = "provider_feature";
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_provider_feature_internal(NULL, provider_feature);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_set_provider_feature_internal(account_type, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_get_provider_feature_all_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* provider_feature = "provider_feature";
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_provider_feature_internal(account_type, provider_feature);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-//     mainloop = g_main_loop_new(NULL, FALSE);
-//     assert(mainloop);
-
-       ret = account_type_get_provider_feature_all(account_type, provider_feature_cb_func, (void *)provider_feature);
-//     assert_eq(_is_fail, false);
-       is_callback_fail();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-//     int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-//     g_main_loop_run(mainloop);
-//     g_source_remove(timeout_id);
-       _is_fail = true;
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_get_provider_feature_all_n(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_get_provider_feature_all(NULL, provider_feature_cb_func, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_get_provider_feature_all(account_type, NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_service_provider_id_p(void)
-{
-       int ret = account_type_set_service_provider_id(NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_service_provider_id_n(void)
-{
-       int ret = account_type_set_service_provider_id(NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_service_provider_id_internal_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* service_provider_id = "service_provider_id";
-       char* ret_service_provider_id = NULL;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_service_provider_id_internal(account_type, service_provider_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_service_provider_id_internal_n(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* service_provider_id = "service_provider_id";
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_service_provider_id_internal(NULL, service_provider_id);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_set_service_provider_id_internal(account_type, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_get_service_provider_id_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* service_provider_id = "service_provider_id";
-       char* ret_service_provider_id = NULL;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_service_provider_id_internal(account_type, service_provider_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_get_service_provider_id(account_type, &ret_service_provider_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_service_provider_id, service_provider_id), 0);
-       _account_free_text(ret_service_provider_id);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_get_service_provider_id_n(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       char* ret_service_provider_id = NULL;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_get_service_provider_id(account_type, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_get_service_provider_id(NULL, &ret_service_provider_id);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_small_icon_path_p(void)
-{
-       int ret = account_type_set_small_icon_path(NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_small_icon_path_n(void)
-{
-       int ret = account_type_set_small_icon_path(NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_small_icon_path_internal_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* small_icon_path = "small_icon_path";
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_small_icon_path_internal(account_type, small_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_set_small_icon_path_internal_n(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* small_icon_path = "small_icon_path";
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_small_icon_path_internal(NULL, small_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_set_small_icon_path_internal(account_type, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_get_small_icon_path_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       char* ret_small_icon_path = NULL;
-       const char* small_icon_path = "small_icon_path";
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_small_icon_path_internal(account_type, small_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_get_small_icon_path(account_type, &ret_small_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_small_icon_path, small_icon_path), 0);
-       _account_free_text(ret_small_icon_path);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_get_small_icon_path_n(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       char* ret_small_icon_path = NULL;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_get_small_icon_path(NULL, &ret_small_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_get_small_icon_path(account_type, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_insert_to_db_p(void)
-{
-       int ret = account_type_insert_to_db(NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_insert_to_db_n(void)
-{
-       int ret = account_type_insert_to_db(NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_insert_to_db_internal_p(void)
-{
-       account_type_h account_type = NULL;
-       account_type_h ret_account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       int account_type_id = -1;
-       const char* app_id = "app_id_insert_test";
-       char* ret_app_id = NULL;
-       const char* service_provider_id = TEST_PACKAGE_NAME;
-       char* ret_service_provider_id = NULL;
-       const char* icon_path = "icon_path";
-       char* ret_icon_path = NULL;
-       const char* small_icon_path = "small_icon_path";
-       char* ret_small_icon_path = NULL;
-       const bool multi_account_support = true;
-       bool ret_multi_account_support = false;
-       const char* label = "label";
-       char* ret_label = NULL;
-       const char* locale = "locale";
-       char* ret_capability = NULL;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_app_id_internal(account_type, app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_service_provider_id_internal(account_type, service_provider_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_icon_path_internal(account_type, icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_small_icon_path_internal(account_type, small_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_multiple_account_support_internal(account_type, multi_account_support);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_label_internal(account_type, label, locale);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_provider_feature_internal(account_type, contact_capability);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_insert_to_db_internal(account_type, &account_type_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_create(&ret_account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_query_by_app_id(app_id, &ret_account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_get_app_id(ret_account_type, &ret_app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_app_id, app_id), 0);
-       _account_free_text(ret_app_id);
-
-       ret = account_type_get_service_provider_id(ret_account_type, &ret_service_provider_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_service_provider_id, service_provider_id), 0);
-       _account_free_text(ret_service_provider_id);
-
-       ret = account_type_get_icon_path(ret_account_type, &ret_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_icon_path, icon_path), 0);
-       _account_free_text(ret_icon_path);
-
-       ret = account_type_get_small_icon_path(account_type, &small_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_small_icon_path, small_icon_path), 0);
-       _account_free_text(ret_small_icon_path);
-
-       ret = account_type_get_multiple_account_support(account_type, &ret_multi_account_support);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(ret_multi_account_support, multi_account_support);
-
-       ret = account_type_get_label_by_locale(account_type, locale, &ret_label);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_label, label), 0);
-       _account_free_text(ret_label);
-
-       ret = account_type_get_provider_feature_all(account_type, provider_feature_cb_func, (void *)contact_capability);
-//     assert_eq(_is_fail, false);
-       is_callback_fail();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       _is_fail = true;
-
-       ret = account_type_destroy(ret_account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_delete_by_app_id_internal(app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_insert_to_db_internal_n(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       int account_type_id = 0;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_insert_to_db_internal(NULL, &account_type_id);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_insert_to_db_internal(account_type, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_update_to_db_by_app_id_p(void)
-{
-       int ret = account_type_update_to_db_by_app_id(NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_update_to_db_by_app_id_n(void)
-{
-       int ret = account_type_update_to_db_by_app_id(NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_update_to_db_by_app_id_internal_p(void)
-{
-       account_type_h account_type = NULL;
-       account_type_h ret_account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       int account_type_id = 0;
-       const char* app_id = "account_type_update_by_app_id";
-       char* ret_app_id = NULL;
-       const char* service_provider_id = TEST_PACKAGE_NAME;
-       char* ret_service_provider_id = NULL;
-       const char* icon_path = "icon_path";
-       const char* update_icon_path = "update_icon_path";
-       char* ret_icon_path = NULL;
-       const char* small_icon_path = "small_icon_path";
-       const char* update_small_icon_path = "update_small_icon_path";
-       char* ret_small_icon_path = NULL;
-       const bool multi_account_support = true;
-       const bool update_multi_account_support = false;
-       bool ret_multi_account_support = true;
-       const char* label = "label";
-       const char* update_label = "update_label";
-       char* ret_label = NULL;
-       const char* locale = "locale";
-       char* ret_capability = NULL;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_create(&ret_account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_app_id_internal(account_type, app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_service_provider_id_internal(account_type, service_provider_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_icon_path_internal(account_type, icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_small_icon_path_internal(account_type, small_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_multiple_account_support_internal(account_type, multi_account_support);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_label_internal(account_type, label, locale);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_provider_feature_internal(account_type, contact_capability);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_insert_to_db_internal(account_type, &account_type_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_query_by_app_id(app_id, &account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_icon_path_internal(account_type, update_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_small_icon_path_internal(account_type, update_small_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_multiple_account_support_internal(account_type, update_multi_account_support);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_label_internal(account_type, update_label, locale);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_provider_feature_internal(account_type, calendar_capability);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_service_provider_id_internal(account_type, service_provider_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_update_to_db_by_app_id_internal(account_type, app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_query_by_app_id(app_id, &ret_account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_get_app_id(ret_account_type, &ret_app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_app_id, app_id), 0);
-       _account_free_text(ret_app_id);
-
-       ret = account_type_get_service_provider_id(ret_account_type, &ret_service_provider_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_service_provider_id, service_provider_id), 0);
-       _account_free_text(ret_service_provider_id);
-
-       ret = account_type_get_icon_path(ret_account_type, &ret_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_icon_path, update_icon_path), 0);
-       _account_free_text(ret_icon_path);
-
-       ret = account_type_get_small_icon_path(ret_account_type, &ret_small_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_small_icon_path, update_small_icon_path), 0);
-       _account_free_text(ret_small_icon_path);
-
-       ret = account_type_get_multiple_account_support(ret_account_type, &ret_multi_account_support);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(ret_multi_account_support, update_multi_account_support);
-
-       ret = account_type_get_label_by_locale(account_type, locale, &ret_label);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_label, update_label), 0);
-       _account_free_text(ret_label);
-
-       ret = account_type_get_provider_feature_all(ret_account_type, provider_feature_cb_func, (void *)calendar_capability);
-//     assert_eq(_is_fail, false);
-       is_callback_fail();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       _is_fail = true;
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_destroy(ret_account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_delete_by_app_id_internal(app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_update_to_db_by_app_id_internal_n(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* app_id = "small_icon_path";
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_update_to_db_by_app_id_internal(NULL, app_id);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_update_to_db_by_app_id_internal(account_type, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_query_by_app_id_p(void)
-{
-       account_type_h account_type = NULL;
-       account_type_h ret_account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* app_id = "account_type_query_by_app_id";
-       char* ret_app_id = NULL;
-       const char* service_provider_id = TEST_PACKAGE_NAME;
-       char* ret_service_provider_id = NULL;
-       int account_type_id = 0;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_create(&ret_account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_app_id_internal(account_type, app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_service_provider_id_internal(account_type, service_provider_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_insert_to_db_internal(account_type, &account_type_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_query_by_app_id(app_id, &ret_account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_get_app_id(ret_account_type, &ret_app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_app_id, app_id), 0);
-       _account_free_text(ret_app_id);
-
-       ret = account_type_get_service_provider_id(ret_account_type, &ret_service_provider_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_service_provider_id, service_provider_id), 0);
-       _account_free_text(ret_service_provider_id);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_destroy(ret_account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_delete_by_app_id_internal(app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-
-int utc_account_type_query_by_app_id_n(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* app_id = "account_type_query_by_app_id";
-
-       ret = account_type_query_by_app_id(app_id, &account_type);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_query_by_app_id(NULL, &account_type);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_query_by_app_id(app_id, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-
-int utc_account_type_query_app_id_exist_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* app_id = "account_type_query_app_id_exist";
-       int a_type_id = -1;
-
-       ret = account_type_query_app_id_exist(app_id);
-       assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_app_id_internal(account_type, app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_insert_to_db_internal(account_type, &a_type_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_query_app_id_exist(app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       account_type_delete_by_app_id_internal(app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_query_app_id_exist_n(void)
-{
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_type_query_app_id_exist(NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-static bool account_type_for_query_by_provider_cb(account_type_h account_type, void *user_data)
-{
-       //this callback function checks that query function implements normally through confirmming whether same app_id or not.
-       int ret = ACCOUNT_ERROR_NONE;
-       account_type_h ret_account_type = NULL;
-       char* app_id = NULL;
-       char* ret_app_id = NULL;
-       char* service_provider_id = NULL;
-       char* ret_service_provider_id = NULL;
-       char* icon_path = NULL;
-       char* ret_icon_path = NULL;
-       char* small_icon_path = NULL;
-       char* ret_small_icon_path = NULL;
-       bool multi_account_support = true;
-       char* label = NULL;
-       char* ret_label = NULL;
-       const char* locale = "locale";
-       char* capability = "capability";
-       bool ret_multi_account_support = false;
-
-       check_fail(account_type != NULL && user_data != NULL && user_data != NULL);
-
-       ret_account_type = *((account_type_h*)user_data);
-
-       ret = account_type_get_app_id(account_type, &app_id);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_type_get_app_id(ret_account_type, &ret_app_id);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(ret_app_id, app_id)==0);
-       _account_free_text(app_id);
-       _account_free_text(ret_app_id);
-
-       ret = account_type_get_service_provider_id(account_type, &service_provider_id);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_type_get_service_provider_id(ret_account_type, &ret_service_provider_id);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(ret_service_provider_id, service_provider_id)==0);
-       _account_free_text(service_provider_id);
-       _account_free_text(ret_service_provider_id);
-
-       ret = account_type_get_icon_path(account_type, &icon_path);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_type_get_icon_path(ret_account_type, &ret_icon_path);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(ret_icon_path, icon_path)==0);
-       _account_free_text(icon_path);
-       _account_free_text(ret_icon_path);
-
-       ret = account_type_get_small_icon_path(account_type, &small_icon_path);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_type_get_small_icon_path(ret_account_type, &ret_small_icon_path);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(ret_small_icon_path, small_icon_path)==0);
-       _account_free_text(small_icon_path);
-       _account_free_text(ret_small_icon_path);
-
-       ret = account_type_get_multiple_account_support(account_type, &multi_account_support);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_type_get_multiple_account_support(ret_account_type, &ret_multi_account_support);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(ret_multi_account_support == multi_account_support);
-
-       ret = account_type_get_label_by_locale(account_type, locale, &label);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_type_get_label_by_locale(account_type, locale, &ret_label);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(ret_label, label) == 0);
-       _account_free_text(label);
-       _account_free_text(ret_label);
-
-       _is_fail = true;
-       ret = account_type_get_provider_feature_all(account_type, provider_feature_cb_func,  capability);
-       check_fail(_is_fail == false);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-
-       _is_fail = true;
-       ret = account_type_get_provider_feature_all(ret_account_type, provider_feature_cb_func, capability);
-       check_fail(_is_fail == false);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-
-       _is_fail = false;
-
-//     g_main_loop_quit(mainloop);
-//     mainloop = NULL;
-
-    return true;
-}
-
-
-int utc_account_type_query_by_provider_feature_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* app_id = "account_type_query_by_provider_feature";
-       const char* service_provider_id = TEST_PACKAGE_NAME;
-       const char* icon_path = "icon_path";
-       const char* small_icon_path = "small_icon_path";
-       const char* capability = "capability";
-       const bool multi_account_support = true;
-       const char* label = "label";
-       const char* locale = "locale";
-
-       int a_type_id = -1;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_app_id_internal(account_type, app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_service_provider_id_internal(account_type, service_provider_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_icon_path_internal(account_type, icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_small_icon_path_internal(account_type, small_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_multiple_account_support_internal(account_type, multi_account_support);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_label_internal(account_type, label, locale);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_provider_feature_internal(account_type, capability);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_insert_to_db_internal(account_type, &a_type_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_query_by_provider_feature(account_type_for_query_by_provider_cb, capability, &account_type);
-//     assert_eq(_is_fail, false);
-       is_callback_fail();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       _is_fail = true;
-
-       account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       account_type_delete_by_app_id_internal(app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-
-int utc_account_type_query_by_provider_feature_n(void)
-{
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* key = contact_capability;
-
-       ret = account_type_query_by_provider_feature(account_type_for_query_by_provider_cb, NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_query_by_provider_feature(NULL, key, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-static bool account_type_for_query_by_app_id_cb(char* app_id, char* label, char* locale, void *user_data)
-{
-       //this callback function checks that query function implements normally through confirmming whether same label or not.
-       int ret = ACCOUNT_ERROR_NONE;
-       account_type_h account_type = NULL;
-       char* ret_label = NULL;
-
-       check_fail( app_id!=NULL && label!=NULL && locale!=NULL && user_data!=NULL );
-       account_type = *((account_type_h*)user_data);
-
-       ret = account_type_get_label_by_locale(account_type, locale, &ret_label);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(ret_label, label) == 0);
-       _account_free_text(ret_label);
-
-       _is_fail = false;
-
-       return TRUE;
-}
-
-int utc_account_type_query_label_by_app_id_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       int a_type_id = -1;
-
-       const char* label_t = "label_test";
-       const char* locale_t = "locale_test";
-       const char* app_id = "account_type_query_label_by_app_id";
-       const char* service_provider_id = TEST_PACKAGE_NAME;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_label_internal(account_type, label_t, locale_t);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_app_id_internal(account_type, app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_service_provider_id_internal(account_type, service_provider_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_insert_to_db_internal(account_type, &a_type_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_query_label_by_app_id(account_type_for_query_by_app_id_cb, app_id, &account_type);
-//     assert_eq(_is_fail, false);
-       is_callback_fail();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       _is_fail = true;
-
-       account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       account_type_delete_by_app_id_internal(app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_query_label_by_app_id_n(void)
-{
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* app_id = "account_type_query_label_by_app_id";
-
-       ret = account_type_query_label_by_app_id(NULL, app_id, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_query_label_by_app_id(account_type_for_query_by_app_id_cb, NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_type_query_label_by_locale_p(void)
-{
-       account_type_h account_type = NULL;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* label = "label";
-       const char* locale = "locale";
-       const char* app_id = "account_type_query_label_by_locale";
-       char* ret_label = NULL;
-       int a_type_id = -1;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_label_internal(account_type, label, locale);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_app_id_internal(account_type, app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_insert_to_db_internal(account_type, &a_type_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_query_label_by_locale(app_id, locale, &ret_label);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_label, label), 0);
-       _account_free_text(ret_label);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       account_type_delete_by_app_id_internal(app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_query_label_by_locale_n(void)
-{
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* app_id = "account_type_query_label_by_locale";
-       const char* locale = "locale";
-       char* ret_label = NULL;
-
-       ret = account_type_get_label_by_locale(NULL, locale, &ret_label);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_get_label_by_locale(app_id, locale, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_type_query_provider_feature_by_app_id_p(void)
-{
-       int ret = ACCOUNT_ERROR_NONE;
-       account_type_h account_type = NULL;
-       const char* app_id = "application_id";
-       const char* provider_feature = "provider_feature";
-       int account_type_id = -1;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_app_id_internal(account_type, app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_provider_feature_internal(account_type, provider_feature);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_insert_to_db_internal(account_type, &account_type_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_query_provider_feature_by_app_id(provider_feature_cb_func, app_id, (void *)provider_feature);
-//     assert_eq(_is_fail, false);
-       is_callback_fail();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       _is_fail = true;
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       account_type_delete_by_app_id_internal(app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_query_provider_feature_by_app_id_n(void)
-{
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* app_id = "application_id";
-
-       ret = account_type_query_provider_feature_by_app_id(NULL, app_id, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_query_provider_feature_by_app_id(provider_feature_cb_func, NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_type_query_supported_feature_p(void)
-{
-       account_type_h account_type = NULL;
-       bool ret = true;
-       int account_type_id = -1;
-       const char* app_id = "application_id";
-       const char* capability = "capability";
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_app_id_internal(account_type, app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_provider_feature_internal(account_type, capability);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_insert_to_db_internal(account_type, &account_type_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_query_supported_feature(app_id, capability);
-       assert_eq(ret, true);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       account_type_delete_by_app_id_internal(app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_query_supported_feature_n(void)
-{
-       bool ret = true;
-       const char* app_id = "application_id";
-       const char* capability = "capability";
-
-       ret = account_type_query_supported_feature(NULL, capability);
-       assert_eq(ret, FALSE);
-       assert_eq(get_last_result(), ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_type_query_supported_feature(app_id, NULL);
-       assert_eq(ret, FALSE);
-
-       return 0;
-}
-
-int utc_account_update_to_db_by_id_ex_p(void)
-{
-       assert(connected);
-       assert(created);
-       int account_id = -1;
-       int ret = ACCOUNT_ERROR_NONE;
-       char* update_user_name = "update_user_name";
-       char* ret_user_name = NULL;
-       account_h ret_account = NULL;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_insert_to_db(account, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_user_name(account, update_user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_update_to_db_by_id_ex(account, account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_create(&ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_query_account_by_account_id(account_id, &ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_user_name(account, &ret_user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_user_name, update_user_name), 0);
-
-       _account_free_text(ret_user_name);
-       ret = account_destroy(ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_delete_from_db_by_id(account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_update_to_db_by_id_ex_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_update_to_db_by_id_ex(account, -1);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_update_to_db_by_id_without_permission_p(void)
-{
-       assert(connected);
-       assert(created);
-       account_h ret_account = NULL;
-       int account_id = -1;
-       int ret = ACCOUNT_ERROR_NONE;
-       const char* update_user_name = "update_user_name";
-       char* ret_user_name = NULL;
-
-       ret = account_set_user_name(account, user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_insert_to_db(account, &account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_user_name(account, update_user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_set_package_name(account, package_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_update_to_db_by_id_without_permission(account, account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_create(&ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_query_account_by_account_id(account_id, &ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_get_user_name(ret_account, &ret_user_name);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-       assert_eq(strcmp(ret_user_name, update_user_name), 0);
-       _account_free_text(ret_user_name);
-
-       ret = account_destroy(ret_account);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_delete_from_db_by_id(account_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_update_to_db_by_id_without_permission_n(void)
-{
-       assert(connected);
-       assert(created);
-       int ret = ACCOUNT_ERROR_NONE;
-       int account_id = 2;
-
-       ret = account_update_to_db_by_id_without_permission(NULL, account_id);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       ret = account_update_to_db_by_id_without_permission(account, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-int utc_account_type_delete_by_app_id_p(void)
-{
-       int ret = account_type_delete_by_app_id(NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_delete_by_app_id_n(void)
-{
-       int ret = account_type_delete_by_app_id(NULL);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_delete_by_app_id_internal_p(void)
-{
-       account_type_h account_type = NULL;
-       const char* app_id = "app_id_delete_test";
-       int ret = ACCOUNT_ERROR_NONE;
-       int account_type_id = -1;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_app_id_internal(account_type, app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_insert_to_db_internal(account_type, &account_type_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_query_app_id_exist(app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_delete_by_app_id_internal(app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_query_app_id_exist(app_id);
-       assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);
-
-       return 0;
-}
-
-int utc_account_type_delete_by_app_id_internal_n(void)
-{
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_type_delete_by_app_id_internal(NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
-static bool account_type_cb_func(account_type_h account_type, void *user_data) {
-       //this callback function checks that query function implements normally through confirmming whether same app_id or not.
-       int ret = ACCOUNT_ERROR_NONE;
-       account_type_h ret_account_type = NULL;
-       char* app_id = NULL;
-       char* ret_app_id = NULL;
-       char* service_provider_id = NULL;
-       char* ret_service_provider_id = NULL;
-       char* icon_path = NULL;
-       char* ret_icon_path = NULL;
-       char* small_icon_path = NULL;
-       char* ret_small_icon_path = NULL;
-       bool multi_account_support = true;
-       char* label = NULL;
-       char* ret_label = NULL;
-       const char* locale = "locale";
-       char* capability = NULL;
-       char* ret_capability = NULL;
-       bool ret_multi_account_support = false;
-
-       check_fail(account_type != NULL && user_data != NULL && user_data != NULL);
-
-       ret_account_type = *((account_type_h*)user_data);
-
-       ret = account_type_get_app_id(account_type, &app_id);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       if( strcmp(app_id, TEST_PACKAGE_NAME)==0 )
-       {
-               _is_fail=false;
-               return true;
-       }
-       ret = account_type_get_app_id(ret_account_type, &ret_app_id);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(ret_app_id, app_id)==0);
-       _account_free_text(app_id);
-       _account_free_text(ret_app_id);
-
-       ret = account_type_get_service_provider_id(account_type, &service_provider_id);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_type_get_service_provider_id(ret_account_type, &ret_service_provider_id);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(ret_service_provider_id, service_provider_id)==0);
-       _account_free_text(service_provider_id);
-       _account_free_text(ret_service_provider_id);
-
-       ret = account_type_get_icon_path(account_type, &icon_path);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_type_get_icon_path(ret_account_type, &ret_icon_path);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(ret_icon_path, icon_path)==0);
-       _account_free_text(icon_path);
-       _account_free_text(ret_icon_path);
-
-       ret = account_type_get_small_icon_path(account_type, &small_icon_path);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_type_get_small_icon_path(ret_account_type, &ret_small_icon_path);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(ret_small_icon_path, small_icon_path)==0);
-       _account_free_text(small_icon_path);
-       _account_free_text(ret_small_icon_path);
-
-       ret = account_type_get_multiple_account_support(account_type, &multi_account_support);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_type_get_multiple_account_support(ret_account_type, &ret_multi_account_support);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(ret_multi_account_support == multi_account_support);
-
-       ret = account_type_get_label_by_locale(account_type, locale, &label);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       ret = account_type_get_label_by_locale(account_type, locale, &ret_label);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(strcmp(ret_label, label) == 0);
-       _account_free_text(label);
-       _account_free_text(ret_label);
-
-       _is_fail = true;
-       ret = account_type_get_provider_feature_all(account_type, provider_feature_cb_func, (void *)contact_capability);
-
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(_is_fail == false);
-
-       _is_fail = true;
-       ret = account_type_get_provider_feature_all(account_type, provider_feature_cb_func, (void *)contact_capability);
-       check_fail(ret == ACCOUNT_ERROR_NONE);
-       check_fail(_is_fail == false);
-
-       _is_fail = false;
-
-//     g_main_loop_quit(mainloop);
-//     mainloop = NULL;
-
-    return true;
-}
-
-int utc_account_type_foreach_account_type_from_db_p(void)
-{
-       assert(connected);
-       int ret = ACCOUNT_ERROR_NONE;
-       int account_type_id = -1;
-       account_type_h account_type = NULL;
-       const char* app_id = "account_type_foreach_account_type_from_db";
-       char* ret_app_id = NULL;
-       const char* service_provider_id = TEST_PACKAGE_NAME;
-       char* ret_service_provider_id = NULL;
-       const char* icon_path = "icon_path";
-       char* ret_icon_path = NULL;
-       const char* small_icon_path = "small_icon_path";
-       char* ret_small_icon_path = NULL;
-       const bool multi_account_support = true;
-       bool ret_multi_account_support = true;
-       const char* label = "label";
-       char* ret_label = NULL;
-       const char* locale = "locale";
-       char* ret_capability = NULL;
-
-       ret = account_type_create(&account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_app_id_internal(account_type, app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_service_provider_id_internal(account_type, service_provider_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_icon_path_internal(account_type, icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_small_icon_path_internal(account_type, small_icon_path);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_multiple_account_support_internal(account_type, multi_account_support);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_label_internal(account_type, label, locale);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_set_provider_feature_internal(account_type, contact_capability);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       ret = account_type_insert_to_db_internal(account_type, &account_type_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       _is_fail = true;
-
-       ret = account_type_foreach_account_type_from_db(account_type_cb_func, &account_type);
-//     assert_eq(_is_fail, false);
-       is_callback_fail();
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       _is_fail = true;
-
-       ret = account_type_destroy(account_type);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       account_type_delete_by_app_id_internal(app_id);
-       assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-       return 0;
-}
-
-int utc_account_type_foreach_account_type_from_db_n(void)
-{
-       int ret = ACCOUNT_ERROR_NONE;
-
-       ret = account_type_foreach_account_type_from_db(NULL, NULL);
-       assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-
-       return 0;
-}
-
diff --git a/accounts-svc.pc.in b/accounts-svc.pc.in
deleted file mode 100755 (executable)
index fead59c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# Package Information for pkg-config
-
-prefix=@PREFIX@
-exec_prefix=@EXEC_PREFIX@
-libdir=@LIBDIR@
-includedir=@INCLUDEDIR@
-
-Name: accounts-svc
-Description: Account DB library
-Version: @VERSION@
-#Requires: capi-base-common
-Libs: -L${libdir} -laccounts-svc
-Cflags: -I${includedir}
old mode 100755 (executable)
new mode 100644 (file)
index 9f703ee..c61e298
@@ -40,7 +40,7 @@ extern "C"
 
 /**
  *  @brief    Enumerations of error codes for ACCOUNT APIs.
- *  @since_tizen  2.3
+ *  @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  */
 typedef enum
 {
old mode 100755 (executable)
new mode 100644 (file)
index ac4e5d0..9b92667
@@ -38,7 +38,7 @@ extern "C"
 
 /**
  * @brief  Enumeration for the state of capability.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  */
 typedef enum
 {
@@ -51,7 +51,7 @@ account_capability_state_e;
 
 /**
  * @brief  Enumeration for the state of account secrecy.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  */
 typedef enum
 {
@@ -64,7 +64,7 @@ account_secrecy_state_e;
 
 /**
  * @brief  Enumeration for the account sync status.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  */
 typedef enum
 {
@@ -81,7 +81,7 @@ account_sync_state_e;
 
 /**
  * @brief  Enumeration for the account auth type.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  */
 typedef enum
 {
@@ -92,52 +92,33 @@ typedef enum
     ACCOUNT_AUTH_TYPE_MAX
 }account_auth_type_e;
 
-/**
- * @brief  Enumeration for the account auth data type.
- * @since_tizen  2.3
- */
-typedef enum
-{
-    ACCOUNT_AUTH_DATA_TYPE_BOOLEAN = 0, /**< Auth Data type is boolean, primitive type 'bool' */
-    ACCOUNT_AUTH_DATA_TYPE_BYTE, /**< Auth Data type is byte, primitive type 'unsigned char' */
-    ACCOUNT_AUTH_DATA_TYPE_SHORT, /**< Auth Data type is 16 bit integer, primitive type 'short int' */
-    ACCOUNT_AUTH_DATA_TYPE_USHORT, /**< Auth Data type is 16 bit unsigned integer, primitive type 'unsigned short int' */
-    ACCOUNT_AUTH_DATA_TYPE_LONG, /**< Auth Data type is 32 bit integer, primitive type 'long int' */
-    ACCOUNT_AUTH_DATA_TYPE_ULONG, /**< Auth Data type is 32 bit unsigned integer, primitive type 'unsigned long int' */
-    ACCOUNT_AUTH_DATA_TYPE_LONGLONG, /**< Auth Data type is 64 bit integer, primitive type 'long long int' */
-    ACCOUNT_AUTH_DATA_TYPE_ULONGLONG, /**< Auth Data type is 64 bit unsigned integer, primitive type 'unsigned long long int' */
-    ACCOUNT_AUTH_DATA_TYPE_DOUBLE, /**< Auth Data type is double, primitive type 'double' */
-    ACCOUNT_AUTH_DATA_TYPE_STRING /**< Auth Data type is string, primitive type 'char' */
-}account_auth_data_type_e;
-
-
 /**
  * @brief  The structure type for the Account handle.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  */
 typedef struct account_s* account_h;
 
 /**
  * @brief  The structure type for the Account provider handle.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  */
 typedef struct account_type_s* account_type_h;
 
 /**
  * @brief  The structure type for the Account handle.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  */
 typedef struct label_s* label_h;
 
 /**
  * @brief  The structure type for the Account subscribe handle.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  */
 typedef struct account_subscribe_s* account_subscribe_h;
 
 /**
  * @brief        The insert notification type.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks      When the account database is changed, You can distinguish one event type from the other which are set for subscribing notification.
  *
  * @see account_subscribe_notification()
@@ -146,7 +127,7 @@ typedef struct account_subscribe_s* account_subscribe_h;
 
 /**
  * @brief        The update notification type.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks      When the account database is changed, You can distinguish one event type from the other which are set for subscribing notification.
  *
  * @see account_subscribe_notification()
@@ -155,7 +136,7 @@ typedef struct account_subscribe_s* account_subscribe_h;
 
 /**
  * @brief        The delete notification type.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks      When the account database is changed, You can distinguish one event type from the other which are set for subscribing notification.
  *
  * @see account_subscribe_notification()
@@ -164,7 +145,7 @@ typedef struct account_subscribe_s* account_subscribe_h;
 
 /**
  * @brief        The sync_update notification type.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks      When the account database is changed, You can distinguish one event type from the other which are set for subscribing notification.
  *
  * @see account_subscribe_notification()
@@ -174,7 +155,7 @@ typedef struct account_subscribe_s* account_subscribe_h;
 
 /**
  * @brief        This is a key of app_control_h’s extra data. The value of the key is a user account name.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks      You can retrieve the value like this, app_control_get_extra_data(app_control, ACCOUNT_DATA_USERNAME, &username).\n
                  This value will be sent with ACCOUNT_OPERATION_VIEW.
  */
@@ -182,7 +163,7 @@ typedef struct account_subscribe_s* account_subscribe_h;
 
 /**
  * @brief        This is a key of app_control_h’s extra data. The value of the key is account DB ID of the user’s account information.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks      You can retrieve the value like this, app_control_get_extra_data(app_control, ACCOUNT_DATA_ID, &id).\n
                  This value will be sent with ACCOUNT_OPERATION_VIEW.
  */
@@ -190,119 +171,81 @@ typedef struct account_subscribe_s* account_subscribe_h;
 
 /**
  * @brief        This is an application launch operation name.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks      This operation will be sent when a user selects your account in add account view.
  */
 #define ACCOUNT_OPERATION_SIGNIN                          "http://tizen.org/appcontrol/operation/account/add"
 
 /**
  * @brief        This is an application launch operation name.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks      This operation will be sent when a user selects your account in account list view.
  */
 #define ACCOUNT_OPERATION_VIEW                            "http://tizen.org/appcontrol/operation/account/configure"
 
 /**
  * @brief        This is contact capability string.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks      If your provider service has contact information and contact information is provided another application, register this capability through manifest file.
  */
 #define ACCOUNT_SUPPORTS_CAPABILITY_CONTACT               "http://tizen.org/account/capability/contact"
 
 /**
  * @brief        This is calendar capability string.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks      If your provider service has calendar information and calendar information is provided another application, register this capability through manifest file.
  */
 #define ACCOUNT_SUPPORTS_CAPABILITY_CALENDAR              "http://tizen.org/account/capability/calendar"
 
 /**
  * @brief        This is email capability string.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks      If your provider service have email service and email is provided another application, register this capability through manifest file.
  */
 #define ACCOUNT_SUPPORTS_CAPABILITY_EMAIL                 "http://tizen.org/account/capability/email"
 
 /**
  * @brief        This is photo capability string.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks      If your provider service has photo and photo is provided another application, register this capability through manifest file.
  */
 #define ACCOUNT_SUPPORTS_CAPABILITY_PHOTO                 "http://tizen.org/account/capability/photo"
 
 /**
  * @brief        This is video capability string.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks      If your provider service has video and video is provided another application, register this capability through manifest file.
  */
 #define ACCOUNT_SUPPORTS_CAPABILITY_VIDEO                 "http://tizen.org/account/capability/video"
 
 /**
  * @brief        This is music capability string.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks      If your provider service has music and music is provided another application, register this capability through manifest file.
  */
 #define ACCOUNT_SUPPORTS_CAPABILITY_MUSIC                 "http://tizen.org/account/capability/music"
 
 /**
  * @brief        This is document capability string.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks      If your provider service has document and document is provided another application, register this capability through manifest file.
  */
 #define ACCOUNT_SUPPORTS_CAPABILITY_DOCUMENT                 "http://tizen.org/account/capability/document"
 
 /**
  * @brief        This is message capability string.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks      This capability will be exploited to use SMS, MMS.
  */
 #define ACCOUNT_SUPPORTS_CAPABILITY_MESSAGE               "http://tizen.org/account/capability/message"
 
 /**
  * @brief        This is game capability string.
- * @since_tizen  2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks      This capability will be exploited to use game data.
  */
 #define ACCOUNT_SUPPORTS_CAPABILITY_GAME               "http://tizen.org/account/capability/game"
 
-/**
- * @brief Authenticator app control must handle this operation ID if it wants to support SSO
- * @since 2.3
- * @see account_request_auth_token()
- */
-#define ACCOUNT_OPERATION_GET_AUTH_TOKEN                  "http://tizen.org/appcontrol/operation/account/get_auth_token"
-
-/**
- * @brief account_auth_data predefined key. Used by the account provider in account_auth_data_h.
- * @since 2.3
- */
-#define ACCOUNT_AUTHENTICATION_RESPONSE_USER_NAME "user_name"
-
-/**
- * @brief account_auth_data predefined key. Used by the account provider in account_auth_data_h.
- * @since 2.3
- */
-#define ACCOUNT_AUTHENTICATION_RESPONSE_SECRET  "secret"
-
-/**
- * @brief account_auth_data predefined key. Used by the consumer application in account_auth_data_h, to specify which mechanism to use for authentication.
- * @since 2.3
- */
-#define ACCOUNT_AUTH_DATA_AUTH_MECHANISM "mechanism"
-
-/**
- * @brief Predefined app_control_h key for ACCOUNT_OPERATION_GET_AUTH_TOKEN response. Used by the account provider to propagate service provider\n
- * specific error codes back to the consumer application. For success cases, app_control_h must not have this key
- * @since 2.3
- */
-#define ACCOUNT_AUTHENTICATION_ERROR_CODE "error_code"
-
-/**
- * @brief Predefined app_control_h key for ACCOUNT_OPERATION_GET_AUTH_TOKEN response. Used by the account provider to propagate service provider\n
- * specific error message back to the consumer application. For success cases, app_control_h must not have this key
- * @since 2.3
- */
-#define ACCOUNT_AUTHENTICATION_ERROR_MSG "error_msg"
 /**
  * @}
  */
old mode 100755 (executable)
new mode 100644 (file)
index 959c146..edbedc5
@@ -44,7 +44,7 @@ extern "C"
 /**
  * @brief   Called once for each account from the database.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account    The account handle
  * @param[in]  user_data  The user data passed from the foreach function
  *
@@ -63,7 +63,7 @@ typedef bool (*account_cb)(account_h account, void *user_data);
 /**
  * @brief  Called once for each capability of an account in the database.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]   capability_type  The capability type
  * @param[in]   capability_state The capability state
  * @param[in]   user_data        The user data passed from the foreach function
@@ -80,7 +80,7 @@ typedef bool (*capability_cb)(const char* capability_type, account_capability_st
 /**
  * @brief  Called once for each custom data of an account in the database.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  key        The user custom key
  * @param[in]  value      The user custom value of the specific key
  * @param[in]  user_data  The user data passed
@@ -98,7 +98,7 @@ typedef bool (*account_custom_cb)(char* key, char* value, void *user_data);
 /**
  * @brief  Called once for each account provider in the database.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account_type  The account provider handle
  * @param[in]  user_data     The user data passed
  *
@@ -116,7 +116,7 @@ typedef bool (*account_type_cb)(account_type_h account_type, void *user_data);
 /**
  * @brief  Called once for each account label.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  app_id     The application ID
  * @param[in]  label      The name of the account depends on the specified locale
  * @param[in]  locale     The locale is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code.\n
@@ -137,7 +137,7 @@ typedef bool (*account_label_cb)(char* app_id, char* label, char* locale, void *
 /**
  * @brief  Called once for each capability of an account provider in the database.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  app_id     The application ID
  * @param[in]  key        The user custom key
  * @param[in]  user_data  The user data passed
@@ -156,7 +156,7 @@ typedef bool (*provider_feature_cb)(char* app_id, char* key, void* user_data);
 /**
  * @brief Called once when an event occurs.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  event_type  The account event type
  * @param[in]  account_id  The account ID to update
  * @param[in]  user_data   The user data passed
@@ -176,7 +176,7 @@ typedef bool (*account_event_cb)(const char* event_type, int account_id, void* u
  *             This API is not necessary to use since Tizen 2.4.
  * @brief      Connects to the account database by readwrite mode.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel  public
  * @privilege  %http://tizen.org/privilege/account.read \n
  *             %http://tizen.org/privilege/account.wirte
@@ -197,7 +197,7 @@ int account_connect(void);
  *             This API is not necessary to use since Tizen 2.4.
  * @brief      Connects to the account database by readonly mode.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @return     @c 0 on success,
  *             otherwise a negative error value
  * @retval     #ACCOUNT_ERROR_NONE               Successful
@@ -214,7 +214,7 @@ int account_connect_readonly(void);
  *             This API is not necessary to use since Tizen 2.4.
  * @brief      Disconnects from the account database.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @return     @c 0 on success,
  *             otherwise a negative error value
  * @retval     #ACCOUNT_ERROR_NONE               Successful
@@ -230,7 +230,7 @@ int account_disconnect(void);
 /**
  * @brief  Creates a handle to the account.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks    Release @a account using account_destroy().
  * @remarks    The created handle is not added to the account database until account_insert_to_db() is called.
  *
@@ -250,7 +250,7 @@ int account_create(account_h *account);
 /**
  * @brief  Destroys the account handle and releases all its resources.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account  The account handle
  *
  * @return     @c 0 on success,
@@ -266,7 +266,7 @@ int account_destroy(account_h account);
 /**
  * @brief  Inserts the account details to the account database.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read \n
  *              %http://tizen.org/privilege/account.write
@@ -302,7 +302,7 @@ int account_insert_to_db(account_h account, int *account_db_id);
 /**
  * @brief  Deletes an account from the account database by account DB ID.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel  public
  * @privilege  %http://tizen.org/privilege/account.read \n
  *             %http://tizen.org/privilege/account.write
@@ -335,7 +335,7 @@ int account_delete_from_db_by_id(int account_db_id);
 /**
  * @brief  Deletes an account from the account database by user name.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel  public
  * @privilege  %http://tizen.org/privilege/account.read \n
  *             %http://tizen.org/privilege/account.write
@@ -369,7 +369,7 @@ int account_delete_from_db_by_user_name(char *user_name, char *package_name);
 /**
  * @brief  Deletes an account from the account database by package name.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel  public
  * @privilege  %http://tizen.org/privilege/account.read \n
  *             %http://tizen.org/privilege/account.write
@@ -400,7 +400,7 @@ int account_delete_from_db_by_package_name(const char *package_name);
 /**
  * @brief  Updates the account details to the account database.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel  public
  * @privilege  %http://tizen.org/privilege/account.read \n
  *             %http://tizen.org/privilege/account.write
@@ -431,10 +431,10 @@ int account_delete_from_db_by_package_name(const char *package_name);
 int account_update_to_db_by_id(account_h account, int account_id);
 
 /**
- * @brief      Updates the account details to the account database without checking provider's permission.
+ * @brief      Updates the account details to the account database.
  *             The provider permission check has been added since tizen 2.4.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel  public
  * @privilege  %http://tizen.org/privilege/account.read \n
  *             %http://tizen.org/privilege/account.write
@@ -468,7 +468,7 @@ int account_update_to_db_by_id_ex(account_h account, int account_id);
 /**
  * @brief  Updates the account details to the account database.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel  public
  * @privilege  %http://tizen.org/privilege/account.read \n
  *             %http://tizen.org/privilege/account.write
@@ -503,7 +503,7 @@ int account_update_to_db_by_user_name(account_h account, const char *user_name,
 /**
  * @brief  Gets the ID of an account.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]   account     The account handle
  * @param[out]  account_id  The account ID
  *
@@ -518,7 +518,7 @@ int account_get_account_id(account_h account, int *account_id);
 /**
  * @brief  Gets the user name of an account.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks    You must release @a user_name using free().
  *
  * @param[in]   account    The account handle
@@ -538,7 +538,7 @@ int account_get_user_name(account_h account, char **user_name);
 /**
  * @brief  Sets the user name of an account.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account    The account handle
  * @param[in]  user_name  The string to set as user name
  *
@@ -555,7 +555,7 @@ int account_set_user_name(account_h account, const char *user_name);
 /**
  * @brief  Gets the display name of an account.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks    You must release @a display_name using free().
  *
  * @param[in]   account       The account handle
@@ -575,7 +575,7 @@ int account_get_display_name(account_h account, char **display_name);
 /**
  * @brief  Sets the display name of an account.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account      The account handle
  * @param[in]  display_name The text string to set as the display name
  *
@@ -591,7 +591,7 @@ int account_set_display_name(account_h account, const char *display_name);
 /**
  * @brief  Gets the capability detail of an account.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]   account           The account handle
  * @param[in]   capability_type   The capability type to get the capability value
  * @param[out]  capability_value  The capability value (on/off) of the specified capability_type
@@ -609,7 +609,7 @@ int account_get_capability(account_h account, const char* capability_type, accou
 /**
  * @brief  Gets all the capabilities of an account.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account    The account handle
  * @param[in]  callback   The callback function
  * @param[in]  user_data  The user data to be passed to the callback function
@@ -626,7 +626,7 @@ int account_get_capability_all(account_h account, capability_cb callback, void *
 /**
  * @brief  Sets the capability.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account           The account handle
  * @param[in]  capability_type   The capability type
  * @param[in]  capability_state  The capability state
@@ -644,7 +644,7 @@ int account_set_capability(account_h account, const char* capability_type, accou
 /**
  * @brief  Gets the icon path.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks    You must release @a icon_path using free().
  *
  * @param[in]   account    The account handle
@@ -664,7 +664,7 @@ int account_get_icon_path(account_h account, char **icon_path);
 /**
  * @brief  Sets the icon path.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account    The account handle
  * @param[in]  icon_path  The text string to set as the icon path
  *
@@ -681,7 +681,7 @@ int account_set_icon_path(account_h account, const char *icon_path);
 /**
  * @brief  Gets the domain name.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks    You must release @a domain_name using free().
  *
  * @param[in]   account      The account handle
@@ -701,7 +701,7 @@ int account_get_domain_name(account_h account, char **domain_name);
 /**
  * @brief  Sets the domain name.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account      The account handle
  * @param[in]  domain_name  The text string to set as the domain name
  *
@@ -718,7 +718,7 @@ int account_set_domain_name(account_h account, const char *domain_name);
 /**
  * @brief  Gets the email address.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks    You must release @a email_address using free().
  *
  * @param[in]   account        The account handle
@@ -738,7 +738,7 @@ int account_get_email_address(account_h account, char **email_address);
 /**
  * @brief  Sets the email address.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account        The account handle
  * @param[in]  email_address  The text string to set as the email address
  *
@@ -755,7 +755,7 @@ int account_set_email_address(account_h account, const char *email_address);
 /**
  * @brief  Gets the package name.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks    You must release @a package_name using free().
  *
  * @param[in]   account       The account handle
@@ -775,7 +775,7 @@ int account_get_package_name(account_h account, char **package_name);
 /**
  * @brief  Sets the package name.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account       The account handle
  * @param[in]  package_name  The text string to set as the package name
  *
@@ -792,7 +792,7 @@ int account_set_package_name(account_h account, const char *package_name);
 /**
  * @brief  Gets the access token. Access token field is used to store account secrets (such as password or master token).
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks    You must release @a access_token using free().
  *
  * @param[in]   account       The account handle
@@ -814,7 +814,7 @@ int account_get_access_token(account_h account, char **access_token);
 /**
  * @brief  Sets the access token. Access token field is used to store account secrets (such as password or master token).
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account       The account handle
  * @param[in]  access_token  The text string to set as the access token
  *
@@ -831,7 +831,7 @@ int account_set_access_token(account_h account, const char *access_token);
 /**
  * @brief  Gets the user text.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks    You must release @a user_text using free().
  *
  * @param[in]   account          The account handle
@@ -852,7 +852,7 @@ int account_get_user_text(account_h account, int user_text_index, char **user_te
 /**
  * @brief  Sets the user text.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account          The account handle
  * @param[in]  user_text_index  The index of the user text (must be in range from @c 0 to @c 4)
  * @param[in]  user_text        The text string to set as the user text
@@ -870,7 +870,7 @@ int account_set_user_text(account_h account, int user_text_index, const char *us
 /**
  * @brief  Gets the user integer.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]   account         The account handle
  * @param[in]   user_int_index  The index of the user integer (must be in range from @c 0 to @c 4)
  * @param[out]  user_integer    The user integer
@@ -888,7 +888,7 @@ int account_get_user_int(account_h account, int user_int_index, int *user_intege
 /**
  * @brief  Sets the user integer.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account         The account handle
  * @param[in]  user_int_index  The index of the user integer (must be in range from @c 0 to @c 4)
  * @param[in]  user_integer    The integer to set as the user integer
@@ -906,7 +906,7 @@ int account_set_user_int(account_h account, int user_int_index, int user_integer
 /**
  * @brief  Gets the auth type.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]   account    The account handle
  * @param[out]  auth_type  The auth type
  *
@@ -923,7 +923,7 @@ int account_get_auth_type(account_h account, account_auth_type_e *auth_type);
 /**
  * @brief  Sets the auth type.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
   * @param[in]  account    The account handle
  * @param[in]  auth_type  The integer to be set as the auth type
  *
@@ -940,7 +940,7 @@ int account_set_auth_type(account_h account, const account_auth_type_e auth_type
 /**
  * @brief  Gets the secret.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]   account  The account handle
  * @param[out]  secret   The secret
  *
@@ -957,7 +957,7 @@ int account_get_secret(account_h account, account_secrecy_state_e *secret);
 /**
  * @brief  Sets the secret.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account  The account handle
  * @param[in]  secret   The secrecy to be set
  *
@@ -973,7 +973,7 @@ int account_set_secret(account_h account, const account_secrecy_state_e secret);
 /**
  * @brief  Gets the sync support.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]   account       The account handle
  * @param[out]  sync_support  The sync support
  *
@@ -990,7 +990,7 @@ int account_get_sync_support(account_h account, account_sync_state_e *sync_suppo
 /**
  * @brief  Sets the sync support.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account       The account handle
  * @param[in]  sync_support  The sync state to be set
  *
@@ -1007,7 +1007,7 @@ int account_set_sync_support(account_h account, const account_sync_state_e sync_
 /**
  * @brief  Gets the source.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks    You must release @a user_text using free().
  *
  * @param[in]   account  The account handle
@@ -1027,7 +1027,7 @@ int account_get_source(account_h account, char **source);
 /**
  * @brief  Sets the source.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account  The account handle
  * @param[in]  source   The text string to set as the source
  *
@@ -1043,7 +1043,7 @@ int account_set_source(account_h account, const char *source);
 /**
  * @brief  Sets the custom.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account  The account handle
  * @param[in]  key      The user custom key for the specific value
  * @param[in]  value    The user custom value about the given key
@@ -1060,7 +1060,7 @@ int account_set_custom(account_h account, const char* key, const char* value);
 /**
  * @brief  Gets the user specific custom text of an account key.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]   account   The account handle
  * @param[in]   key       The key to retrieve custom text
  * @param[out]  value     The text of the given key
@@ -1079,7 +1079,7 @@ int account_get_custom(account_h account, const char* key, char** value);
 /**
  * @brief  Gets all the user custom texts of an account.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]  account    The account handle
  * @param[in]  callback   The callback function to retrieve all custom text \n
  *                        The callback function gives the key and value.
@@ -1097,7 +1097,7 @@ int account_get_custom_all(account_h account, account_custom_cb callback, void*
 /**
  * @brief  Retrieves all accounts details by invoking the given callback function iteratively.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read
  * @param[in]   callback   The callback function to invoke
@@ -1128,7 +1128,7 @@ int account_foreach_account_from_db(account_cb callback, void *user_data);
 /**
  * @brief  Retrieve an account with the account ID.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read
  * @param[in]   account_db_id  The account database ID to search
@@ -1157,7 +1157,7 @@ int account_query_account_by_account_id(int account_db_id, account_h *account);
 /**
  * @brief  Retrieves all accounts with the user name.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read
  * @param[in]   callback   The callback function to invoke
@@ -1189,7 +1189,7 @@ int account_query_account_by_user_name(account_cb callback, const char* user_nam
 /**
  * @brief  Retrieves all accounts with the package name.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel  public
  * @privilege  %http://tizen.org/privilege/account.read
  * @param[in]  callback      The callback function to invoke
@@ -1220,7 +1220,7 @@ int account_query_account_by_package_name(account_cb callback, const char *packa
 /**
  * @brief  Retrieves all accounts with the capability type and capability value.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read
  * @param[in]   callback          The callback function to invoke
@@ -1252,7 +1252,7 @@ int account_query_account_by_capability(account_cb callback, const char* capabil
 /**
  * @brief  Retrieves all accounts with the capability type.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read
  * @param[in]   callback         The callback function to invoke
@@ -1283,7 +1283,7 @@ int account_query_account_by_capability_type(account_cb callback, const char* ca
 /**
  * @brief  Retrieves all capabilities with the account database ID.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read
  * @param[in]   callback       The callback function to invoke
@@ -1313,7 +1313,7 @@ int account_query_capability_by_account_id(capability_cb callback, int account_d
 /**
  * @brief  Gets the count of accounts in the account database.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read
  * @param[out]  count  The out parameter for count of all accounts
@@ -1335,7 +1335,7 @@ int account_get_total_count_from_db(int *count);
 /**
  * @brief  Updates the sync status of an account with the given account ID.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read \n
  *              %http://tizen.org/privilege/account.write
@@ -1367,7 +1367,7 @@ int account_update_sync_status_by_id(int account_db_id, const account_sync_state
 /**
  * @brief  Creates a handle to the account provider.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks     You must release @a account_type handle using account_type_destroy().\n
  *
  * @param[in]  account_type  The account provider handle
@@ -1385,7 +1385,7 @@ int account_type_create(account_type_h *account_type);
 /**
  * @brief  Destroys the account provider handle and releases all its resources.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  *
  * @remarks    When you get @a account_type_h using account_type_create(), you must release the handle using account_destroy() to avoid the memory leak.
  *
@@ -1403,7 +1403,7 @@ int account_type_destroy(account_type_h account_type);
 /**
  * @brief  Retrieves capability information with your application ID.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read
  * @param[in]   callback   The callback function carries the capability name of an app ID
@@ -1430,7 +1430,7 @@ int account_type_query_provider_feature_by_app_id(provider_feature_cb callback,
 /**
  * @brief   Checks whether the given application ID supports the capability.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read
  * @remarks     The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
@@ -1460,7 +1460,7 @@ bool account_type_query_supported_feature(const char* app_id, const char* capabi
 /**
  * @brief  Gets the application ID of an account provider.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks     You must release @a app_id using free().
  *
  * @param[in]   account_type  The account provider handle \n
@@ -1481,7 +1481,7 @@ int account_type_get_app_id(account_type_h account_type, char **app_id);
 /**
  * @brief  Gets the service provider ID of an account provider.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks     You must release @a service_provider_id using free().
  *
  * @param[in]   account_type         The account provider handle \n
@@ -1502,7 +1502,7 @@ int account_type_get_service_provider_id(account_type_h account_type, char **ser
 /**
  * @brief  Gets the icon path of an account provider.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks     You must release @a icon_path using free().
  *
  * @param[in]   account_type  The account provider handle \n
@@ -1523,7 +1523,7 @@ int account_type_get_icon_path(account_type_h account_type, char **icon_path);
 /**
  * @brief  Gets the small icon path of an account provider.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks    You must release @a small_icon_path using free().
  *
  * @param[in]   account_type     The account provider handle\n
@@ -1544,7 +1544,7 @@ int account_type_get_small_icon_path(account_type_h account_type, char **small_i
 /**
  * @brief  Checks whether the given account provider supports multiple accounts.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]   account_type              The account provider handle \n
  *                                        It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db.
  * @param[out]  multiple_account_support  The flag indicating support for multiple accounts accounts\n
@@ -1564,7 +1564,7 @@ int account_type_get_multiple_account_support(account_type_h account_type, int *
 /**
  * @brief  Gets capability information with the given account provider handle.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]   account_type  The account provider handle\n
  *                            It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
  * @param[in]   callback      The callback function that carries the capability name of the app ID
@@ -1587,7 +1587,7 @@ int account_type_get_provider_feature_all(account_type_h account_type, provider_
 /**
  * @brief  Gets the specific label information detail of an account provider.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]   account_type The account provider handle\n
  *                           It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
  * @param[in]   locale       The locale is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code.\n
@@ -1609,7 +1609,7 @@ int account_type_get_label_by_locale(account_type_h account_type, const char* lo
 /**
  * @brief  Gets the label information detail of an account provider.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @param[in]   account_type  The account provider handle\n
  *                            It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
  * @param[in]   callback      The callback function carrying the label information
@@ -1628,7 +1628,7 @@ int account_type_get_label(account_type_h account_type, account_label_cb callbac
 /**
  * @brief  Retrieves the label information with your application ID.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read
  * @param[in]   callback    The callback function that carries label_h for label information \n
@@ -1658,7 +1658,7 @@ int account_type_query_label_by_app_id(account_label_cb callback, const char* ap
 /**
  * @brief  Retrieves the account provider information with your application ID.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read
  * @param[in]   app_id        The application ID to search
@@ -1691,7 +1691,7 @@ int account_type_query_by_app_id(const char* app_id, account_type_h *account_typ
 /**
  * @brief  Retrieves all account priovider information.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read
  * @param[in]   callback   The account provider information \n
@@ -1725,7 +1725,7 @@ int account_type_foreach_account_type_from_db(account_type_cb callback, void *us
 /**
  * @brief  Retrieves the label information with the given application ID and locale.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read
  * @param[in]   app_id  The application ID
@@ -1752,7 +1752,7 @@ int account_type_query_label_by_locale(const char* app_id, const char* locale, c
 /**
  * @brief  Retrieves account provider information with the capability name.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read
  * @param[in]   callback        The callback function to retrieve account provider information
@@ -1779,7 +1779,7 @@ int account_type_query_by_provider_feature(account_type_cb callback, const char*
 /**
  * @brief  Checks whether the given app_id exists in the account provider DB.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read
  * @param[in]   app_id  The application ID to check
@@ -1807,7 +1807,7 @@ int account_type_query_app_id_exist(const char* app_id);
 /**
  * @brief  Creates a handle for the account event subscription.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @remarks     You must release @a account_subscribe handle using account_unsubscribe_notification().
  *
  * @param[in]   account_subscribe  The account subscription handle
@@ -1826,7 +1826,7 @@ int account_subscribe_create(account_subscribe_h* account_subscribe);
 /**
  * @brief  Starts to subscribe account event through the given callback function.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read \n
  * @param[in]   account_subscribe  The account subscription handle
@@ -1850,7 +1850,7 @@ int account_subscribe_notification(account_subscribe_h account_subscribe, accoun
 /**
  * @brief  Destroys the account subscribe handle and releases all its resources.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.4 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read \n
  * @remarks     You must call @a account_unsubscribe_notification when you do not need to subscribe account event.
@@ -1867,271 +1867,6 @@ int account_subscribe_notification(account_subscribe_h account_subscribe, accoun
  */
 int account_unsubscribe_notification(account_subscribe_h account_subscribe);
 
-/**
- * @internal
- * @deprecated Deprecated since Tizen 2.4.\n
- *             Don't use this api in Tizen 2.4.\n
- *             This API hasn't been operated since Tizen 2.4 and will be removed after tizen 3.0.
- * @brief  Sets the app ID.
- *         It should be filled with your application ID. For example, com.tizen.testapp.
- *
- * @since_tizen 2.3
- * @remarks     @a app_id is a mandatory field and does not allow duplicate app ID in the account provider database.
- *
- * @param[in]   account_type  The account provider handle \n
- *                            It should be assigned by account_type_create().
- * @param[in]   app_id        The application ID
- *
- * @return  @c 0 on success,
- *          otherwise a negative error value
- * @retval  #ACCOUNT_ERROR_NONE               Successful
- * @retval  #ACCOUNT_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval  #ACCOUNT_ERROR_OUT_OF_MEMORY      Out of memory
- *
- * @see account_type_get_app_id()
- */
-int account_type_set_app_id(account_type_h account_type, const char *app_id);
-
-/**
- * @internal
- * @deprecated Deprecated since Tizen 2.4.\n
- *             Don't use this api in Tizen 2.4.\n
- *             This API hasn't been operated since Tizen 2.4 and will be removed after tizen 3.0.
- * @brief  Sets the service provider ID.
- *         It should be filled with your service provider ID.
- *
- * @since_tizen 2.3
- * @remarks    @a service_provider_id is a mandatory field.
- *
- * @param[in]  account_type         The account provider handle \n
- *                                  It should be assigned by account_type_create().
- * @param[in]  service_provider_id  The service provider ID
- *
- * @return  @c 0 on success,
- *          otherwise a negative error value
- * @retval  #ACCOUNT_ERROR_NONE               Successful
- * @retval  #ACCOUNT_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval  #ACCOUNT_ERROR_OUT_OF_MEMORY      Out of memory
- *
- * @see account_type_get_service_provider_id()
- */
-int account_type_set_service_provider_id(account_type_h account_type, const char *service_provider_id);
-
-/**
- * @internal
- * @deprecated Deprecated since Tizen 2.4.\n
- *             Don't use this api in Tizen 2.4.\n
- *             This API hasn't been operated since Tizen 2.4 and will be removed after tizen 3.0.
- * @brief  Sets icon path.
- *         It represents your service provider or an application.
- *
- * @since_tizen 2.3
- * @remarks     @a icon_path is not a mandatory field. But when it is set, you can display this icon in the Add Account screen.
- *
- * @param[in]  account_type  The account provider handle\n
- *                           It should be assigned by account_type_create().
- * @param[in]  icon_path     The icon path of the application
- *
- * @return  @c 0 on success,
- *          otherwise a negative error value
- * @retval  #ACCOUNT_ERROR_NONE               Successful
- * @retval  #ACCOUNT_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval  #ACCOUNT_ERROR_OUT_OF_MEMORY      Out of memory
- *
- * @see account_type_get_icon_path()
- */
-int account_type_set_icon_path(account_type_h account_type, const char *icon_path);
-
-/**
- * @internal
- * @deprecated Deprecated since Tizen 2.4.\n
- *             Don't use this api in Tizen 2.4.\n
- *             This API hasn't been operated since Tizen 2.4 and will be removed after tizen 3.0.
- * @brief  Sets small icon path.
- *         It also represents your service provider or an application.
- *
- * @since_tizen 2.3
- * @remarks     @a small_icon_path is not a mandatory field.
- *
- * @param[in]   account_type     The account provider handle \n
- *                               It should be assigned by account_type_create().
- * @param[in]   small_icon_path  The scaled icon of your application
- *
- * @return  @c 0 on success,
- *          otherwise a negative error value
- * @retval  #ACCOUNT_ERROR_NONE               Successful
- * @retval  #ACCOUNT_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval  #ACCOUNT_ERROR_OUT_OF_MEMORY      Out of memory
- *
- * @see account_type_get_small_icon_path()
- */
-int account_type_set_small_icon_path(account_type_h account_type, const char *small_icon_path);
-
-/**
- * @internal
- * @deprecated Deprecated since Tizen 2.4.\n
- *             Don't use this api in Tizen 2.4.\n
- *             This API hasn't been operated since Tizen 2.4 and will be removed after tizen 3.0.
- * @brief  Sets support for multiple accounts.
- *         It represents whether your application supports multiple accounts.
- *
- * @since_tizen 2.3
- * @remarks     The default value of multiple account support is @c FALSE.
- *
- * @param[in]   account_type              The account provider handle \n
- *                                        It should be assigned by account_type_create().
- * @param[in]   multiple_account_support  Set @c TRUE if your application can support two or more accounts, \n
- *                                        otherwise @c FALSE if your application can support only one account
- *
- * @return  @c 0 on success,
- *          otherwise a negative error value
- * @retval  #ACCOUNT_ERROR_NONE               Successful
- * @retval  #ACCOUNT_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval  #ACCOUNT_ERROR_OUT_OF_MEMORY      Out of memory
- *
- * @see account_type_get_multiple_account_support()
- */
-int account_type_set_multiple_account_support(account_type_h account_type, const bool multiple_account_support);
-
-/**
- * @internal
- * @deprecated Deprecated since Tizen 2.4.\n
- *             Don't use this api in Tizen 2.4.\n
- *             This API hasn't been operated since Tizen 2.4 and will be removed after tizen 3.0.
- * @brief  Sets label and locale.
- *         Label represents the name of an account provider.
- *
- * @since_tizen 2.3
- * @param[in]   account_type  The account provider handle \n
- *                            It should be assigned by account_type_create().
- * @param[in]   label         The name of account depends on the specified locale
- * @param[in]   locale        The locale is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code.\n
- *                            For example, "ko_KR" for Korean, "en_US" for American English.
- *
- * @return  @c 0 on success,
- *          otherwise a negative error value
- * @retval  #ACCOUNT_ERROR_NONE               Successful
- * @retval  #ACCOUNT_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval  #ACCOUNT_ERROR_OUT_OF_MEMORY      Out of memory
- *
- * @see account_type_get_label()
- */
-int account_type_set_label(account_type_h account_type, const char* label, const char* locale);
-
-/**
- * @internal
- * @deprecated Deprecated since Tizen 2.4.\n
- *             Don't use this api in Tizen 2.4.\n
- *             This API hasn't been operated since Tizen 2.4 and will be removed after tizen 3.0.
- * @brief  Sets the capability.
- *
- * @since_tizen 2.3
- * @param[in]   account_type      The account provider handle
- * @param[in]   provider_feature  Th capability key of the account
- *
- * @return  @c 0 on success,
- *          otherwise a negative error value
- * @retval  #ACCOUNT_ERROR_NONE               Successful
- * @retval  #ACCOUNT_ERROR_INVALID_PARAMETER  Invalid parameter
- *
- * @see account_set_capability()
- */
-int account_type_set_provider_feature(account_type_h account_type, const char* provider_feature);
-
-/**
- * @internal
- * @deprecated Deprecated since Tizen 2.4.\n
- *             Don't use this api in Tizen 2.4.\n
- *             This API hasn't been operated since Tizen 2.4 and will be removed after tizen 3.0.
- * @brief  Inserts the account provider details to the database.
- *
- * @since_tizen 2.3
- * @privlevel   public
- * @privilege   %http://tizen.org/privilege/account.read \n
- *              %http://tizen.org/privilege/account.write
- * @remarks     this API need both privileges
- * @param[in]   account_type     The account handle which is created by account_type_create() \n
- * @param[out]  account_type_id  The account provider ID to be assigned after inserting the account provider handle
- *
- * @return  @c 0 on success,
- *          otherwise a negative error value
- * @retval  #ACCOUNT_ERROR_NONE               Successful
- * @retval  #ACCOUNT_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval  #ACCOUNT_ERROR_DB_FAILED          Database operation failed
- * @retval  #ACCOUNT_ERROR_PERMISSION_DENIED  DB Access fail by permission
- * @retval  #ACCOUNT_ERROR_DATABASE_BUSY      SQLite handler is busy
- * @retval  #ACCOUNT_ERROR_DB_NOT_OPENED      Account database did not opened
- *
- * @pre   This function requires an open connection to an account service by account_connect().
- * @post  account_disconnect() is recommended after insertion.
- *
- * @see account_connect()
- * @see account_disconnect()
- */
-int account_type_insert_to_db(account_type_h account_type, int* account_type_id);
-
-/**
- * @internal
- * @deprecated Deprecated since Tizen 2.4.\n
- *             Don't use this api in Tizen 2.4.\n
- *             This API hasn't been operated since Tizen 2.4 and will be removed after tizen 3.0.
- * @brief  Updates the account details to the account database.
- *
- * @since_tizen 2.3
- * @privlevel   public
- * @privilege   %http://tizen.org/privilege/account.read \n
- *              %http://tizen.org/privilege/account.write
- * @remarks     this API need both privileges
- * @param[in]   account_type  The account handle which is created by account_type_create() \n
- * @param[in]   app_id        The application ID of the account provider
- *
- * @return  @c 0 on success,
- *          otherwise a negative error value
- * @retval  #ACCOUNT_ERROR_NONE               Successful
- * @retval  #ACCOUNT_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval  #ACCOUNT_ERROR_DB_FAILED          Database operation failed
- * @retval  #ACCOUNT_ERROR_PERMISSION_DENIED  DB Access fail by permission
- * @retval  #ACCOUNT_ERROR_DATABASE_BUSY      SQLite handler is busy
- *
- * @pre   This function requires an open connection to an account service by account_connect().
- * @post  account_disconnect() is recommended after update.
- *
- * @see account_connect()
- * @see account_disconnect()
- */
-int account_type_update_to_db_by_app_id(const account_type_h account_type, const char* app_id);
-
-/**
- * @internal
- * @deprecated Deprecated since Tizen 2.4.\n
- *             Don't use this api in Tizen 2.4.\n
- *             This API hasn't been operated since Tizen 2.4 and will be removed after tizen 3.0.
- * @brief  Deletes the account provider from the account database by application ID.
- *
- * @since_tizen 2.3
- * @privlevel   public
- * @privilege   %http://tizen.org/privilege/account.read \n
- *              %http://tizen.org/privilege/account.write
- * @remarks     this API need both privileges
- * @param[in]   app_id  The application ID of account provider to be deleted
- *
- * @return  @c 0 on success,
- *          otherwise a negative error value
- * @retval  #ACCOUNT_ERROR_NONE               Successful
- * @retval  #ACCOUNT_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval  #ACCOUNT_ERROR_DB_FAILED          Database operation failed
- * @retval  #ACCOUNT_ERROR_PERMISSION_DENIED  DB Access fail by permission
- * @retval  #ACCOUNT_ERROR_DATABASE_BUSY      SQLite handler is busy
- * @retval  #ACCOUNT_ERROR_DB_NOT_OPENED      Account database did not opened
- *
- * @pre  This function requires an open connection to an account service by account_connect().
- *
- * @see account_connect()
- * @see account_disconnect()
- */
-int account_type_delete_by_app_id(const char* app_id);
-
-
 #ifdef __cplusplus
 }
 #endif
old mode 100755 (executable)
new mode 100644 (file)
index 7ea09ed86edd125d9a9c8d080cc3db152c71e6d4..644f8c1f429f2d9aa049904290e95bcd169729f0 100644 (file)
 #ifndef __ACCOUNT_INTERNAL_H__
 #define __ACCOUNT_INTERNAL_H__
 
-//#include <account.h>
-
 #ifdef __cplusplus
 extern "C"
 {
 #endif
 
+#ifndef ACCOUNT_INTERNAL_API
+#define ACCOUNT_INTERNAL_API __attribute__ ((visibility("default")))
+#endif
+
 /**
  * @file        account_internal.h
  * @brief       This file contains the Account API for account management.
@@ -119,7 +121,7 @@ int account_update_to_db_by_id_without_permission(account_h account, int account
  *
  * @see account_type_get_app_id()
  */
-int account_type_set_app_id_internal(account_type_h account_type, const char *app_id);
+int account_type_set_app_id(account_type_h account_type, const char *app_id);
 
 /**
  * @internal
@@ -141,7 +143,7 @@ int account_type_set_app_id_internal(account_type_h account_type, const char *ap
  *
  * @see account_type_get_service_provider_id()
  */
-int account_type_set_service_provider_id_internal(account_type_h account_type, const char *service_provider_id);
+int account_type_set_service_provider_id(account_type_h account_type, const char *service_provider_id);
 
 /**
  * @internal
@@ -163,7 +165,7 @@ int account_type_set_service_provider_id_internal(account_type_h account_type, c
  *
  * @see account_type_get_icon_path()
  */
-int account_type_set_icon_path_internal(account_type_h account_type, const char *icon_path);
+int account_type_set_icon_path(account_type_h account_type, const char *icon_path);
 
 /**
  * @internal
@@ -185,7 +187,7 @@ int account_type_set_icon_path_internal(account_type_h account_type, const char
  *
  * @see account_type_get_small_icon_path()
  */
-int account_type_set_small_icon_path_internal(account_type_h account_type, const char *small_icon_path);
+int account_type_set_small_icon_path(account_type_h account_type, const char *small_icon_path);
 
 /**
  * @internal
@@ -208,7 +210,7 @@ int account_type_set_small_icon_path_internal(account_type_h account_type, const
  *
  * @see account_type_get_multiple_account_support()
  */
-int account_type_set_multiple_account_support_internal(account_type_h account_type, const bool multiple_account_support);
+int account_type_set_multiple_account_support(account_type_h account_type, const bool multiple_account_support);
 
 /**
  * @internal
@@ -230,7 +232,7 @@ int account_type_set_multiple_account_support_internal(account_type_h account_ty
  *
  * @see account_type_get_label()
  */
-int account_type_set_label_internal(account_type_h account_type, const char* label, const char* locale);
+int account_type_set_label(account_type_h account_type, const char* label, const char* locale);
 
 /**
  * @internal
@@ -247,7 +249,7 @@ int account_type_set_label_internal(account_type_h account_type, const char* lab
  *
  * @see account_set_capability()
  */
-int account_type_set_provider_feature_internal(account_type_h account_type, const char* provider_feature);
+int account_type_set_provider_feature(account_type_h account_type, const char* provider_feature);
 
 /**
  * @internal
@@ -276,7 +278,7 @@ int account_type_set_provider_feature_internal(account_type_h account_type, cons
  * @see account_connect()
  * @see account_disconnect()
  */
-int account_type_insert_to_db_internal(account_type_h account_type, int* account_type_id);
+int account_type_insert_to_db(account_type_h account_type, int* account_type_id);
 
 /**
  * @internal
@@ -304,7 +306,7 @@ int account_type_insert_to_db_internal(account_type_h account_type, int* account
  * @see account_connect()
  * @see account_disconnect()
  */
-int account_type_update_to_db_by_app_id_internal(const account_type_h account_type, const char* app_id);
+int account_type_update_to_db_by_app_id(const account_type_h account_type, const char* app_id);
 
 /**
  * @internal
@@ -331,7 +333,49 @@ int account_type_update_to_db_by_app_id_internal(const account_type_h account_ty
  * @see account_connect()
  * @see account_disconnect()
  */
-int account_type_delete_by_app_id_internal(const char* app_id);
+int account_type_delete_by_app_id(const char* app_id);
+
+/**
+ * @internal
+ * @brief       Start to subscribe account event through the given callback function
+ *
+ * @param[in]   account_subscribe       The account subscription handle
+ * @param[in]   cb_func When an account is removed from account database. It will be called with event message and account id.
+ * @param[in]   user_data user_data will be delivered to cb_func
+ *
+ * @return      0 on success, otherwise a negative error value.
+ * @retval      #ACCOUNT_ERROR_NONE Successful
+ * @retval      #ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL Subscription fail
+ * @retval      #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see account_unsubscribe_notification()
+ * @see account_subscribe_notification()
+ */
+ACCOUNT_API int account_subscribe_notification_ex(account_subscribe_h account_subscribe, account_event_cb cb_func, void* user_data);
+
+/**
+ * @internal
+ * @brief       Start to subscribe account event through the given callback function
+ *
+ * @param[in]   account_subscribe       The account subscription handle
+ * @param[in]   cb_func When an account is removed from account database. It will be called with event message and account id.
+ * @param[in]   user_data user_data will be delivered to cb_func
+ *
+ * @return      0 on success, otherwise a negative error value.
+ * @retval      #ACCOUNT_ERROR_NONE Successful
+ * @retval      #ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL Subscription fail
+ * @retval      #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see account_unsubscribe_notification()
+ * @see account_subscribe_notification()
+ */
+ACCOUNT_API int account_unsubscribe_notification_ex(account_subscribe_h account_subscribe);
+
+
+/*offline apis*/
+int account_type_insert_to_db_offline(account_type_h account_type, int* account_type_id);
+
+int account_type_delete_by_app_id_offline(const char* app_id);
 
 /**
 * @}
old mode 100755 (executable)
new mode 100644 (file)
index 6bed522..4c9e964
@@ -35,40 +35,6 @@ extern "C"
  * @{
  */
 
-/**
- * @brief       Start to subscribe account event through the given callback function
- *
- * @param[in]   account_subscribe       The account subscription handle
- * @param[in]   cb_func When an account is removed from account database. It will be called with event message and account id.
- * @param[in]   user_data user_data will be delivered to cb_func
- *
- * @return      0 on success, otherwise a negative error value.
- * @retval      #ACCOUNT_ERROR_NONE Successful
- * @retval      #ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL Subscription fail
- * @retval      #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @see account_unsubscribe_notification()
- * @see account_subscribe_notification()
- */
-ACCOUNT_API int account_subscribe_notification_ex(account_subscribe_h account_subscribe, account_event_cb cb_func, void* user_data);
-
-/**
- * @brief       Start to subscribe account event through the given callback function
- *
- * @param[in]   account_subscribe       The account subscription handle
- * @param[in]   cb_func When an account is removed from account database. It will be called with event message and account id.
- * @param[in]   user_data user_data will be delivered to cb_func
- *
- * @return      0 on success, otherwise a negative error value.
- * @retval      #ACCOUNT_ERROR_NONE Successful
- * @retval      #ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL Subscription fail
- * @retval      #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @see account_unsubscribe_notification()
- * @see account_subscribe_notification()
- */
-ACCOUNT_API int account_unsubscribe_notification_ex(account_subscribe_h account_subscribe);
-
 /**
  * @brief  Gets the count of accounts whose secrect state is visible in the account database.
  * @since_tizen 2.3
diff --git a/libaccount-service.manifest b/libaccount-service.manifest
new file mode 100644 (file)
index 0000000..81ace0c
--- /dev/null
@@ -0,0 +1,6 @@
+<manifest>
+       <request>
+               <domain name="_"/>
+       </request>
+</manifest>
+
diff --git a/packaging/.libaccount-service.spec.swp b/packaging/.libaccount-service.spec.swp
new file mode 100644 (file)
index 0000000..9c69e61
Binary files /dev/null and b/packaging/.libaccount-service.spec.swp differ
old mode 100755 (executable)
new mode 100644 (file)
index b21ace5..2f3cc86
@@ -8,15 +8,13 @@ License:    Apache-2.0
 Source0:    libaccount-service-%{version}.tar.gz
 
 BuildRequires:  cmake
-BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(dlog)
-BuildRequires:  pkgconfig(dbus-1)
 BuildRequires:  pkgconfig(capi-base-common)
 BuildRequires:  pkgconfig(vconf)
 BuildRequires: pkgconfig(glib-2.0) >= 2.26
-BuildRequires:  pkgconfig(gio-2.0)
 BuildRequires:  pkgconfig(gio-unix-2.0)
-BuildRequires:  python-xml
+BuildRequires:  pkgconfig(account-common)
+BuildRequires:  pkgconfig(db-util)
 
 %description
 Account DB libraryXB-Public-Package: no
@@ -48,7 +46,10 @@ Development files for %{name}
 
 export CFLAGS="${CFLAGS} -fPIC -fvisibility=hidden"
 #cmake . -DCMAKE_INSTALL_PREFIX=/usr
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIBDIR=%{_libdir} -DINCLUDEDIR=%{_includedir}
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+       -DLIBDIR=%{_libdir} \
+       -DBINDIR=%{_bindir} \
+       -DINCLUDEDIR=%{_includedir}
 
 make %{?jobs:-j%jobs}
 
@@ -62,10 +63,12 @@ mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
 rm -rf %{buildroot}%{_libdir}/accounts-svc
 
 %files
+%manifest libaccount-service.manifest
 %defattr(-,root,root,-)
 %{_libdir}/*.so.*
 
 %files devel
+%manifest libaccount-service.manifest
 %defattr(-,root,root,-)
 %{_libdir}/*.so
 %{_libdir}/pkgconfig/accounts-svc.pc
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9ed4c13
--- /dev/null
@@ -0,0 +1,65 @@
+
+SET(SRCS
+       account.c
+       account_offline.c
+)
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(clientpkgs REQUIRED
+               dlog
+               glib-2.0
+               gio-unix-2.0
+               capi-base-common
+               vconf
+               account-common
+               db-util
+)
+
+FOREACH(flag ${clientpkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+FIND_PROGRAM(UNAME NAMES uname)
+EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+IF ("${ARCH}" STREQUAL "arm")
+        ADD_DEFINITIONS("-DTARGET_ARM")
+        MESSAGE("[TARGET] Compile")
+ELSE  ("${ARCH}" STREQUAL "arm")
+        ADD_DEFINITIONS("-DTARGET_I386")
+        MESSAGE("[i386] Compile")
+ENDIF ("${ARCH}" STREQUAL "arm")
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror")
+SET(CMAKE_LDFLAGS "-Wl,-zdefs")
+
+ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"")
+ADD_DEFINITIONS("-DSLP_DEBUG")
+
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${clientpkgs_LDFLAGS})
+
+CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
+
+#INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib/accounts-svc)
+#INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib)
+#INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR}/accounts-svc)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR})
+INSTALL(FILES ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}.pc DESTINATION ${LIBDIR}/pkgconfig)
+
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/account.h DESTINATION include)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/account-error.h DESTINATION include)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/account-types.h DESTINATION include)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/account_internal.h DESTINATION include)
+
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/src/${PROJECT_NAME}.pc.in ${CMAKE_SOURCE_DIR}/src/${PROJECT_NAME}.pc @ONLY)
+INSTALL(FILES ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}.pc DESTINATION ${LIBDIR}/pkgconfig)
+#CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/src/${PROJECT_NAME}.pc.in ${CMAKE_SOURCE_DIR}/src/${PROJECT_NAME}.pc @ONLY)
+#INSTALL(FILES ${CMAKE_SOURCE_DIR}/src/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
diff --git a/src/account.c b/src/account.c
new file mode 100644 (file)
index 0000000..947957a
--- /dev/null
@@ -0,0 +1,2900 @@
+/*
+ *
+ * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdlib.h>
+#include <glib.h>
+#include <fcntl.h>
+#include <glib/gprintf.h>
+#ifdef G_OS_UNIX
+#include <gio/gunixfdlist.h>
+#include <unistd.h>
+#endif
+#include <vconf.h>
+
+#include <dbg.h>
+#include <account-private.h>
+#include <account_ipc_marshal.h>
+#include <account-mgr-stub.h>
+
+#include "account.h"
+#include "account-error.h"
+#include "account-types.h"
+#include "account_internal.h"
+#include "account_private_client.h"
+
+#define ACCOUNT_DB_OPEN_READONLY 0
+#define ACCOUNT_DB_OPEN_READWRITE 1
+
+#define VCONF_OK 0
+
+static AccountManager *_acc_mgr = NULL;
+
+static char *_account_get_text(const char *text_data);
+static int _account_gslist_free(GSList* list);
+static int _account_glist_free(GList* list);
+
+static int _account_free_capability_items(account_capability_s *data)
+{
+       _ACCOUNT_FREE(data->type);
+       _ACCOUNT_FREE(data->package_name);
+       _ACCOUNT_FREE(data->user_name);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+static int _account_custom_item_free(account_custom_s *data)
+{
+       _ACCOUNT_FREE(data->app_id);
+       _ACCOUNT_FREE(data->key);
+       _ACCOUNT_FREE(data->value);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+static int _account_custom_gslist_free(GSList* list)
+{
+       if(!list){
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       GSList* iter;
+
+       for (iter = list; iter != NULL; iter = g_slist_next(iter)) {
+               account_custom_s *custom_data = (account_custom_s*)iter->data;
+               _account_custom_item_free(custom_data);
+               _ACCOUNT_FREE(custom_data);
+       }
+
+       g_slist_free(list);
+       list = NULL;
+
+       return ACCOUNT_ERROR_NONE;
+}
+/*
+static int _account_list_free(GList* list)
+{
+       if(!list){
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       g_list_free_full(list, g_free);
+       list = NULL;
+
+       return ACCOUNT_ERROR_NONE;
+}
+*/
+
+static int _account_free_account_items(account_s *data)
+{
+       _ACCOUNT_FREE(data->user_name);
+       _ACCOUNT_FREE(data->email_address);
+       _ACCOUNT_FREE(data->display_name);
+       _ACCOUNT_FREE(data->icon_path);
+       _ACCOUNT_FREE(data->source);
+       _ACCOUNT_FREE(data->package_name);
+       _ACCOUNT_FREE(data->domain_name);
+       _ACCOUNT_FREE(data->access_token);
+
+       int i;
+       for(i=0;i<USER_TXT_CNT;i++)
+               _ACCOUNT_FREE(data->user_data_txt[i]);
+
+       _account_gslist_free(data->capablity_list);
+       _account_glist_free(data->account_list);
+       _account_custom_gslist_free(data->custom_list);
+//     _account_list_free(data->domain_list);
+//     _account_list_free(data->mechanism_list);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+static int _account_gslist_free(GSList* list)
+{
+       if(!list){
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       GSList* iter;
+
+       for (iter = list; iter != NULL; iter = g_slist_next(iter)) {
+               account_capability_s *cap_data = (account_capability_s*)iter->data;
+               _account_free_capability_items(cap_data);
+               _ACCOUNT_FREE(cap_data);
+       }
+
+       g_slist_free(list);
+       list = NULL;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+static int _account_glist_free(GList* list)
+{
+       if(!list){
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       GList* iter;
+
+       for (iter = list; iter != NULL; iter = g_list_next(iter)) {
+               account_s *account_record = (account_s*)iter->data;
+               _account_free_account_items(account_record);
+               _ACCOUNT_FREE(account_record);
+       }
+
+       g_list_free(list);
+       list = NULL;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+static char *_account_get_text(const char *text_data)
+{
+       char *text_value = NULL;
+
+       if (text_data != NULL) {
+               text_value = strdup(text_data);
+       }
+       return text_value;
+}
+
+//FIXME : add true singleton logic
+AccountManager *
+_account_manager_get_instance ()
+{
+       _INFO("_account_manager_get_instance");
+       if (_acc_mgr != NULL)
+       {
+               _INFO("instance already created.");
+               return _acc_mgr;
+       }
+
+#if !GLIB_CHECK_VERSION(2,35,0)
+       g_type_init();
+#endif
+
+       GDBusConnection *connection = NULL;
+       GError *error = NULL;
+
+       connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
+
+       _INFO("after g_bus_get_sync");
+
+
+       /* Create the object */
+       _acc_mgr =
+               account_manager_proxy_new_sync(connection,
+                                                                                G_DBUS_PROXY_FLAGS_NONE,
+                                                                                "org.tizen.account.manager",
+                                                                               "/org/tizen/account/manager",
+                                                                               NULL,
+                                                                                &error);
+       _INFO("_account_manager_get_instance end");
+       return _acc_mgr;
+}
+
+GDBusErrorEntry _account_svc_errors[] =
+{
+       {ACCOUNT_ERROR_NONE, _ACCOUNT_SVC_ERROR_PREFIX".NoError"},
+       {ACCOUNT_ERROR_OUT_OF_MEMORY, _ACCOUNT_SVC_ERROR_PREFIX".OutOfMemory"},
+       {ACCOUNT_ERROR_INVALID_PARAMETER, _ACCOUNT_SVC_ERROR_PREFIX".InvalidParameter"},
+       {ACCOUNT_ERROR_DUPLICATED, _ACCOUNT_SVC_ERROR_PREFIX".Duplicated"},
+       {ACCOUNT_ERROR_NO_DATA, _ACCOUNT_SVC_ERROR_PREFIX".NoData"},
+       {ACCOUNT_ERROR_RECORD_NOT_FOUND, _ACCOUNT_SVC_ERROR_PREFIX".RecordNotFound"},
+       {ACCOUNT_ERROR_DB_FAILED, _ACCOUNT_SVC_ERROR_PREFIX".DBFailed"},
+       {ACCOUNT_ERROR_DB_NOT_OPENED, _ACCOUNT_SVC_ERROR_PREFIX".DBNotOpened"},
+       {ACCOUNT_ERROR_QUERY_SYNTAX_ERROR, _ACCOUNT_SVC_ERROR_PREFIX".QuerySynTaxError"},
+       {ACCOUNT_ERROR_ITERATOR_END, _ACCOUNT_SVC_ERROR_PREFIX".IteratorEnd"},
+       {ACCOUNT_ERROR_NOTI_FAILED, _ACCOUNT_SVC_ERROR_PREFIX".NotiFalied"},
+       {ACCOUNT_ERROR_PERMISSION_DENIED, _ACCOUNT_SVC_ERROR_PREFIX".PermissionDenied"},
+       {ACCOUNT_ERROR_XML_PARSE_FAILED, _ACCOUNT_SVC_ERROR_PREFIX".XMLParseFailed"},
+       {ACCOUNT_ERROR_XML_FILE_NOT_FOUND, _ACCOUNT_SVC_ERROR_PREFIX".FileNotFound"},
+       {ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL, _ACCOUNT_SVC_ERROR_PREFIX".SubscriptionFailed"},
+       {ACCOUNT_ERROR_NOT_REGISTERED_PROVIDER, _ACCOUNT_SVC_ERROR_PREFIX".NotRegisteredProvider"},
+       {ACCOUNT_ERROR_NOT_ALLOW_MULTIPLE, _ACCOUNT_SVC_ERROR_PREFIX".NotAllowMultiple"},
+       {ACCOUNT_ERROR_DATABASE_BUSY, _ACCOUNT_SVC_ERROR_PREFIX".database_busy"},
+};
+
+static int _account_get_error_code(bool is_success, GError *error)
+{
+       if (!is_success)
+       {
+               _INFO("Received error Domain[%d] Message[%s] Code[%d]", error->domain, error->message, error->code);
+
+               if (g_dbus_error_is_remote_error(error))
+               {
+                       gchar *remote_error = g_dbus_error_get_remote_error(error);
+                       if (remote_error)
+                       {
+                               _INFO("Remote error[%s]", remote_error);
+
+                               //FIXME: Temp fix, error->code sent from daemon is not the same as the one received.
+                               //However error->message matches, so doing reverse lookup
+                               int error_enum_count = G_N_ELEMENTS(_account_svc_errors);
+                               int i = 0;
+                               for (i = 0; i < error_enum_count; i++)
+                               {
+                                       if (g_strcmp0(_account_svc_errors[i].dbus_error_name, remote_error) == 0)
+                                       {
+                                               _INFO("Remote error code matched[%d]", _account_svc_errors[i].error_code);
+                                               return _account_svc_errors[i].error_code;
+                                       }
+                               }
+                       }
+               }
+               //All undocumented errors mapped to ACCOUNT_ERROR_PERMISSION_DENIED
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_connect(void)
+{
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_connect_readonly(void)
+{
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_disconnect(void)
+{
+       return ACCOUNT_ERROR_NONE;
+}
+
+
+ACCOUNT_API int account_insert_to_db(account_h account, int *account_db_id)
+{
+       _INFO("1. account_insert_to_db start");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
+       ACCOUNT_RETURN_VAL((account_db_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT ID POINTER IS NULL"));
+
+       account_s *account_data = (account_s*) account;
+       int error_code = ACCOUNT_ERROR_NONE;
+       GError *error = NULL;
+
+       _INFO("2. Before _account_manager_get_instance()");
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       ACCOUNT_CATCH_ERROR((acc_mgr != NULL), {}, ACCOUNT_ERROR_PERMISSION_DENIED, "Failed to get dbus.");
+
+       int db_id = -1;
+       GVariant* account_serialized = marshal_account(account_data);
+
+       _INFO("3. Before account_manager_call_account_add_sync");
+       bool is_success = account_manager_call_account_add_sync(acc_mgr, account_db_path, account_serialized, &db_id, NULL, &error);
+       ACCOUNT_CATCH_ERROR((is_success != false), {}, _account_get_error_code(is_success, error), "Failed to get dbus.");
+
+       *account_db_id = db_id;
+       account_data->id = db_id;
+
+       _INFO("4. account_insert_to_db end, added db id [%d] [%d] [%d]", db_id, *account_db_id, account_data->id);
+
+       return ACCOUNT_ERROR_NONE;
+
+CATCH:
+       //Failed to get dbus.
+       _ERR("account_manager_call_account_add_sync()=[%d]", error_code);
+
+       return error_code;
+}
+
+ACCOUNT_API int account_delete_from_db_by_id(int account_db_id)
+{
+       _INFO("1. account_delete_from_db_by_id starting [%d]", account_db_id);
+       char* account_db_path = ACCOUNT_DB_PATH;
+       int error_code = ACCOUNT_ERROR_NONE;
+
+       ACCOUNT_RETURN_VAL((account_db_id > 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT ID IS LESS THAN ZERO."));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       _INFO("2. Before account_manager_call_account_query_account_by_account_id_sync");
+       GVariant *account_serialized_old = NULL;
+       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_db_path, account_db_id, &account_serialized_old, NULL, &error);
+
+       if (!is_success)
+       {
+               error_code = _account_get_error_code(is_success, error);
+               _ERR("account_manager_call_account_query_account_by_account_id_sync failed [%d]", error_code);
+               return error_code;
+       }
+
+       _INFO("3. Before account_manager_call_account_delete_from_db_by_id_sync");
+       is_success = account_manager_call_account_delete_from_db_by_id_sync(acc_mgr, account_db_path, account_db_id, NULL, &error);
+
+       if (!is_success)
+       {
+               error_code = _account_get_error_code(is_success, error);
+               _ERR("account_manager_call_account_delete_from_db_by_id_sync failed [%d]", error_code);
+               return error_code;
+       }
+
+       _INFO("4. Before account_delete_from_db_by_id end");
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_delete_from_db_by_user_name(char *user_name, char *package_name)
+{
+       int error_code = ACCOUNT_ERROR_NONE;
+       char* account_db_path = ACCOUNT_DB_PATH;
+       _INFO("account_delete_from_db_by_user_name start");
+
+       ACCOUNT_RETURN_VAL((user_name != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("user_name is null!"));
+       ACCOUNT_RETURN_VAL((package_name != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("package_name is null!"));
+
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       GVariant* account_list_variant = NULL;
+       bool is_success = account_manager_call_account_query_account_by_user_name_sync(acc_mgr, account_db_path, user_name, &account_list_variant, NULL, &error);
+
+       error_code = _account_get_error_code(is_success, error);
+       if (error_code != ACCOUNT_ERROR_NONE)
+       {
+               _ERR("account_query_account_by_user_name error=[%d]", error_code);
+               return error_code;
+       }
+
+       _INFO("before unmarshal_account_list");
+       GSList* account_list = unmarshal_account_list(account_list_variant);
+       _INFO("after unmarshal_account_list");
+       if (account_list == NULL)
+       {
+               return ACCOUNT_ERROR_NO_DATA;
+       }
+
+       //TODO free account_list, account_list_variant
+
+       is_success = account_manager_call_account_delete_from_db_by_user_name_sync(acc_mgr, account_db_path, user_name, package_name, NULL, &error);
+
+       if (!is_success)
+       {
+               error_code = _account_get_error_code(is_success, error);
+               _ERR("account_manager_call_account_delete_from_db_by_user_name_sync failed [%d]", error_code);
+               return error_code;
+       }
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+int _account_delete_from_db_by_package_name(const char *package_name, bool permission)
+{
+       _INFO("_account_delete_from_db_by_package_name starting permission opions = %d", permission);
+       char* account_db_path = ACCOUNT_DB_PATH;
+       int error_code = ACCOUNT_ERROR_NONE;
+
+       ACCOUNT_RETURN_VAL((package_name != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("package_name is null!"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       //First get account list of user_name, used for gSSO DB deletion
+       GVariant* account_list_variant = NULL;
+       bool is_success = account_manager_call_account_query_account_by_package_name_sync(acc_mgr, account_db_path, package_name, &account_list_variant, NULL, &error);
+
+       error_code = _account_get_error_code(is_success, error);
+       if (error_code != ACCOUNT_ERROR_NONE)
+       {
+               return error_code;
+       }
+
+       _INFO("before unmarshal_account_list");
+       GSList* account_list = unmarshal_account_list(account_list_variant);
+       _INFO("after unmarshal_account_list");
+       if (account_list == NULL)
+       {
+               return ACCOUNT_ERROR_NO_DATA;
+       }
+
+       is_success = account_manager_call_account_delete_from_db_by_package_name_sync(acc_mgr, account_db_path, package_name, permission, NULL, &error);
+
+       if (!is_success)
+       {
+               error_code = _account_get_error_code(is_success, error);
+               _ERR("account_manager_call_account_delete_from_db_by_package_name_sync failed [%d]", error_code);
+               return error_code;
+       }
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_delete_from_db_by_package_name(const char *package_name)
+{
+       _INFO("account_delete_from_db_by_package_name starting with permission");
+       return _account_delete_from_db_by_package_name(package_name, true);
+}
+
+ACCOUNT_INTERNAL_API int account_delete_from_db_by_package_name_without_permission(const char *package_name)
+{
+       _INFO("account_delete_from_db_by_package_name starting without permission");
+       return _account_delete_from_db_by_package_name(package_name, false);
+}
+
+ACCOUNT_API int account_update_to_db_by_id(account_h account, int account_id)
+{
+       //First we will update account db
+       _INFO("1. account_update_to_db_by_id start");
+       char* account_db_path = ACCOUNT_DB_PATH;
+       int error_code = ACCOUNT_ERROR_NONE;
+
+       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("DATA IS NULL"));
+       ACCOUNT_RETURN_VAL((account_id > 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("Account id is not valid"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       _INFO("2. Before account_manager_call_account_query_account_by_account_id_sync");
+       GVariant *account_serialized_old = NULL;
+       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_db_path, account_id, &account_serialized_old, NULL, &error);
+
+       if (!is_success)
+       {
+               error_code = _account_get_error_code(is_success, error);
+               _ERR("account_manager_call_account_query_account_by_account_id_sync failed [%d]", error_code);
+               return error_code;
+       }
+
+       _INFO("3. Before account_manager_call_account_update_to_db_by_id_sync");
+       GVariant* account_serialized = marshal_account((account_s*) account);
+       is_success = account_manager_call_account_update_to_db_by_id_sync(acc_mgr, account_db_path, account_serialized, account_id, NULL, &error);
+
+       if (!is_success)
+       {
+               error_code = _account_get_error_code(is_success, error);
+               _ERR("account_manager_call_account_update_to_db_by_id_sync failed [%d]", error_code);
+               return error_code;
+       }
+
+       _INFO("4. account_update_to_db_by_id end");
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_update_to_db_by_id_ex(account_h account, int account_id)
+{
+       int ret = -1;
+       ret = account_update_to_db_by_id(account, account_id);
+
+       return ret;
+}
+
+ACCOUNT_INTERNAL_API int account_update_to_db_by_id_without_permission(account_h account, int account_id)
+{
+       //First we will update account db
+       //Then we will update gSSO DB, if it fails then we will rollback account db updates
+
+       _INFO("account_update_to_db_by_id_without_permission start");
+       char* account_db_path = ACCOUNT_DB_PATH;
+       int error_code = ACCOUNT_ERROR_NONE;
+
+       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("DATA IS NULL"));
+       ACCOUNT_RETURN_VAL((account_id > 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("Account id is not valid"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       GVariant *account_serialized_old = NULL;
+       _INFO("before query() account_id[%d]", account_id);
+       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_db_path, account_id, &account_serialized_old, NULL, &error);
+
+       if (!is_success)
+       {
+               error_code = _account_get_error_code(is_success, error);
+               _ERR("account_manager_call_account_query_account_by_account_id_sync failed [%d]", error_code);
+               return error_code;
+       }
+
+       _INFO("before marshal() : account_id[%d], user_name=%s", account_id, ((account_s*)account)->user_name);
+       GVariant* account_serialized = marshal_account((account_s*) account);
+       _INFO("after marshal() : account_id[%d]", account_id);
+       if (account_serialized == NULL)
+       {
+               _ERR("Invalid input");
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       _INFO("before call update() : account_id[%d]", account_id);
+       is_success = account_manager_call_account_update_to_db_by_id_ex_sync(acc_mgr, account_db_path, account_serialized, account_id, NULL, &error);
+
+       _INFO("after call update() : is_success=%d", is_success);
+       if (!is_success)
+       {
+               error_code = _account_get_error_code(is_success, error);
+               _ERR("account_manager_call_account_update_to_db_by_id_ex_sync failed [%d]", error_code);
+               return error_code;
+       }
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_update_to_db_by_user_name(account_h account, const char *user_name, const char *package_name)
+{
+       //First we will update account db
+       _INFO("account_update_to_db_by_user_name starting");
+       char* account_db_path = ACCOUNT_DB_PATH;
+       int error_code = ACCOUNT_ERROR_NONE;
+
+       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("DATA IS NULL"));
+       ACCOUNT_RETURN_VAL((user_name != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("USER NAME IS NULL"));
+       ACCOUNT_RETURN_VAL((package_name != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("PACKAGE NAME IS NULL"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       GVariant *account_serialized_old = NULL;
+       account_s *account_data = (account_s*) account;
+       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_db_path, account_data->id, &account_serialized_old, NULL, &error);
+
+       if (!is_success)
+       {
+               error_code = _account_get_error_code(is_success, error);
+               _ERR("account_manager_call_account_query_account_by_account_id_sync failed [%d]", error_code);
+               return error_code;
+       }
+
+       GVariant* account_serialized = marshal_account(account_data);
+       is_success = account_manager_call_account_update_to_db_by_user_name_sync(acc_mgr, account_db_path, account_serialized, user_name, package_name, NULL, &error);
+
+       if (!is_success)
+       {
+               error_code = _account_get_error_code(is_success, error);
+               _ERR("account_manager_call_account_update_to_db_by_user_name_sync failed [%d]", error_code);
+               return error_code;
+       }
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_create(account_h *account)
+{
+       _INFO("account_create start");
+       if (!account) {
+               ACCOUNT_SLOGE("(%s)-(%d) account is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)malloc(sizeof(account_s));
+
+       if (data == NULL) {
+               ACCOUNT_FATAL("Memory Allocation Failed");
+               return ACCOUNT_ERROR_OUT_OF_MEMORY;
+       }
+       ACCOUNT_MEMSET(data, 0, sizeof(account_s));
+
+       /*Setting account as visible by default*/
+       data->secret = ACCOUNT_SECRECY_VISIBLE;
+
+       /*Setting account as not supporting sync by default*/
+       data->sync_support = ACCOUNT_SYNC_NOT_SUPPORT;
+
+       data->auth_type = ACCOUNT_AUTH_TYPE_INVALID;
+
+//     data->account_list = NULL;
+       data->capablity_list = NULL;
+       data->custom_list = NULL;
+//     data->domain_list = NULL;
+//     data->mechanism_list = NULL;
+
+       *account = (account_h)data;
+
+       _INFO("account_create end");
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_destroy(account_h account)
+{
+       _INFO("account_destroy start");
+       account_s *data = (account_s*)account;
+
+       ACCOUNT_RETURN_VAL((data != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("Account handle is null!"));
+
+       _account_free_account_items(data);
+       _ACCOUNT_FREE(data);
+
+       _INFO("account_destroy end");
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_set_user_name(account_h account, const char *user_name)
+{
+       if (!account) {
+               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!user_name) {
+               ACCOUNT_SLOGE("(%s)-(%d) user_name is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       _ACCOUNT_FREE(data->user_name);
+       data->user_name = _account_get_text(user_name);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_set_display_name(account_h account, const char *display_name)
+{
+       if (!account) {
+               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!display_name) {
+               ACCOUNT_SLOGE("(%s)-(%d) display_name is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       _ACCOUNT_FREE(data->display_name);
+       data->display_name = _account_get_text(display_name);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_set_email_address(account_h account, const char *email_address)
+{
+       if (!account) {
+               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!email_address) {
+               ACCOUNT_SLOGE("(%s)-(%d) email_address is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       _ACCOUNT_FREE(data->email_address);
+       data->email_address = _account_get_text(email_address);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_set_icon_path(account_h account, const char *icon_path)
+{
+       if (!account) {
+               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!icon_path) {
+               ACCOUNT_SLOGE("(%s)-(%d) icon_path is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       _ACCOUNT_FREE(data->icon_path);
+       data->icon_path = _account_get_text(icon_path);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_set_source(account_h account, const char *source)
+{
+       if (!account) {
+               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!source) {
+               ACCOUNT_SLOGE("(%s)-(%d) source is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+       account_s *data = (account_s*)account;
+
+       _ACCOUNT_FREE(data->source);
+       data->source = _account_get_text(source);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_set_package_name(account_h account, const char *package_name)
+{
+       if (!account) {
+               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!package_name) {
+               ACCOUNT_SLOGE("(%s)-(%d) package_name is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       _ACCOUNT_FREE(data->package_name);
+       data->package_name = _account_get_text(package_name);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_set_domain_name(account_h account, const char *domain_name)
+{
+       if (!account) {
+               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!domain_name) {
+               ACCOUNT_SLOGE("(%s)-(%d) domain_name is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+       account_s *data = (account_s*)account;
+
+       _ACCOUNT_FREE(data->domain_name);
+       data->domain_name = _account_get_text(domain_name);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_set_access_token(account_h account, const char *access_token)
+{
+       if (!account) {
+               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!access_token) {
+               ACCOUNT_SLOGE("(%s)-(%d) access_token is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       _ACCOUNT_FREE(data->access_token);
+       data->access_token = _account_get_text(access_token);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_set_user_text(account_h account, int idx, const char *user_txt)
+{
+       if (!account) {
+               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!user_txt) {
+               ACCOUNT_SLOGE("(%s)-(%d) user_txt is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+       if (idx >= USER_TXT_CNT || idx < 0) {
+               ACCOUNT_SLOGE("(%s)-(%d) idx rage should be between 0-4.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       _ACCOUNT_FREE(data->user_data_txt[idx]);
+       data->user_data_txt[idx] = _account_get_text(user_txt);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_set_custom(account_h account, const char* key, const char* value)
+{
+       if (!account) {
+               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!key) {
+               ACCOUNT_SLOGE("(%s)-(%d) key is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!value) {
+               ACCOUNT_SLOGE("(%s)-(%d) value is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       GSList *iter;
+       bool b_is_new = TRUE;
+
+       for (iter = data->custom_list; iter != NULL; iter = g_slist_next(iter)) {
+
+               account_custom_s* custom_data = NULL;
+               custom_data = (account_custom_s*)iter->data;
+               ACCOUNT_SLOGD( "account_custom_s->key = %s, account_custom_s->value = %s \n", custom_data->key, custom_data->value);
+
+               if(!strcmp(custom_data->key, key)) {
+                       _ACCOUNT_FREE(custom_data->value);
+                       custom_data->value = _account_get_text(value);
+                       b_is_new = FALSE;
+               }
+       }
+
+       if(b_is_new) {
+               account_custom_s* custom_data = (account_custom_s*)malloc(sizeof(account_custom_s));
+
+               if (custom_data == NULL) {
+                       return ACCOUNT_ERROR_OUT_OF_MEMORY;
+               }
+               ACCOUNT_MEMSET(custom_data, 0, sizeof(account_custom_s));
+               custom_data->account_id = data->id;
+               custom_data->app_id = _account_get_text(data->package_name);
+               custom_data->key = _account_get_text(key);
+               custom_data->value = _account_get_text(value);
+               data->custom_list = g_slist_append(data->custom_list, (gpointer)custom_data);
+       }
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_set_auth_type(account_h account, const account_auth_type_e auth_type)
+{
+       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account handle is NULL.\n",  __FUNCTION__, __LINE__));
+
+       if ( ((int)auth_type < 0) || (auth_type > ACCOUNT_AUTH_TYPE_CLIENT_LOGIN)) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       data->auth_type = (int)auth_type;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_set_secret(account_h account, const account_secrecy_state_e secret)
+{
+       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account handle is NULL.\n",      __FUNCTION__, __LINE__));
+
+       if ( ((int)secret < 0) || (secret > ACCOUNT_SECRECY_VISIBLE)) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       data->secret = (int)secret;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_set_sync_support(account_h account, const account_sync_state_e sync_support)
+{
+       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account handle is NULL.\n",      __FUNCTION__, __LINE__));
+
+       if ( ((int)sync_support < 0) || (sync_support > ACCOUNT_SUPPORTS_SYNC)) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       data->sync_support= (int)sync_support;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_set_user_int(account_h account, int idx, const int user_int)
+{
+       if (!account) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (idx >= USER_INT_CNT ||idx < 0) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       data->user_data_int[idx] = user_int;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_set_capability(account_h account, const char* capability_type, account_capability_state_e capability_value)
+{
+       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("account handle is null"));
+       ACCOUNT_RETURN_VAL((capability_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_type is null"));
+
+       if ((capability_value != ACCOUNT_CAPABILITY_DISABLED) && (capability_value != ACCOUNT_CAPABILITY_ENABLED)) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       GSList *iter = NULL;
+       bool b_is_new = TRUE;
+
+       for(iter = data->capablity_list; iter != NULL; iter = g_slist_next(iter)) {
+               account_capability_s *cap_data = NULL;
+               cap_data = (account_capability_s*)iter->data;
+
+               if(!strcmp(cap_data->type, capability_type)) {
+                       cap_data->value = capability_value;
+                       b_is_new = FALSE;
+                       break;
+               }
+       }
+
+       if(b_is_new) {
+               account_capability_s* cap_data = (account_capability_s*)malloc(sizeof(account_capability_s));
+
+               if (cap_data == NULL)
+                       return ACCOUNT_ERROR_OUT_OF_MEMORY;
+               ACCOUNT_MEMSET(cap_data, 0, sizeof(account_capability_s));
+
+               cap_data->type = _account_get_text(capability_type);
+               cap_data->value = capability_value;
+               data->capablity_list = g_slist_append(data->capablity_list, (gpointer)cap_data);
+       }
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_get_user_name(account_h account, char **user_name)
+{
+       if (!account) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!user_name) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       (*user_name) = NULL;
+       *user_name = _account_get_text(data->user_name);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_get_display_name(account_h account, char **display_name)
+{
+       if (!account) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!display_name) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       (*display_name) = NULL;
+
+       *display_name = _account_get_text(data->display_name);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_get_email_address(account_h account,char **email_address)
+{
+       if (!account) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!email_address) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       (*email_address) = NULL;
+
+       *email_address = _account_get_text(data->email_address);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int  account_get_icon_path(account_h account, char **icon_path)
+{
+       if (!account) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!icon_path) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       (*icon_path) = NULL;
+
+       *icon_path = _account_get_text(data->icon_path);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_get_source(account_h account, char **source)
+{
+       if (!account) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!source) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       (*source) = NULL;
+
+       *source = _account_get_text(data->source);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_get_package_name(account_h account, char **package_name)
+{
+       if (!account) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!package_name) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       (*package_name) = NULL;
+
+       *package_name = _account_get_text(data->package_name);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_get_domain_name(account_h account, char **domain_name)
+{
+       if (!account) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!domain_name) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       (*domain_name) = NULL;
+
+       *domain_name = _account_get_text(data->domain_name);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_get_access_token(account_h account, char **access_token)
+{
+       if (!account) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!access_token) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       (*access_token) = NULL;
+
+       *access_token = _account_get_text(data->access_token);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_get_user_text(account_h account, int user_text_index, char **text)
+{
+       if (!account) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!text) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+       ACCOUNT_RETURN_VAL((user_text_index >=0 && user_text_index < USER_TXT_CNT ), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("INVALID USER TEXT INDEX"));
+
+       account_s *data = (account_s*)account;
+
+       (*text) = NULL;
+
+       *text = _account_get_text(data->user_data_txt[user_text_index]);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_get_auth_type(account_h account, account_auth_type_e *auth_type)
+{
+       if (!account) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+       if (!auth_type) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s* data = (account_s*)account;
+
+       *auth_type = data->auth_type;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_get_secret(account_h account, account_secrecy_state_e *secret)
+{
+       if (!account) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+       if (!secret) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s* data = (account_s*)account;
+
+       *secret = data->secret;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_get_sync_support(account_h account, account_sync_state_e *sync_support)
+{
+       if (!account) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+       if (!sync_support) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s* data = (account_s*)account;
+
+       *sync_support = data->sync_support;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_get_account_id(account_h account, int *account_id)
+{
+       if (!account) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+       if (!account_id) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       *account_id = data->id;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_get_user_int(account_h account, int user_int_index, int *integer)
+{
+       if (!account) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       ACCOUNT_RETURN_VAL((user_int_index >=0 && user_int_index < USER_TXT_CNT ), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("INVALID USER TEXT INDEX"));
+
+       if (!integer) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_s *data = (account_s*)account;
+
+       *integer = data->user_data_int[user_int_index];
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_get_capability(account_h account, const char* capability_type, account_capability_state_e* capability_value)
+{
+       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
+       ACCOUNT_RETURN_VAL((capability_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_type is NULL"));
+       ACCOUNT_RETURN_VAL((capability_value != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_value is NULL"));
+
+       GSList *iter;
+       account_s *data = (account_s*)account;
+
+       _ERR("before for()");
+       for (iter = data->capablity_list; iter != NULL; iter = g_slist_next(iter)) {
+               account_capability_s *cap_data = NULL;
+
+               cap_data = (account_capability_s*)iter->data;
+
+       _ERR("capability_type = %s, data->type = %s", capability_type, cap_data->type);
+       _ERR("capability_value = %d, data->value= %d", capability_value, cap_data->value);
+               if(!strcmp(capability_type, cap_data->type)) {
+                       *capability_value = cap_data->value;
+                       return ACCOUNT_ERROR_NONE;
+               }
+       }
+       _ERR("after for()");
+
+       return ACCOUNT_ERROR_RECORD_NOT_FOUND;
+}
+
+ACCOUNT_API int account_get_capability_all(account_h account, capability_cb callback, void *user_data)
+{
+       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
+       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO CALLBACK FUNCTION"));
+
+       GSList *iter;
+       account_s *data = (account_s*)account;
+
+       for (iter = data->capablity_list; iter != NULL; iter = g_slist_next(iter)) {
+               account_capability_s *cap_data = NULL;
+
+               cap_data = (account_capability_s*)iter->data;
+
+               if(callback(cap_data->type, cap_data->value, user_data)!=TRUE){
+                       return ACCOUNT_ERROR_NONE;
+               }
+       }
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_get_custom(account_h account, const char* key, char** value)
+{
+       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
+       ACCOUNT_RETURN_VAL((key != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO KEY TO REQUEST"));
+       ACCOUNT_RETURN_VAL((value != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("VALUE POINTER IS NULL"));
+
+       GSList *iter;
+       account_s *data = (account_s*)account;
+
+       _ERR("before for()");
+       for (iter = data->custom_list; iter != NULL; iter = g_slist_next(iter)) {
+               account_custom_s *custom_data = NULL;
+
+               custom_data = (account_custom_s*)iter->data;
+
+               _ERR("key = %s, custom_data->key = %s", key, custom_data->key);
+               _ERR("value = %s, custom_data->value = %s", value, custom_data->value);
+
+               if(!strcmp(key, custom_data->key)) {
+                       (*value) = NULL;
+                       *value = _account_get_text(custom_data->value);
+                       return ACCOUNT_ERROR_NONE;
+               }
+       }
+       _ERR("after for()");
+
+       return ACCOUNT_ERROR_RECORD_NOT_FOUND;
+}
+
+ACCOUNT_API int account_get_custom_all(account_h account, account_custom_cb callback, void* user_data)
+{
+       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
+       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO CALLBACK FUNCTION"));
+
+       GSList *iter;
+       account_s *data = (account_s*)account;
+
+       for (iter = data->custom_list; iter != NULL; iter = g_slist_next(iter)) {
+               bool cb_ret = FALSE;
+               account_custom_s *custom_data = NULL;
+
+               custom_data = (account_custom_s*)iter->data;
+
+               cb_ret = callback(custom_data->key, custom_data->value, user_data);
+               if(!cb_ret) {
+                       break;
+               }
+       }
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_foreach_account_from_db(account_cb callback, void *user_data)
+{
+       _INFO("account_foreach_account_from_db start");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT Callback IS NULL"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       GVariant* account_list_variant = NULL;
+       bool is_success = account_manager_call_account_query_all_sync(acc_mgr, account_db_path, &account_list_variant, NULL, &error);
+
+       int error_code = _account_get_error_code(is_success, error);
+       if (error_code != ACCOUNT_ERROR_NONE)
+       {
+               return error_code;
+       }
+
+       _INFO("before unmarshal_account_list");
+       GSList* account_list = unmarshal_account_list(account_list_variant);
+       _INFO("after unmarshal_account_list");
+       GSList* iter;
+
+       for (iter = account_list; iter != NULL; iter = g_slist_next(iter))
+       {
+               _INFO("iterating received account_list");
+               account_s *account = NULL;
+               account = (account_s*)iter->data;
+               _INFO("Before _account_query_identity_info_by_id");
+
+               _INFO("account->id=%d", account->id);
+               if (callback((account_h)account, user_data) == false)
+               {
+                       _INFO("application callback requested to discontinue.");
+                       break;
+               }
+               _INFO("After one iteration callback");
+       }
+       _INFO("account_foreach_account_from_db end");
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_query_account_by_account_id(int account_db_id, account_h *account)
+{
+       _INFO("account_query_account_by_account_id start [%d]", account_db_id);
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((account_db_id > 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT INDEX IS LESS THAN 0"));
+       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT POINTER IS NULL"));
+       ACCOUNT_RETURN_VAL((*account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT IS NULL"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       GVariant* account_variant = NULL;
+       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_db_path, account_db_id, &account_variant, NULL, &error);
+
+       int error_code = _account_get_error_code(is_success, error);
+       if (error_code != ACCOUNT_ERROR_NONE)
+       {
+               return error_code;
+       }
+
+       _INFO("before unmarshal_account");
+       account_s* account_data = umarshal_account(account_variant);
+       _INFO("after unmarshal_account");
+
+       if (account_data == NULL)
+       {
+               _ERR("Failed to unmarshal");
+               return ACCOUNT_ERROR_DB_FAILED;
+       }
+
+       *account = (account_h) account_data;
+
+       _INFO("account_query_account_by_account_id end");
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_query_account_by_user_name(account_cb callback, const char* user_name, void* user_data)
+{
+       _INFO("account_query_account_by_user_name starting");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((user_name != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("USER NAME IS NULL"));
+       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("CALL BACK IS NULL"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       GVariant* account_list_variant = NULL;
+       bool is_success = account_manager_call_account_query_account_by_user_name_sync(acc_mgr, account_db_path, user_name, &account_list_variant, NULL, &error);
+
+       int error_code = _account_get_error_code(is_success, error);
+       if (error_code != ACCOUNT_ERROR_NONE)
+       {
+               return error_code;
+       }
+
+       _INFO("before unmarshal_account_list");
+       GSList* account_list = unmarshal_account_list(account_list_variant);
+       _INFO("after unmarshal_account_list");
+       if (account_list == NULL)
+       {
+               return ACCOUNT_ERROR_NO_DATA;
+       }
+
+       GSList* iter;
+
+       for (iter = account_list; iter != NULL; iter = g_slist_next(iter))
+       {
+               _INFO("iterating received account_list");
+               account_s *account = NULL;
+               account = (account_s*)iter->data;
+               if (callback((account_h)account, user_data) == false)
+               {
+                       _INFO("application callback requested to discontinue.");
+                       break;
+               }
+       }
+       _INFO("account_query_account_by_user_name end");
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_query_account_by_package_name(account_cb callback, const char *package_name, void *user_data)
+{
+       _INFO("account_query_account_by_package_name starting");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((package_name != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("PACKAGE NAME IS NULL"));
+       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("CALL BACK IS NULL"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       GVariant* account_list_variant = NULL;
+       bool is_success = account_manager_call_account_query_account_by_package_name_sync(acc_mgr, account_db_path, package_name, &account_list_variant, NULL, &error);
+
+       int error_code = _account_get_error_code(is_success, error);
+       if (error_code != ACCOUNT_ERROR_NONE)
+       {
+               return error_code;
+       }
+
+       _INFO("before unmarshal_account_list");
+       GSList* account_list = unmarshal_account_list(account_list_variant);
+       _INFO("after unmarshal_account_list");
+       if (account_list == NULL)
+       {
+               return ACCOUNT_ERROR_NO_DATA;
+       }
+
+       GSList* iter;
+
+       for (iter = account_list; iter != NULL; iter = g_slist_next(iter))
+       {
+               _INFO("iterating received account_list");
+               account_s *account = NULL;
+               account = (account_s*)iter->data;
+
+               if (callback((account_h)account, user_data) == false)
+               {
+                       _INFO("application callback requested to discontinue.");
+                       break;
+               }
+       }
+       _INFO("account_query_account_by_package_name end");
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_query_account_by_capability(account_cb callback, const char* capability_type, account_capability_state_e capability_value, void *user_data)
+{
+       _INFO("account_query_account_by_capability starting");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((capability_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_type IS NULL"));
+
+       if (((int)capability_value  < 0) || (capability_value > ACCOUNT_CAPABILITY_ENABLED)) {
+               ACCOUNT_SLOGE("(%s)-(%d) capability_value is not equal to 0 or 1.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("CALL BACK IS NULL"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       GVariant* account_list_variant = NULL;
+       bool is_success = account_manager_call_account_query_account_by_capability_sync(acc_mgr, account_db_path, capability_type, capability_value, &account_list_variant, NULL, &error);
+
+       int error_code = _account_get_error_code(is_success, error);
+       if (error_code != ACCOUNT_ERROR_NONE)
+       {
+               return error_code;
+       }
+
+       _INFO("before unmarshal_account_list");
+       GSList* account_list = unmarshal_account_list(account_list_variant);
+       _INFO("after unmarshal_account_list");
+       if (account_list == NULL)
+       {
+               return ACCOUNT_ERROR_NO_DATA;
+       }
+
+       GSList* iter;
+
+       for (iter = account_list; iter != NULL; iter = g_slist_next(iter))
+       {
+               _INFO("iterating received account_list");
+               account_s *account = NULL;
+               account = (account_s*)iter->data;
+
+               if (callback((account_h)account, user_data) == false)
+               {
+                       _INFO("application callback requested to discontinue.");
+                       break;
+               }
+       }
+       _INFO("account_query_account_by_capability end");
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_query_account_by_capability_type(account_cb callback, const char* capability_type, void* user_data)
+{
+       _INFO("account_query_account_by_capability_type starting");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((capability_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_type IS NULL"));
+       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("CALL BACK IS NULL"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       GVariant* account_list_variant = NULL;
+       bool is_success = account_manager_call_account_query_account_by_capability_type_sync(acc_mgr, account_db_path, capability_type, &account_list_variant, NULL, &error);
+
+       int error_code = _account_get_error_code(is_success, error);
+       if (error_code != ACCOUNT_ERROR_NONE)
+       {
+               return error_code;
+       }
+
+       _INFO("before unmarshal_account_list");
+       GSList* account_list = unmarshal_account_list(account_list_variant);
+       _INFO("after unmarshal_account_list");
+       if (account_list == NULL)
+       {
+               return ACCOUNT_ERROR_NO_DATA;
+       }
+
+       GSList* iter;
+
+       for (iter = account_list; iter != NULL; iter = g_slist_next(iter))
+       {
+               _INFO("iterating received account_list");
+               account_s *account = NULL;
+               account = (account_s*)iter->data;
+
+               if (callback((account_h)account, user_data) == false)
+               {
+                       _INFO("application callback requested to discontinue.");
+                       break;
+               }
+       }
+       _INFO("account_query_account_by_capability end");
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_query_capability_by_account_id(capability_cb callback, int account_id, void *user_data)
+{
+       _INFO("account_query_capability_by_account_id starting");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((account_id > 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT INDEX IS LESS THAN 0"));
+       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO CALLBACK FUNCTION"));
+
+       GError *error = NULL;
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       GVariant* capability_list_variant = NULL;
+       bool is_success = account_manager_call_account_query_capability_by_account_id_sync(acc_mgr, account_db_path, account_id, &capability_list_variant, NULL, &error);
+
+       int error_code = _account_get_error_code(is_success, error);
+       if (error_code != ACCOUNT_ERROR_NONE)
+       {
+               return error_code;
+       }
+
+       _INFO("before unmarshal_capability_list");
+       GSList* capability_list = unmarshal_capability_list(capability_list_variant);
+       _INFO("after unmarshal_capability_list");
+       if (capability_list == NULL)
+       {
+               return ACCOUNT_ERROR_NO_DATA;
+       }
+
+       GSList* iter;
+
+       for (iter = capability_list; iter != NULL; iter = g_slist_next(iter))
+       {
+               _INFO("iterating received account_list");
+               account_capability_s *capability = NULL;
+               capability = (account_capability_s*)iter->data;
+               _INFO("");
+               if (callback(capability->type, capability->value, user_data) == false)
+               {
+                       _INFO("application callback requested to discontinue.");
+                       break;
+               }
+               _INFO("");
+       }
+       _INFO("account_query_capability_by_account_id end");
+       return ACCOUNT_ERROR_NONE;
+}
+
+static int _account_get_total_count(int *count, bool include_hidden)
+{
+       _INFO("account_get_total_count_from_db starting");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       if (!count)
+       {
+               ACCOUNT_SLOGE("(%s)-(%d) count is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       GError *error = NULL;
+
+       if (count == NULL)
+       {
+               _INFO("Invalid input");
+               return -1;
+       }
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       int temp_count = -1;
+       bool is_success = account_manager_call_account_get_total_count_from_db_sync(acc_mgr, account_db_path, include_hidden, &temp_count, NULL, &error);
+       int error_code = _account_get_error_code(is_success, error);
+       if (error_code != ACCOUNT_ERROR_NONE)
+       {
+               return error_code;
+       }
+
+       *count = temp_count;
+       _INFO("account_get_total_count_from_db end");
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_get_total_count_from_db(int *count)
+{
+       _INFO("account_get_total_count_from_db starting");
+
+       return _account_get_total_count(count, true);
+}
+
+ACCOUNT_API int account_get_total_count_from_db_ex(int *count)
+{
+       _INFO("account_get_total_count_from_db_ex starting");
+
+       return _account_get_total_count(count, false);
+}
+
+ACCOUNT_API int account_update_sync_status_by_id(int account_db_id, const account_sync_state_e sync_status)
+{
+       _INFO("account_update_sync_status_by_id starting");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((account_db_id > 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT INDEX IS LESS THAN 0"));
+       if ( ((int)sync_status < 0) || (sync_status > ACCOUNT_SYNC_STATUS_RUNNING)) {
+               ACCOUNT_SLOGE("(%s)-(%d) sync_status is less than 0 or more than enum max.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       bool is_success = account_manager_call_account_update_sync_status_by_id_sync(acc_mgr, account_db_path, account_db_id, sync_status, NULL, &error);
+
+       return _account_get_error_code(is_success, error);
+}
+
+static int _account_type_free_label_items(label_s *data)
+{
+       _ACCOUNT_FREE(data->app_id);
+       _ACCOUNT_FREE(data->label);
+       _ACCOUNT_FREE(data->locale);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+static int _account_type_gslist_free(GSList* list)
+{
+       ACCOUNT_RETURN_VAL((list != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("GSlist is NULL"));
+
+       GSList* iter;
+
+       for (iter = list; iter != NULL; iter = g_slist_next(iter)) {
+               label_s *label_data = (label_s*)iter->data;
+               _account_type_free_label_items(label_data);
+               _ACCOUNT_FREE(label_data);
+       }
+
+       g_slist_free(list);
+       list = NULL;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+static int _account_type_item_free(account_type_s *data)
+{
+       _ACCOUNT_FREE(data->app_id);
+       _ACCOUNT_FREE(data->service_provider_id);
+       _ACCOUNT_FREE(data->icon_path);
+       _ACCOUNT_FREE(data->small_icon_path);
+
+       return ACCOUNT_ERROR_NONE;
+}
+/*
+static int _account_type_glist_free(GList* list)
+{
+       ACCOUNT_RETURN_VAL((list != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("Glist is NULL"));
+
+       GList* iter;
+
+       for (iter = list; iter != NULL; iter = g_list_next(iter)) {
+               account_type_s *account_type_record = (account_type_s*)iter->data;
+               _account_type_item_free(account_type_record);
+               _ACCOUNT_FREE(account_type_record);
+       }
+
+       g_list_free(list);
+       list = NULL;
+
+       return ACCOUNT_ERROR_NONE;
+}
+*/
+static int _account_type_free_account_type_items(account_type_s *data)
+{
+       _account_type_item_free(data);
+
+       _account_type_gslist_free(data->label_list);
+//     _account_type_gslist_free(data->provider_feature_list);
+//     _account_type_glist_free(data->account_type_list);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_type_create(account_type_h *account_type)
+{
+       if (!account_type) {
+               ACCOUNT_SLOGE("(%s)-(%d) account type handle is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_type_s *data = (account_type_s*)malloc(sizeof(account_type_s));
+
+       if (data == NULL)
+       {
+               ACCOUNT_ERROR("Memory Allocation Failed");
+               return ACCOUNT_ERROR_OUT_OF_MEMORY;
+       }
+
+       ACCOUNT_MEMSET(data, 0, sizeof(account_type_s));
+
+       data->id = -1;
+       data->app_id = NULL;
+       data->service_provider_id = NULL;
+       data->icon_path = NULL;
+       data->small_icon_path = NULL;
+       data->multiple_account_support = false;
+       data->label_list = NULL;
+//     data->account_type_list = NULL;
+       data->provider_feature_list = NULL;
+
+       *account_type = (account_type_h)data;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_type_destroy(account_type_h account_type)
+{
+       _INFO("account_type_destroy");
+
+       account_type_s *data = (account_type_s*)account_type;
+
+       if (data == NULL)
+       {
+               _ERR("Account type handle is null!");
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       _account_type_free_account_type_items(data);
+       _ACCOUNT_FREE(data);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_INTERNAL_API int account_type_set_app_id(account_type_h account_type, const char *app_id)
+{
+       if (!account_type) {
+               ACCOUNT_SLOGE("(%s)-(%d) account_type handle is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!app_id) {
+               ACCOUNT_SLOGE("(%s)-(%d) app_id is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_type_s *data = (account_type_s*)account_type;
+
+       _ACCOUNT_FREE(data->app_id);
+       data->app_id = _account_get_text(app_id);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_INTERNAL_API int account_type_set_service_provider_id(account_type_h account_type, const char *service_provider_id)
+{
+       if (!account_type) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!service_provider_id) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_type_s *data = (account_type_s*)account_type;
+
+       _ACCOUNT_FREE(data->service_provider_id);
+       data->service_provider_id = _account_get_text(service_provider_id);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_INTERNAL_API int account_type_set_icon_path(account_type_h account_type, const char *icon_path)
+{
+       if (!account_type) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!icon_path) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_type_s *data = (account_type_s*)account_type;
+
+       _ACCOUNT_FREE(data->icon_path);
+       data->icon_path = _account_get_text(icon_path);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_INTERNAL_API int account_type_set_small_icon_path(account_type_h account_type, const char *small_icon_path)
+{
+       if (!account_type) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!small_icon_path) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_type_s *data = (account_type_s*)account_type;
+
+       _ACCOUNT_FREE(data->small_icon_path);
+       data->small_icon_path = _account_get_text(small_icon_path);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_INTERNAL_API int account_type_set_multiple_account_support(account_type_h account_type, const bool multiple_account_support)
+{
+       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account handle is NULL.\n",  __FUNCTION__, __LINE__));
+
+       account_type_s *data = (account_type_s*)account_type;
+
+       data->multiple_account_support = multiple_account_support;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_INTERNAL_API int account_type_set_label(account_type_h account_type, const char* label, const char* locale)
+{
+       if (!account_type) {
+               ACCOUNT_SLOGE("(%s)-(%d) account_type handle is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if(!label || !locale) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_type_s *data = (account_type_s*)account_type;
+       label_s *label_data = (label_s*)malloc(sizeof(label_s));
+
+       if (label_data == NULL) {
+               return ACCOUNT_ERROR_OUT_OF_MEMORY;
+       }
+       ACCOUNT_MEMSET(label_data, 0, sizeof(label_s));
+
+       label_data->label = _account_get_text(label);
+       label_data->locale = _account_get_text(locale);
+
+       data->label_list = g_slist_append(data->label_list, (gpointer)label_data);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_INTERNAL_API int account_type_set_provider_feature(account_type_h account_type, const char* provider_feature)
+{
+       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("account type handle is null"));
+       ACCOUNT_RETURN_VAL((provider_feature != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("provider_feature is null"));
+
+       account_type_s *data = (account_type_s*)account_type;
+
+       GSList *iter = NULL;
+       bool b_is_new = TRUE;
+
+       for(iter = data->provider_feature_list; iter != NULL; iter = g_slist_next(iter)) {
+               provider_feature_s *feature_data = NULL;
+               feature_data = (provider_feature_s*)iter->data;
+
+               if(!strcmp(feature_data->key, provider_feature)) {
+                       b_is_new = FALSE;
+                       break;
+               }
+       }
+
+       if(b_is_new) {
+               provider_feature_s* feature_data = (provider_feature_s*)malloc(sizeof(provider_feature_s));
+
+               if (feature_data == NULL)
+                       return ACCOUNT_ERROR_OUT_OF_MEMORY;
+               ACCOUNT_MEMSET(feature_data, 0, sizeof(provider_feature_s));
+
+               feature_data->key = _account_get_text(provider_feature);
+               data->provider_feature_list = g_slist_append(data->provider_feature_list, (gpointer)feature_data);
+       }
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_type_query_provider_feature_by_app_id(provider_feature_cb callback, const char* app_id, void *user_data )
+{
+       _INFO("account_type_query_provider_feature_by_app_id start");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((app_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
+       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO CALLBACK FUNCTION"));
+
+       GError *error = NULL;
+       gint error_code = ACCOUNT_ERROR_NONE;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       GVariant* feature_list_variant = NULL;
+       bool is_success = account_manager_call_account_type_query_provider_feature_by_app_id_sync(acc_mgr, account_db_path, app_id, &feature_list_variant, NULL, &error);
+
+       _INFO("account_manager_call_account_type_query_provider_feature_by_app_id_sync end=[%d]", is_success);
+
+       if (!is_success)
+       {
+//             error_code = error->code;
+               error_code = _account_get_error_code(is_success, error);
+               _ERR("Account IPC call returned error[%d]", error_code);
+               return error_code;
+       }
+
+       GSList* provider_feature_list = variant_to_provider_feature_list(feature_list_variant);
+       if (provider_feature_list == NULL)
+       {
+               error_code = ACCOUNT_ERROR_NO_DATA;
+               _ERR("[%d]", error_code);
+               return error_code;
+       }
+
+       GSList *iter;
+       for (iter = provider_feature_list; iter != NULL; iter = g_slist_next(iter)) {
+               provider_feature_s *feature_data = NULL;
+
+               feature_data = (provider_feature_s*)iter->data;
+
+               if(callback(feature_data->app_id, feature_data->key, user_data)!=TRUE) {
+                       ACCOUNT_DEBUG("Callback func returs FALSE, its iteration is stopped!!!!\n");
+                       return ACCOUNT_ERROR_NONE;
+               }
+       }
+
+       _INFO("account_type_query_provider_feature_by_app_id end");
+       return error_code;
+}
+
+ACCOUNT_API bool account_type_query_supported_feature(const char* app_id, const char* capability)
+{
+       _INFO("account_type_query_supported_feature start");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       if (app_id == NULL || capability == NULL)
+       {
+               set_last_result(ACCOUNT_ERROR_INVALID_PARAMETER);
+               return false;
+       }
+
+       int is_supported = 0;
+       GError *error = NULL;
+       gint ret = ACCOUNT_ERROR_NONE;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               set_last_result(ACCOUNT_ERROR_PERMISSION_DENIED);
+               return false;
+       }
+
+       bool is_success = account_manager_call_account_type_query_supported_feature_sync(acc_mgr, account_db_path, app_id, capability, &is_supported, NULL, &error);
+
+       _INFO("account_manager_call_account_type_query_supported_feature_sync end=[%d]", is_success);
+
+       if (!is_success)
+       {
+               ret = _account_get_error_code(is_success, error);
+//             ret = error->code;
+               _ERR("Account IPC call returned error[%d]", ret);
+               set_last_result(ret);
+               return false;
+       }
+
+       set_last_result(ACCOUNT_ERROR_NONE);
+       _INFO("account_type_query_supported_feature end");
+       return is_supported;
+}
+
+ACCOUNT_API int account_type_get_app_id(account_type_h account_type, char **app_id)
+{
+       if (!account_type) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!app_id) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_type_s *data = (account_type_s*)account_type;
+
+       (*app_id) = NULL;
+       *app_id = _account_get_text(data->app_id);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_type_get_service_provider_id(account_type_h account_type, char **service_provider_id)
+{
+       if (!account_type) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!service_provider_id) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_type_s *data = (account_type_s*)account_type;
+
+       (*service_provider_id) = NULL;
+       *service_provider_id = _account_get_text(data->service_provider_id);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_type_get_icon_path(account_type_h account_type, char **icon_path)
+{
+       if (!account_type) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!icon_path) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_type_s *data = (account_type_s*)account_type;
+
+       (*icon_path) = NULL;
+       *icon_path = _account_get_text(data->icon_path);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_type_get_small_icon_path(account_type_h account_type, char **small_icon_path)
+{
+       if (!account_type) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!small_icon_path) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_type_s *data = (account_type_s*)account_type;
+
+       (*small_icon_path) = NULL;
+       *small_icon_path = _account_get_text(data->small_icon_path);
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_type_get_multiple_account_support(account_type_h account_type, int *multiple_account_support)
+{
+       if (!account_type) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+       if (!multiple_account_support) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_type_s *data = (account_type_s*)account_type;
+
+       *multiple_account_support = data->multiple_account_support;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_type_get_provider_feature_all(account_type_h account_type, provider_feature_cb callback, void* user_data)
+{
+       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
+       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO CALLBACK FUNCTION"));
+
+       GSList *iter;
+       account_type_s *data = (account_type_s*)account_type;
+
+       for (iter = data->provider_feature_list; iter != NULL; iter = g_slist_next(iter)) {
+               provider_feature_s *feature_data = NULL;
+
+               feature_data = (provider_feature_s*)iter->data;
+
+               if(callback(feature_data->app_id, feature_data->key, user_data)!=TRUE) {
+                       ACCOUNT_DEBUG("Callback func returs FALSE, its iteration is stopped!!!!\n");
+                       return ACCOUNT_ERROR_NONE;
+               }
+       }
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_type_get_label_by_locale(account_type_h account_type, const char* locale, char** label)
+{
+       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
+       ACCOUNT_RETURN_VAL((label != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("INVALID PARAMETER"));
+
+       GSList *iter;
+       account_type_s *data = (account_type_s*)account_type;
+
+       for (iter = data->label_list; iter != NULL; iter = g_slist_next(iter)) {
+               label_s *label_data = NULL;
+
+               label_data = (label_s*)iter->data;
+
+               *label = NULL;
+
+               if(!strcmp(locale, label_data->locale)) {
+                       *label = _account_get_text(label_data->label);
+                       return ACCOUNT_ERROR_NONE;
+               }
+               gchar** tokens = g_strsplit(locale, "-", 2);
+               if(tokens != NULL) {
+                       if((char*)(tokens[1]) != NULL) {
+                               char* upper_token = g_ascii_strup(tokens[1], strlen(tokens[1]));
+                               if(upper_token != NULL) {
+                                       char* converted_locale = g_strdup_printf("%s_%s", tokens[0], upper_token);
+                                       if(!strcmp(converted_locale, label_data->locale)) {
+                                               _ACCOUNT_FREE(converted_locale);
+                                               _ACCOUNT_FREE(upper_token);
+                                               g_strfreev(tokens);
+                                               *label = _account_get_text(label_data->label);
+                                               return ACCOUNT_ERROR_NONE;
+                                       }
+                                       _ACCOUNT_FREE(converted_locale);
+                               }
+                               _ACCOUNT_FREE(upper_token);
+                       }
+               }
+               g_strfreev(tokens);
+       }
+
+       return ACCOUNT_ERROR_RECORD_NOT_FOUND;
+}
+
+ACCOUNT_API int account_type_get_label(account_type_h account_type, account_label_cb callback, void *user_data)
+{
+       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
+       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO CALLBACK FUNCTION"));
+
+       GSList *iter;
+       account_type_s *data = (account_type_s*)account_type;
+
+       for (iter = data->label_list; iter != NULL; iter = g_slist_next(iter)) {
+               label_s *label_data = NULL;
+
+               label_data = (label_s*)iter->data;
+
+               if(callback(label_data->app_id, label_data->label, label_data->locale, user_data)!=TRUE) {
+                       ACCOUNT_DEBUG("Callback func returs FALSE, its iteration is stopped!!!!\n");
+                       return ACCOUNT_ERROR_NONE;
+               }
+       }
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_INTERNAL_API int account_type_insert_to_db(account_type_h account_type, int* account_type_id)
+{
+       _INFO("account_type_insert_to_db starting");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT TYPE HANDLE IS NULL"));
+       ACCOUNT_RETURN_VAL((account_type_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT TYPE ID POINTER IS NULL"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       int db_id = -1;
+       GVariant* account_type_serialized = marshal_account_type((account_type_s*) account_type);
+       bool is_success = account_manager_call_account_type_add_sync(acc_mgr, account_db_path, account_type_serialized, &db_id, NULL, &error);
+
+       int ret = _account_get_error_code(is_success, error);
+       if (ret != ACCOUNT_ERROR_NONE)
+       {
+               return ret;
+       }
+
+       _INFO("account_type_insert_to_db end id=[%d]", db_id);
+
+       *account_type_id = db_id;
+
+       account_type_s* account_type_data = (account_type_s*)account_type;
+       account_type_data->id = db_id;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_INTERNAL_API int account_type_update_to_db_by_app_id(const account_type_h account_type, const char* app_id)
+{
+       _INFO("account_type_update_to_db_by_app_id starting");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("DATA IS NULL"));
+       ACCOUNT_RETURN_VAL((app_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       GVariant* account_type_variant = marshal_account_type((account_type_s*) account_type);
+       if (account_type_variant == NULL)
+       {
+               _ERR("Failed to serialize");
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       bool is_success = account_manager_call_account_type_update_to_db_by_app_id_sync(acc_mgr, account_db_path, account_type_variant, app_id, NULL, &error);
+
+       return _account_get_error_code(is_success, error);
+}
+
+ACCOUNT_INTERNAL_API int account_type_delete_by_app_id(const char* app_id)
+{
+       _INFO("account_type_delete_by_app_id starting");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((app_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       bool is_success = account_manager_call_account_type_delete_by_app_id_sync(acc_mgr, account_db_path, app_id, NULL, &error);
+
+       return _account_get_error_code(is_success, error);
+}
+
+ACCOUNT_API int account_type_query_label_by_app_id(account_label_cb callback, const char* app_id, void *user_data )
+{
+       _INFO("account_type_query_label_by_app_id starting");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT Callback IS NULL"));
+       ACCOUNT_RETURN_VAL((app_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       GVariant* label_list_variant = NULL;
+       bool is_success = account_manager_call_account_type_query_label_by_app_id_sync(acc_mgr, account_db_path, app_id, &label_list_variant, NULL, &error);
+
+       int ret = _account_get_error_code(is_success, error);
+       if (ret != ACCOUNT_ERROR_NONE)
+       {
+               return ret;
+       }
+
+       _INFO("before variant_to_label_list");
+       GSList* label_list = variant_to_label_list (label_list_variant);
+       _INFO("after variant_to_label_list");
+       if (label_list == NULL)
+       {
+               return ACCOUNT_ERROR_NO_DATA;
+       }
+
+       GSList* iter;
+
+       for (iter = label_list; iter != NULL; iter = g_slist_next(iter))
+       {
+               _INFO("iterating received account_list");
+               label_s *label_record = NULL;
+               label_record = (label_s*)iter->data;
+               _INFO("");
+               if (callback(label_record->app_id, label_record->label, label_record->locale, user_data) == false)
+               {
+                       _INFO("application callback requested to discontinue.");
+                       break;
+               }
+               _INFO("");
+       }
+       _INFO("account_type_query_label_by_app_id end");
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_type_query_by_app_id(const char* app_id, account_type_h *account_type)
+{
+       _INFO("account_type_query_by_app_id starting");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((app_id != 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
+       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT TYPE'S POINTER IS NULL"));
+       ACCOUNT_RETURN_VAL((*account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT TYPE IS NULL"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       GVariant* account_type_variant = NULL;
+       account_type_s *in_data = (account_type_s*) (*account_type);
+
+       bool is_success = account_manager_call_account_type_query_by_app_id_sync(acc_mgr, account_db_path, app_id, &account_type_variant, NULL, &error);
+
+       int ret = _account_get_error_code(is_success, error);
+       if (ret != ACCOUNT_ERROR_NONE)
+       {
+               return ret;
+       }
+
+       account_type_s* received_account_type = umarshal_account_type (account_type_variant);
+       ACCOUNT_RETURN_VAL((received_account_type != NULL), {}, ACCOUNT_ERROR_DB_FAILED, ("INVALID DATA RECEIVED FROM SVC"));
+
+       in_data->id = received_account_type->id;
+       in_data->app_id = _account_get_text(received_account_type->app_id);
+       in_data->service_provider_id = _account_get_text(received_account_type->service_provider_id);
+       in_data->icon_path = _account_get_text(received_account_type->icon_path);
+       in_data->small_icon_path = _account_get_text(received_account_type->small_icon_path);
+       in_data->multiple_account_support = received_account_type->multiple_account_support;
+       in_data->label_list = received_account_type->label_list;
+       in_data->provider_feature_list = received_account_type->provider_feature_list;
+
+       _account_type_item_free(received_account_type);
+       _ACCOUNT_FREE(received_account_type);
+       _INFO("account_type_query_by_app_id end");
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_type_foreach_account_type_from_db(account_type_cb callback, void *user_data)
+{
+       _INFO("account_type_foreach_account_type_from_db starting");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT Callback IS NULL"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       GVariant* account_type_list_variant = NULL;
+       _INFO("before account_type_query_all_sync()");
+       bool is_success = account_manager_call_account_type_query_all_sync(acc_mgr, account_db_path, &account_type_list_variant, NULL, &error);
+
+       _INFO("after account_type_query_all_sync()");
+       int ret = _account_get_error_code(is_success, error);
+       if (ret != ACCOUNT_ERROR_NONE)
+       {
+               return ret;
+       }
+
+       _INFO("before unmarshal_account_type_list");
+       GSList* account_type_list = unmarshal_account_type_list(account_type_list_variant);
+       _INFO("after unmarshal_account_type_list");
+       if (account_type_list == NULL)
+       {
+               return ACCOUNT_ERROR_NO_DATA;
+       }
+
+       GSList* iter;
+
+       for (iter = account_type_list; iter != NULL; iter = g_slist_next(iter))
+       {
+               _INFO("iterating received account_list");
+               account_type_s *account_type = NULL;
+               account_type = (account_type_s*)iter->data;
+
+               if (callback((account_type_h)account_type, user_data) == false)
+               {
+                       _INFO("application callback requested to discontinue.");
+                       break;
+               }
+       }
+       _INFO("account_type_foreach_account_type_from_db end");
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_type_query_label_by_locale(const char* app_id, const char* locale, char** label)
+{
+       _INFO("account_type_query_label_by_locale starting");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((app_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO APP ID"));
+       ACCOUNT_RETURN_VAL((locale != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO LOCALE"));
+       ACCOUNT_RETURN_VAL((label != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("label char is null"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       char* label_temp = NULL;
+       _INFO("before account_type_query_label_by_locale_sync()");
+       bool is_success = account_manager_call_account_type_query_label_by_locale_sync(acc_mgr, account_db_path, app_id, locale, &label_temp, NULL, &error);
+
+       _INFO("after account_type_query_label_by_locale_sync() : is_success=%d", is_success);
+       int ret = _account_get_error_code(is_success, error);
+       if (ret != ACCOUNT_ERROR_NONE)
+       {
+               return ret;
+       }
+
+       if (label_temp == NULL)
+       {
+               return ACCOUNT_ERROR_NO_DATA;
+       }
+
+       *label = _account_get_text(label_temp);
+       _INFO("account_type_query_label_by_locale end");
+       return ACCOUNT_ERROR_NONE;
+
+}
+
+ACCOUNT_API int account_type_query_by_provider_feature(account_type_cb callback, const char* key, void* user_data)
+{
+       _INFO("account_type_query_by_provider_feature starting");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((key != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_type IS NULL"));
+       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("CALL BACK IS NULL"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       GVariant* account_type_list_variant = NULL;
+       bool is_success = account_manager_call_account_type_query_by_provider_feature_sync(acc_mgr, account_db_path, key, &account_type_list_variant, NULL, &error);
+
+       int ret = _account_get_error_code(is_success, error);
+       if (ret != ACCOUNT_ERROR_NONE)
+       {
+               return ret;
+       }
+
+       _INFO("before unmarshal_account_type_list");
+       GSList* account_type_list = unmarshal_account_type_list(account_type_list_variant);
+       _INFO("after unmarshal_account_type_list");
+       if (account_type_list == NULL)
+       {
+               return ACCOUNT_ERROR_NO_DATA;
+       }
+
+       GSList* iter;
+
+       for (iter = account_type_list; iter != NULL; iter = g_slist_next(iter))
+       {
+               _INFO("iterating received account_type_list");
+               account_type_s *account_type = NULL;
+               account_type = (account_type_s*)iter->data;
+               _INFO("");
+               if (callback((account_type_h)account_type, user_data) == false)
+               {
+                       _INFO("Application callback requested not to continue");
+                       break;
+               }
+               _INFO("");
+       }
+       _INFO("account_type_query_by_provider_feature end");
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_type_query_app_id_exist(const char* app_id)
+{
+       _INFO("account_type_query_app_id_exist starting");
+       char* account_db_path = ACCOUNT_DB_PATH;
+
+       ACCOUNT_RETURN_VAL((app_id != 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
+
+       GError *error = NULL;
+
+       AccountManager* acc_mgr = _account_manager_get_instance();
+       if (acc_mgr == NULL)
+       {
+               _ERR("g_bus_get_sync failed");
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       bool is_success = account_manager_call_account_type_query_app_id_exist_sync(acc_mgr, account_db_path, app_id, NULL, &error);
+
+       return _account_get_error_code(is_success, error);
+}
+
+
+static void _account_subscribe_vconf_callback(keynode_t *key, void *user_data)
+{
+       account_subscribe_s* tmp = (account_subscribe_s*)user_data;
+       char *msg = NULL, *vconf_key = NULL;
+       const char *key_name = NULL;
+       char event_msg[256] ={0, };
+       int account_id = -1;
+
+       if(!key) {
+               ACCOUNT_ERROR("No subscribtion msg !!!!!\n");
+               return;
+       }
+
+       if(!tmp) {
+               ACCOUNT_ERROR("user data required\n");
+               return;
+       }
+
+       key_name = vconf_keynode_get_name(key);
+
+       if ( key_name == NULL ) {
+               ACCOUNT_ERROR("vconf_keynode_get_name(key) fail\n");
+               return;
+       }
+
+       if(!memcmp(key_name, VCONFKEY_ACCOUNT_MSG_STR, strlen(VCONFKEY_ACCOUNT_MSG_STR)))
+       {
+               vconf_key = vconf_keynode_get_str(key);
+
+               if( vconf_key == NULL){
+                       ACCOUNT_ERROR("vconf key is NULL.\n");
+                       return;
+               }
+               msg = strdup(vconf_key);
+
+               char* event_type = NULL;
+               char* id = NULL;
+               char* ptr = NULL;
+
+               event_type = strtok_r(msg, ":", &ptr);
+               id = strtok_r(NULL, ":", &ptr);
+
+               ACCOUNT_SLOGD("msg(%s), event_type(%s), id(%s)", msg, event_type, id);
+
+               ACCOUNT_SNPRINTF(event_msg,sizeof(event_msg),"%s", event_type);
+
+               account_id = atoi(id);
+
+               if(tmp->account_subscription_callback)
+                       tmp->account_subscription_callback(event_msg, account_id, tmp->user_data);
+       }
+
+       _ACCOUNT_FREE(msg);
+
+}
+
+ACCOUNT_API int account_subscribe_create(account_subscribe_h* account_subscribe)
+{
+       if (!account_subscribe) {
+               ACCOUNT_SLOGE("account is NULL.\n", __FUNCTION__, __LINE__);
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       account_subscribe_s *data = (account_subscribe_s*)calloc(1,sizeof(account_subscribe_s));
+
+       if(!data) {
+               ACCOUNT_FATAL("OUT OF MEMORY\n");
+               return ACCOUNT_ERROR_OUT_OF_MEMORY;
+       }
+
+       *account_subscribe = (account_subscribe_h)data;
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_subscribe_notification(account_subscribe_h account_subscribe, account_event_cb callback, void* user_data)
+{
+       ACCOUNT_RETURN_VAL((account_subscribe != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account subscribe handle is NULL.\n",  __FUNCTION__, __LINE__));
+
+       account_subscribe_s* tmp =(account_subscribe_s*)account_subscribe;
+
+       tmp->account_subscription_callback = callback;
+       tmp->user_data = user_data;
+
+       int ret = -1;
+       ret = vconf_notify_key_changed(VCONFKEY_ACCOUNT_MSG_STR,
+                               (vconf_callback_fn)_account_subscribe_vconf_callback,
+                               (void*)tmp);
+
+       ACCOUNT_SLOGI("vconf_notify_key_changed ret = %d", ret);
+
+       if(ret != VCONF_OK) {
+               ACCOUNT_ERROR("Vconf Subscription Failed ret = %d", ret);
+               return ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL;
+       }
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_unsubscribe_notification(account_subscribe_h account_subscribe)
+{
+       ACCOUNT_RETURN_VAL((account_subscribe != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account subscribe handle is NULL.\n",  __FUNCTION__, __LINE__));
+
+       account_subscribe_s* tmp =(account_subscribe_s*)account_subscribe;
+
+       _ACCOUNT_FREE(tmp);
+
+       if (vconf_ignore_key_changed(VCONFKEY_ACCOUNT_MSG_STR,
+          (vconf_callback_fn)_account_subscribe_vconf_callback) != 0) {
+               ACCOUNT_ERROR("Vconf Subscription Failed !!!!!\n");
+               return ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL;
+       }
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+static void _account_subscribe_vconf_callback_ex(keynode_t *key, void *user_data)
+{
+       account_subscribe_s* tmp = (account_subscribe_s*)user_data;
+       char *msg = NULL, *vconf_key = NULL;
+       char event_msg[256] ={0, };
+       int account_id = -1;
+       const char *key_name = NULL;
+
+       if(!key) {
+               ACCOUNT_ERROR("No subscribtion msg !!!!!\n");
+               return;
+       }
+
+       if(!tmp) {
+               ACCOUNT_ERROR("user data required\n");
+               return;
+       }
+
+       key_name = vconf_keynode_get_name(key);
+
+       if ( key_name == NULL ) {
+               ACCOUNT_ERROR("vconf_keynode_get_name(key) fail\n");
+               return;
+       }
+
+       if(!memcmp(key_name, VCONFKEY_ACCOUNT_MSG_STR, strlen(VCONFKEY_ACCOUNT_MSG_STR)))
+       {
+               vconf_key = vconf_keynode_get_str(key);
+
+               if( vconf_key == NULL){
+                       ACCOUNT_ERROR("vconf key is NULL.\n");
+                       return;
+               }
+               msg = strdup(vconf_key);
+
+               char* event_type = NULL;
+               char* id = NULL;
+               char* ptr = NULL;
+
+               event_type = strtok_r(msg, ":", &ptr);
+               id = strtok_r(NULL, ":", &ptr);
+
+               ACCOUNT_SLOGD("msg(%s), event_type(%s), id(%s)", msg, event_type, id);
+
+               ACCOUNT_SNPRINTF(event_msg,sizeof(event_msg),"%s", event_type);
+
+               account_id = atoi(id);
+
+               if(tmp->account_subscription_callback)
+                       tmp->account_subscription_callback(event_msg, account_id, tmp->user_data);
+       }
+
+       _ACCOUNT_FREE(msg);
+
+}
+
+ACCOUNT_API int account_unsubscribe_notification_ex(account_subscribe_h account_subscribe)
+{
+       ACCOUNT_RETURN_VAL((account_subscribe != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account subscribe handle is NULL.\n",  __FUNCTION__, __LINE__));
+
+       account_subscribe_s* tmp =(account_subscribe_s*)account_subscribe;
+
+       _ACCOUNT_FREE(tmp);
+
+       if (vconf_ignore_key_changed(VCONFKEY_ACCOUNT_MSG_STR,
+          (vconf_callback_fn)_account_subscribe_vconf_callback_ex) != 0) {
+               ACCOUNT_ERROR("Vconf Subscription Failed !!!!!\n");
+               return ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL;
+       }
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+ACCOUNT_API int account_subscribe_notification_ex(account_subscribe_h account_subscribe, account_event_cb callback, void* user_data)
+{
+       ACCOUNT_RETURN_VAL((account_subscribe != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account subscribe handle is NULL.\n",  __FUNCTION__, __LINE__));
+
+       account_subscribe_s* tmp =(account_subscribe_s*)account_subscribe;
+
+       tmp->account_subscription_callback = callback;
+       tmp->user_data = user_data;
+
+       int ret = -1;
+       ret = vconf_notify_key_changed(VCONFKEY_ACCOUNT_MSG_STR,
+                               (vconf_callback_fn)_account_subscribe_vconf_callback_ex,
+                               (void*)tmp);
+
+       ACCOUNT_SLOGI("vconf_notify_key_changed ret = %d", ret);
+
+       if(ret != VCONF_OK) {
+               ACCOUNT_ERROR("Vconf Subscription Failed ret = %d", ret);
+               return ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL;
+       }
+
+       return ACCOUNT_ERROR_NONE;
+}
diff --git a/src/account_offline.c b/src/account_offline.c
new file mode 100644 (file)
index 0000000..b638581
--- /dev/null
@@ -0,0 +1,905 @@
+/*
+ *
+ * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <db-util.h>
+#include <pthread.h>
+#include <vconf.h>
+#include <unistd.h>
+
+#include "account.h"
+#include "account-private.h"
+#include "account_internal.h"
+#include "dbg.h"
+
+#define ACCOUNT_DB_OPEN_READONLY 0
+#define ACCOUNT_DB_OPEN_READWRITE 1
+
+typedef sqlite3_stmt* account_stmt;
+
+static sqlite3* g_hAccountDB = NULL;
+static int             g_refCntDB = 0;
+pthread_mutex_t account_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+static const char *_account_db_err_msg()
+{
+       return sqlite3_errmsg(g_hAccountDB);
+}
+
+static int _account_db_err_code()
+{
+       return sqlite3_errcode(g_hAccountDB);
+}
+
+static int _account_db_open(int mode)
+{
+       int  rc = 0;
+       char account_db_path[256] = {0, };
+
+       _INFO( "start to get DB path");
+
+       ACCOUNT_MEMSET(account_db_path, 0x00, sizeof(account_db_path));
+       ACCOUNT_SNPRINTF(account_db_path, sizeof(account_db_path), "%s", ACCOUNT_DB_PATH);
+       _INFO( "account_db_path canonicalized = %s", account_db_path);
+
+       if (!g_hAccountDB) {
+               if(mode == ACCOUNT_DB_OPEN_READWRITE)
+                       rc = db_util_open(account_db_path, &g_hAccountDB, DB_UTIL_REGISTER_HOOK_METHOD);
+               else if(mode == ACCOUNT_DB_OPEN_READONLY)
+                       rc = db_util_open_with_options(account_db_path, &g_hAccountDB, SQLITE_OPEN_READONLY, NULL);
+               else {
+                       return ACCOUNT_ERROR_DB_NOT_OPENED;
+               }
+
+               if( _account_db_err_code() == SQLITE_PERM ){
+                       ACCOUNT_ERROR( "Access failed(%s)", _account_db_err_msg());
+                       return ACCOUNT_ERROR_PERMISSION_DENIED;
+               }
+
+               ACCOUNT_RETURN_VAL((rc != SQLITE_PERM), {}, ACCOUNT_ERROR_PERMISSION_DENIED, ("Account permission denied rc : %d", rc));
+               ACCOUNT_RETURN_VAL((rc == SQLITE_OK), {}, ACCOUNT_ERROR_DB_NOT_OPENED, ("The database isn't connected. rc : %d", rc));
+               g_refCntDB++;
+       } else {
+               g_refCntDB++;
+       }
+
+       ACCOUNT_RETURN_VAL((rc == SQLITE_OK), {}, ACCOUNT_ERROR_DB_NOT_OPENED, ("busy handler fail. rc : %d", rc));
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+static int _account_db_close(void)
+{
+       int rc = 0;
+       int ret = -1;
+
+       if (g_hAccountDB) {
+               if (g_refCntDB > 0) {
+                       g_refCntDB--;
+               }
+               if (g_refCntDB == 0) {
+                       rc = db_util_close(g_hAccountDB);
+                       if(  rc == SQLITE_PERM ){
+                               ACCOUNT_ERROR( "Access failed(SQLITE_PERM)");
+                               return ACCOUNT_ERROR_PERMISSION_DENIED;
+                       } else if ( rc == SQLITE_BUSY ){
+                               ACCOUNT_ERROR( "database busy");
+                               return ACCOUNT_ERROR_DATABASE_BUSY;
+                       }
+                       ACCOUNT_RETURN_VAL((rc == SQLITE_OK), {}, ACCOUNT_ERROR_DB_FAILED, ("The database isn't connected. rc : %d", rc));
+                       g_hAccountDB = NULL;
+               }
+               ret = ACCOUNT_ERROR_NONE;
+       } else {
+               ACCOUNT_ERROR( "_account_svc_db_close: No handle(). refcnt=%d ", g_refCntDB);
+               ret = ACCOUNT_ERROR_DB_FAILED;
+       }
+
+       return ret;
+}
+
+static int _account_execute_query(const char *query)
+{
+       int rc = -1;
+       char* pszErrorMsg = NULL;
+
+       if(!query){
+               ACCOUNT_ERROR("NULL query\n");
+               return ACCOUNT_ERROR_QUERY_SYNTAX_ERROR;
+       }
+
+       if(!g_hAccountDB){
+               ACCOUNT_ERROR("DB is not opened\n");
+               return ACCOUNT_ERROR_DB_NOT_OPENED;
+       }
+
+       rc = sqlite3_exec(g_hAccountDB, query, NULL, NULL, &pszErrorMsg);
+       if (SQLITE_OK != rc) {
+               ACCOUNT_ERROR("sqlite3_exec rc(%d) query(%s) failed(%s).", rc, query, pszErrorMsg);
+               sqlite3_free(pszErrorMsg);
+       }
+
+       return rc;
+}
+
+static int _account_begin_transaction(void)
+{
+       ACCOUNT_DEBUG("_account_begin_transaction start");
+       int ret = -1;
+
+       ret = _account_execute_query("BEGIN IMMEDIATE TRANSACTION");
+
+       if (ret == SQLITE_BUSY){
+               ACCOUNT_ERROR(" sqlite3 busy = %d", ret);
+               return ACCOUNT_ERROR_DATABASE_BUSY;
+       } else if(ret != SQLITE_OK) {
+               ACCOUNT_ERROR("_account_svc_begin_transaction fail :: %d", ret);
+               return ACCOUNT_ERROR_DB_FAILED;
+       }
+
+       ACCOUNT_DEBUG("_account_begin_transaction end");
+       return ACCOUNT_ERROR_NONE;
+}
+
+static int _account_end_transaction(bool is_success)
+{
+       ACCOUNT_DEBUG("_account_end_transaction start");
+
+       int ret = -1;
+
+       if (is_success == true) {
+               ret = _account_execute_query("COMMIT TRANSACTION");
+               ACCOUNT_DEBUG("_account_end_transaction COMMIT");
+       } else {
+               ret = _account_execute_query("ROLLBACK TRANSACTION");
+               ACCOUNT_DEBUG("_account_end_transaction ROLLBACK");
+       }
+
+       if(ret == SQLITE_PERM){
+               ACCOUNT_ERROR("Account permission denied :: %d", ret);
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       if (ret == SQLITE_BUSY){
+               ACCOUNT_DEBUG(" sqlite3 busy = %d", ret);
+               return ACCOUNT_ERROR_DATABASE_BUSY;
+       }
+
+       if (ret != SQLITE_OK) {
+               ACCOUNT_ERROR("_account_svc_end_transaction fail :: %d", ret);
+               return ACCOUNT_ERROR_DB_FAILED;
+       }
+
+       ACCOUNT_DEBUG("_account_end_transaction end");
+       return ACCOUNT_ERROR_NONE;
+}
+
+static int _account_get_record_count(char* query)
+{
+       _INFO("_account_get_record_count");
+
+       int rc = -1;
+       int ncount = 0;
+       account_stmt pStmt = NULL;
+
+       if(!query){
+               _ERR("NULL query\n");
+               return ACCOUNT_ERROR_QUERY_SYNTAX_ERROR;
+       }
+
+       if(!g_hAccountDB){
+               _ERR("DB is not opened\n");
+               return ACCOUNT_ERROR_DB_NOT_OPENED;
+       }
+
+       rc = sqlite3_prepare_v2(g_hAccountDB, query, strlen(query), &pStmt, NULL);
+
+       if (SQLITE_BUSY == rc){
+               _ERR("sqlite3_prepare_v2() failed(%d, %s).", rc, _account_db_err_msg());
+               sqlite3_finalize(pStmt);
+               return ACCOUNT_ERROR_DATABASE_BUSY;
+       } else if (SQLITE_OK != rc) {
+               _ERR("sqlite3_prepare_v2() failed(%d, %s).", rc, _account_db_err_msg());
+               sqlite3_finalize(pStmt);
+               return ACCOUNT_ERROR_DB_FAILED;
+       }
+
+       rc = sqlite3_step(pStmt);
+       if (SQLITE_BUSY == rc) {
+               _ERR("sqlite3_step() failed(%d, %s).", rc, _account_db_err_msg());
+               sqlite3_finalize(pStmt);
+               return ACCOUNT_ERROR_DATABASE_BUSY;
+       } else if (SQLITE_ROW != rc) {
+               _ERR("sqlite3_step() failed(%d, %s).", rc, _account_db_err_msg());
+               sqlite3_finalize(pStmt);
+               return ACCOUNT_ERROR_DB_FAILED;
+       }
+
+       ncount = sqlite3_column_int(pStmt, 0);
+
+       _INFO("account record count [%d]", ncount);
+       sqlite3_finalize(pStmt);
+
+       return ncount;
+}
+
+static int _account_query_bind_int(account_stmt pStmt, int pos, int num)
+{
+       if(!pStmt){
+               ACCOUNT_ERROR("statement is null");
+               return -1;
+       }
+
+       if(pos < 0){
+               ACCOUNT_ERROR("invalid pos");
+               return -1;
+       }
+
+       return sqlite3_bind_int(pStmt, pos, num);
+}
+
+static int _account_query_bind_text(account_stmt pStmt, int pos, const char *str)
+{
+       _INFO("_account_query_bind_text");
+
+       if(!pStmt)
+       {
+               _ERR("statement is null");
+               return -1;
+       }
+
+       if(str)
+       {
+               _INFO("sqlite3_bind_text");
+               return sqlite3_bind_text(pStmt, pos, (const char*)str, strlen(str), SQLITE_STATIC);
+       }
+       else
+       {
+               _INFO("sqlite3_bind_null");
+               return sqlite3_bind_null(pStmt, pos);
+       }
+}
+
+static int _account_type_convert_account_to_sql(account_type_s *account_type, account_stmt hstmt, char *sql_value)
+{
+       _INFO("");
+
+       int count = 1;
+
+       /*Caution : Keep insert query orders.*/
+
+       /* 1. app id*/
+       _account_query_bind_text(hstmt, count++, (char*)account_type->app_id);
+
+       /* 2. service provider id*/
+       _account_query_bind_text(hstmt, count++, (char*)account_type->service_provider_id);
+
+       /* 3. icon path*/
+       _account_query_bind_text(hstmt, count++, (char*)account_type->icon_path);
+
+       /* 4. small icon path*/
+       _account_query_bind_text(hstmt, count++, (char*)account_type->small_icon_path);
+
+       /* 5. multiple accont support*/
+       _account_query_bind_int(hstmt, count++, account_type->multiple_account_support);
+
+       _INFO("");
+
+       return count;
+}
+
+static gboolean _account_type_check_duplicated(account_type_s *data)
+{
+       char query[ACCOUNT_SQL_LEN_MAX] = {0, };
+       int count = 0;
+
+       ACCOUNT_MEMSET(query, 0x00, sizeof(query));
+
+       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) FROM %s WHERE AppId='%s'"
+                       , ACCOUNT_TYPE_TABLE, data->app_id);
+
+       count = _account_get_record_count(query);
+       if (count > 0) {
+               return TRUE;
+       }
+
+       return FALSE;
+}
+
+static int _account_query_finalize(account_stmt pStmt)
+{
+       int rc = -1;
+
+       if (!pStmt) {
+               ACCOUNT_ERROR( "pStmt is NULL");
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       rc = sqlite3_finalize(pStmt);
+       if (rc == SQLITE_BUSY){
+               ACCOUNT_ERROR(" sqlite3 busy = %d", rc);
+               return ACCOUNT_ERROR_DATABASE_BUSY;
+       } else if (rc != SQLITE_OK) {
+               ACCOUNT_ERROR( "sqlite3_finalize fail, rc : %d, db_error : %s\n", rc, _account_db_err_msg());
+               return ACCOUNT_ERROR_DB_FAILED;
+       }
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+static int _account_query_step(account_stmt pStmt)
+{
+       if(!pStmt){
+               ACCOUNT_ERROR( "pStmt is NULL");
+               return -1;
+       }
+
+       return sqlite3_step(pStmt);
+}
+
+static account_stmt _account_prepare_query(char *query)
+{
+       int                     rc = -1;
+       account_stmt    pStmt = NULL;
+
+       ACCOUNT_RETURN_VAL((query != NULL), {}, NULL, ("query is NULL"));
+
+       rc = sqlite3_prepare_v2(g_hAccountDB, query, strlen(query), &pStmt, NULL);
+
+       ACCOUNT_RETURN_VAL((SQLITE_OK == rc), {}, NULL, ("sqlite3_prepare_v2(%s) failed(%s).", query, _account_db_err_msg()));
+
+       return pStmt;
+}
+
+static int _account_get_next_sequence(const char *pszName)
+{
+       int                     rc = 0;
+       account_stmt    pStmt = NULL;
+       int                     max_seq = 0;
+       char                    szQuery[ACCOUNT_SQL_LEN_MAX] = {0,};
+
+       ACCOUNT_MEMSET(szQuery, 0x00, sizeof(szQuery));
+       ACCOUNT_SNPRINTF(szQuery, sizeof(szQuery),  "SELECT max(seq) FROM %s where name = '%s' ", ACCOUNT_SQLITE_SEQ, pszName);
+       rc = sqlite3_prepare_v2(g_hAccountDB, szQuery, strlen(szQuery), &pStmt, NULL);
+       if (SQLITE_OK != rc) {
+               ACCOUNT_SLOGE("sqlite3_prepare_v2() failed(%d, %s).", rc, _account_db_err_msg());
+               sqlite3_finalize(pStmt);
+               return ACCOUNT_ERROR_DB_FAILED;
+       }
+
+       rc = sqlite3_step(pStmt);
+       max_seq = sqlite3_column_int(pStmt, 0);
+       max_seq++;
+
+       /*Finalize Statement*/
+       rc = sqlite3_finalize(pStmt);
+       pStmt = NULL;
+
+       return max_seq;
+}
+
+static int _account_type_insert_provider_feature(account_type_s *account_type, const char* app_id)
+{
+       int                     rc, count = 1;
+       char                    query[ACCOUNT_SQL_LEN_MAX] = {0, };
+       account_stmt    hstmt = NULL;
+
+       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
+       ACCOUNT_RETURN_VAL((app_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
+
+       if (g_slist_length( account_type->provider_feature_list)==0) {
+               ACCOUNT_ERROR( "no capability\n");
+               return ACCOUNT_ERROR_NONE;
+       }
+
+       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) from %s where AppId='%s'", ACCOUNT_TYPE_TABLE, app_id);
+
+       rc = _account_get_record_count(query);
+
+       if( _account_db_err_code() == SQLITE_PERM ){
+               ACCOUNT_ERROR( "Access failed(%s)", _account_db_err_msg());
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       if (rc <= 0) {
+               ACCOUNT_SLOGI( "related account type item is not existed rc=%d , %s", rc, _account_db_err_msg());
+               return ACCOUNT_ERROR_RECORD_NOT_FOUND;
+       }
+
+       /* insert query*/
+
+       GSList *iter;
+
+       for (iter = account_type->provider_feature_list; iter != NULL; iter = g_slist_next(iter)) {
+               int ret;
+               count = 1;
+               ACCOUNT_MEMSET(query, 0x00, sizeof(query));
+               ACCOUNT_SNPRINTF(query, sizeof(query), "INSERT INTO %s(app_id, key) VALUES "
+                               "(?, ?) ", PROVIDER_FEATURE_TABLE);
+
+               hstmt = _account_prepare_query(query);
+
+               ACCOUNT_RETURN_VAL((hstmt != NULL), {}, ACCOUNT_ERROR_DB_FAILED, ("_account_prepare_query() failed(%s).\n", _account_db_err_msg()));
+
+               provider_feature_s* feature_data = NULL;
+               feature_data = (provider_feature_s*)iter->data;
+
+               ret = _account_query_bind_text(hstmt, count++, app_id);
+               ACCOUNT_RETURN_VAL((ret == ACCOUNT_ERROR_NONE), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("Text binding fail"));
+               ret = _account_query_bind_text(hstmt, count++, feature_data->key);
+               ACCOUNT_RETURN_VAL((ret == ACCOUNT_ERROR_NONE), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("Integer binding fail"));
+
+               rc = _account_query_step(hstmt);
+
+               if (rc != SQLITE_DONE) {
+                       ACCOUNT_ERROR( "_account_query_step() failed(%d, %s)", rc, _account_db_err_msg());
+                       break;
+               }
+
+               rc = _account_query_finalize(hstmt);
+               ACCOUNT_RETURN_VAL((rc == ACCOUNT_ERROR_NONE), {}, rc, ("finalize error"));
+               hstmt = NULL;
+
+       }
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+static int _account_type_insert_label(account_type_s *account_type)
+{
+       int                     rc, count = 1;
+       char                    query[ACCOUNT_SQL_LEN_MAX] = {0, };
+       account_stmt    hstmt = NULL;
+
+       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
+
+       if (g_slist_length( account_type->label_list)==0) {
+               ACCOUNT_ERROR( "_account_type_insert_label, no label\n");
+               return ACCOUNT_ERROR_NONE;
+       }
+
+       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) from %s where AppId = '%s'", ACCOUNT_TYPE_TABLE, account_type->app_id);
+
+       rc = _account_get_record_count(query);
+
+       if( _account_db_err_code() == SQLITE_PERM ){
+               ACCOUNT_ERROR( "Access failed(%s)", _account_db_err_msg());
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       if (rc <= 0) {
+               return ACCOUNT_ERROR_RECORD_NOT_FOUND;
+       }
+
+       /* insert query*/
+       GSList *iter;
+
+       for (iter = account_type->label_list; iter != NULL; iter = g_slist_next(iter)) {
+               int ret;
+               count = 1;
+               ACCOUNT_MEMSET(query, 0x00, sizeof(query));
+               ACCOUNT_SNPRINTF(query, sizeof(query), "INSERT INTO %s(AppId, Label, Locale) VALUES "
+                               "(?, ?, ?) ", LABEL_TABLE);
+
+               hstmt = _account_prepare_query(query);
+
+               ACCOUNT_RETURN_VAL((hstmt != NULL), {}, ACCOUNT_ERROR_DB_FAILED, ("_account_prepare_query() failed(%s).\n", _account_db_err_msg()));
+
+               label_s* label_data = NULL;
+               label_data = (label_s*)iter->data;
+
+               ret = _account_query_bind_text(hstmt, count++, account_type->app_id);
+               ACCOUNT_RETURN_VAL((ret == ACCOUNT_ERROR_NONE), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("Text binding fail"));
+               ret = _account_query_bind_text(hstmt, count++, label_data->label);
+               ACCOUNT_RETURN_VAL((ret == ACCOUNT_ERROR_NONE), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("Text binding fail"));
+               ret = _account_query_bind_text(hstmt, count++, (char*)label_data->locale);
+               ACCOUNT_RETURN_VAL((ret == ACCOUNT_ERROR_NONE), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("Text binding fail"));
+
+               rc = _account_query_step(hstmt);
+
+               if (rc != SQLITE_DONE) {
+                       ACCOUNT_ERROR( "_account_query_step() failed(%d, %s)", rc, _account_db_err_msg());
+                       break;
+               }
+
+               rc = _account_query_finalize(hstmt);
+               ACCOUNT_RETURN_VAL((rc == ACCOUNT_ERROR_NONE), {}, rc, ("finalize error"));
+               hstmt = NULL;
+
+       }
+
+       return ACCOUNT_ERROR_NONE;
+}
+
+static int _account_type_execute_insert_query(account_type_s *account_type)
+{
+       _INFO("");
+
+       int                             rc = 0;
+       char                    query[ACCOUNT_SQL_LEN_MAX] = {0, };
+       int                             error_code = ACCOUNT_ERROR_NONE;
+       account_stmt    hstmt = NULL;
+
+       /* check mandatory field */
+       // app id & service provider id
+       if (!account_type->app_id) {
+               return ACCOUNT_ERROR_INVALID_PARAMETER;
+       }
+
+       ACCOUNT_MEMSET(query, 0x00, sizeof(query));
+       ACCOUNT_SNPRINTF(query, sizeof(query), "INSERT INTO %s( AppId, ServiceProviderId , IconPath , SmallIconPath , MultipleAccountSupport ) values "
+                       "(?, ?, ?, ?, ?)",      ACCOUNT_TYPE_TABLE);
+
+       _INFO("");
+       hstmt = _account_prepare_query(query);
+       _INFO("");
+
+       if( _account_db_err_code() == SQLITE_PERM ){
+               ACCOUNT_ERROR( "Access failed(%s)", _account_db_err_msg());
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       } else if( _account_db_err_code() == SQLITE_BUSY ){
+               ACCOUNT_ERROR( "Database Busy(%s)", _account_db_err_msg());
+               return ACCOUNT_ERROR_DATABASE_BUSY;
+       }
+
+       ACCOUNT_RETURN_VAL((hstmt != NULL), {}, ACCOUNT_ERROR_DB_FAILED, ("_account_prepare_query() failed(%s).\n", _account_db_err_msg()));
+
+       _INFO("");
+       _account_type_convert_account_to_sql(account_type, hstmt, query);
+       _INFO("");
+
+       rc = _account_query_step(hstmt);
+       if (rc == SQLITE_BUSY) {
+               ACCOUNT_ERROR( "account_db_query_step() failed(%d, %s)", rc, _account_db_err_msg());
+               error_code = ACCOUNT_ERROR_DATABASE_BUSY;
+       } else if (rc != SQLITE_DONE) {
+               ACCOUNT_ERROR( "account_db_query_step() failed(%d, %s)", rc, _account_db_err_msg());
+               error_code = ACCOUNT_ERROR_DB_FAILED;
+       }
+
+       _INFO("");
+       rc = _account_query_finalize(hstmt);
+       ACCOUNT_RETURN_VAL((rc == ACCOUNT_ERROR_NONE), {}, rc, ("finalize error"));
+       hstmt = NULL;
+
+       _INFO("");
+       return error_code;
+}
+
+int _account_type_insert_to_db(account_type_s* account_type, int* account_type_id)
+{
+       _INFO("");
+
+       int             error_code = ACCOUNT_ERROR_NONE, ret_transaction = 0;
+
+       ACCOUNT_RETURN_VAL((g_hAccountDB != NULL), {}, ACCOUNT_ERROR_DB_NOT_OPENED, ("The database isn't connected."));
+       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT TYPE HANDLE IS NULL"));
+       ACCOUNT_RETURN_VAL((account_type_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT TYPE ID POINTER IS NULL"));
+
+       account_type_s *data = (account_type_s*)account_type;
+
+       pthread_mutex_lock(&account_mutex);
+
+
+       /* transaction control required*/
+       ret_transaction = _account_begin_transaction();
+
+       _INFO("");
+
+       if( _account_db_err_code() == SQLITE_PERM ){
+               pthread_mutex_unlock(&account_mutex);
+               ACCOUNT_ERROR( "Access failed(%s)", _account_db_err_msg());
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       _INFO("");
+       if( ret_transaction == ACCOUNT_ERROR_DATABASE_BUSY ){
+               ACCOUNT_ERROR( "database busy(%s)", _account_db_err_msg());
+               pthread_mutex_unlock(&account_mutex);
+               return ACCOUNT_ERROR_DATABASE_BUSY;
+       } else if (ret_transaction != ACCOUNT_ERROR_NONE) {
+               ACCOUNT_ERROR("_account_begin_transaction fail %d\n", ret_transaction);
+               pthread_mutex_unlock(&account_mutex);
+               return ret_transaction;
+       }
+
+       _INFO("");
+       if (_account_type_check_duplicated(data)) {
+               _INFO("");
+               ret_transaction = _account_end_transaction(FALSE);
+               ACCOUNT_ERROR("Duplicated, rollback insert query(%x)!!!!\n", ret_transaction);
+               *account_type_id = -1;
+               pthread_mutex_unlock(&account_mutex);
+               return ACCOUNT_ERROR_DUPLICATED;
+       } else {
+               _INFO("");
+               *account_type_id = _account_get_next_sequence(ACCOUNT_TYPE_TABLE);
+
+               error_code = _account_type_execute_insert_query(data);
+
+               if (error_code != ACCOUNT_ERROR_NONE){
+                       error_code = ACCOUNT_ERROR_DUPLICATED;
+                       ret_transaction = _account_end_transaction(FALSE);
+                       ACCOUNT_ERROR("Insert fail, rollback insert query(%x)!!!!\n", ret_transaction);
+                       *account_type_id = -1;
+                       pthread_mutex_unlock(&account_mutex);
+                       return error_code;
+               }
+       }
+
+       _INFO("");
+       error_code = _account_type_insert_provider_feature(data, data->app_id);
+       if(error_code != ACCOUNT_ERROR_NONE) {
+               _INFO("");
+               ret_transaction = _account_end_transaction(FALSE);
+               ACCOUNT_ERROR("Insert provider feature fail(%x), rollback insert query(%x)!!!!\n", error_code, ret_transaction);
+               pthread_mutex_unlock(&account_mutex);
+               return error_code;
+       }
+       _INFO("");
+       error_code = _account_type_insert_label(data);
+       if(error_code != ACCOUNT_ERROR_NONE) {
+               _INFO("");
+               ret_transaction = _account_end_transaction(FALSE);
+               ACCOUNT_ERROR("Insert label fail(%x), rollback insert query(%x)!!!!\n", error_code, ret_transaction);
+               pthread_mutex_unlock(&account_mutex);
+               return error_code;
+       }
+
+       ret_transaction = _account_end_transaction(TRUE);
+       _INFO("");
+       pthread_mutex_unlock(&account_mutex);
+
+       _INFO("");
+       return ACCOUNT_ERROR_NONE;
+}
+
+int _account_type_delete_by_app_id(const char* app_id)
+{
+       int                     error_code = ACCOUNT_ERROR_NONE;
+       account_stmt    hstmt = NULL;
+       char                    query[ACCOUNT_SQL_LEN_MAX] = {0, };
+       int                     rc = 0, count = -1;
+       int                     ret_transaction = 0;
+       int                             binding_count = 1;
+       bool                    is_success = FALSE;
+
+       ACCOUNT_RETURN_VAL((g_hAccountDB != NULL), {}, ACCOUNT_ERROR_DB_NOT_OPENED, ("The database isn't connected."));
+       ACCOUNT_RETURN_VAL((app_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("The database isn't connected."));
+
+       /* Check requested ID to delete */
+       ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT COUNT(*) FROM %s WHERE AppId = '%s'", ACCOUNT_TYPE_TABLE, app_id);
+
+       count = _account_get_record_count(query);
+
+       if( _account_db_err_code() == SQLITE_PERM ){
+               ACCOUNT_ERROR( "Access failed(%s)", _account_db_err_msg());
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       if (count <= 0) {
+               ACCOUNT_SLOGE("app id(%s) is not exist. count(%d)\n", app_id, count);
+               return ACCOUNT_ERROR_RECORD_NOT_FOUND;
+       }
+
+       /* transaction control required*/
+       ret_transaction = _account_begin_transaction();
+
+       if( ret_transaction == ACCOUNT_ERROR_DATABASE_BUSY ){
+               ACCOUNT_ERROR( "database busy(%s)", _account_db_err_msg());
+               pthread_mutex_unlock(&account_mutex);
+               return ACCOUNT_ERROR_DATABASE_BUSY;
+       }else if (ret_transaction != ACCOUNT_ERROR_NONE) {
+               ACCOUNT_ERROR("account_delete:_account_begin_transaction fail %d\n", ret_transaction);
+               pthread_mutex_unlock(&account_mutex);
+               return ret_transaction;
+       }
+
+       ACCOUNT_SNPRINTF(query, sizeof(query), "DELETE FROM %s WHERE AppId = ?", LABEL_TABLE);
+
+       hstmt = _account_prepare_query(query);
+
+       if( _account_db_err_code() == SQLITE_PERM ){
+               ACCOUNT_ERROR( "Access failed(%s)", _account_db_err_msg());
+               pthread_mutex_unlock(&account_mutex);
+               return ACCOUNT_ERROR_PERMISSION_DENIED;
+       }
+
+       ACCOUNT_CATCH_ERROR(hstmt != NULL, {}, ACCOUNT_ERROR_DB_FAILED,
+                       ("_account_svc_query_prepare(%s) failed(%s).\n", query, _account_db_err_msg()));
+
+       _account_query_bind_text(hstmt, binding_count++, app_id);
+
+       rc = _account_query_step(hstmt);
+       ACCOUNT_CATCH_ERROR(rc == SQLITE_DONE, {}, ACCOUNT_ERROR_RECORD_NOT_FOUND, ("The record isn't found.\n"));
+
+       rc = _account_query_finalize(hstmt);
+       ACCOUNT_RETURN_VAL((rc == ACCOUNT_ERROR_NONE), {}, rc, ("finalize error"));
+       hstmt = NULL;
+
+       binding_count = 1;
+       ACCOUNT_MEMSET(query, 0, sizeof(query));
+
+       ACCOUNT_SNPRINTF(query, sizeof(query), "DELETE FROM %s WHERE app_id = ? ", PROVIDER_FEATURE_TABLE);
+
+       hstmt = _account_prepare_query(query);
+       ACCOUNT_CATCH_ERROR(hstmt != NULL, {}, ACCOUNT_ERROR_DB_FAILED,
+                       ("_account_svc_query_prepare(%s) failed(%s).\n", query, _account_db_err_msg()));
+
+       _account_query_bind_text(hstmt, binding_count++, app_id);
+
+       rc = _account_query_step(hstmt);
+       ACCOUNT_CATCH_ERROR(rc == SQLITE_DONE, {}, ACCOUNT_ERROR_RECORD_NOT_FOUND, ("The record isn't found. AppId=%s, rc=%d\n", app_id, rc));
+
+       rc = _account_query_finalize(hstmt);
+       ACCOUNT_RETURN_VAL((rc == ACCOUNT_ERROR_NONE), {}, rc, ("finalize error"));
+       is_success = TRUE;
+
+       hstmt = NULL;
+
+       binding_count = 1;
+       ACCOUNT_MEMSET(query, 0, sizeof(query));
+
+       ACCOUNT_SNPRINTF(query, sizeof(query), "DELETE FROM %s WHERE AppId = ? ", ACCOUNT_TYPE_TABLE);
+
+       hstmt = _account_prepare_query(query);
+       ACCOUNT_CATCH_ERROR(hstmt != NULL, {}, ACCOUNT_ERROR_DB_FAILED,
+                       ("_account_svc_query_prepare(%s) failed(%s).\n", query, _account_db_err_msg()));
+
+       _account_query_bind_text(hstmt, binding_count++, app_id);
+
+       rc = _account_query_step(hstmt);
+       ACCOUNT_CATCH_ERROR(rc == SQLITE_DONE, {}, ACCOUNT_ERROR_RECORD_NOT_FOUND, ("The record isn't found. AppId=%s, rc=%d\n", app_id, rc));
+
+       rc = _account_query_finalize(hstmt);
+       ACCOUNT_RETURN_VAL((rc == ACCOUNT_ERROR_NONE), {}, rc, ("finalize error"));
+       is_success = TRUE;
+
+       hstmt = NULL;
+
+       CATCH:
+       if (hstmt != NULL) {
+               rc = _account_query_finalize(hstmt);
+               ACCOUNT_RETURN_VAL((rc == ACCOUNT_ERROR_NONE), {}, rc, ("finalize error"));
+               hstmt = NULL;
+       }
+
+       ret_transaction = _account_end_transaction(is_success);
+
+       if (ret_transaction != ACCOUNT_ERROR_NONE) {
+               ACCOUNT_ERROR("account_svc_delete:_account_svc_end_transaction fail %d, is_success=%d\n", ret_transaction, is_success);
+       }
+
+       pthread_mutex_unlock(&account_mutex);
+
+       return error_code;
+}
+
+ACCOUNT_INTERNAL_API int account_type_insert_to_db_offline(account_type_h account_type, int* account_type_id)
+{
+       _INFO("account_type_insert_to_db starting");
+
+       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT TYPE HANDLE IS NULL"));
+       ACCOUNT_RETURN_VAL((account_type_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT TYPE ID POINTER IS NULL"));
+
+       int db_id = -1;
+
+       _INFO("account_manager_account_type_add start");
+
+       guint pid = getpid();
+       _INFO("client Id = [%u]", pid);
+
+       int return_code = _account_db_open(1);
+       if (return_code != ACCOUNT_ERROR_NONE)
+       {
+               _ERR("_account_db_open() error, ret = %d", return_code);
+
+               goto RETURN;
+       }
+
+       int uid = getuid();
+       if (uid != 0)
+       {
+               _ERR("current daemon is not root user, uid=%d", uid);
+               goto RETURN;
+       }
+
+       _INFO("before _account_type_insert_to_db");
+       return_code = _account_type_insert_to_db((account_type_s*)account_type, &db_id);
+       _INFO("after _account_type_insert_to_db");
+       if (return_code != ACCOUNT_ERROR_NONE)
+       {
+               _ERR("_account_type_insert_to_db error");
+               goto RETURN;
+       }
+
+       *account_type_id = db_id;
+
+       account_type_s* account_type_data = (account_type_s*)account_type;
+       account_type_data->id = db_id;
+
+RETURN:
+       _INFO("account_manager_account_type_add end");
+
+       if( g_hAccountDB == NULL )
+               return return_code;
+
+       return_code = _account_db_close();
+       if (return_code != ACCOUNT_ERROR_NONE)
+       {
+               ACCOUNT_DEBUG("_account_db_close() fail[%d]", return_code);
+               return_code = ACCOUNT_ERROR_DB_FAILED;
+       }
+
+       return return_code;
+}
+
+ACCOUNT_INTERNAL_API int account_type_delete_by_app_id_offline(const char* app_id)
+{
+       _INFO("account_type_delete_by_app_id starting");
+
+       ACCOUNT_RETURN_VAL((app_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
+
+       guint pid = getpid();
+
+       _INFO("client Id = [%u]", pid);
+
+       int return_code = _account_db_open(1);
+       if (return_code != ACCOUNT_ERROR_NONE)
+       {
+               _ERR("_account_db_open() error, ret = %d", return_code);
+
+               goto RETURN;
+       }
+
+       int uid = getuid();
+       if (uid != 0)
+       {
+               _ERR("current daemon is not root user, uid=%d", uid);
+               goto RETURN;
+       }
+
+       _INFO("before _account_type_delete_by_app_id");
+       return_code = _account_type_delete_by_app_id(app_id);
+       _INFO("after _account_type_delete_by_app_id=[%d]", return_code);
+
+       if (return_code != ACCOUNT_ERROR_NONE)
+       {
+               _ERR("_account_type_delete_by_app_id error");
+               goto RETURN;
+       }
+
+RETURN:
+       _INFO("account_type_delete_by_app_id_offline end");
+
+       if( g_hAccountDB == NULL )
+               return return_code;
+
+       return_code = _account_db_close();
+       if (return_code != ACCOUNT_ERROR_NONE)
+       {
+               ACCOUNT_DEBUG("_account_db_close() fail[%d]", return_code);
+               return_code = ACCOUNT_ERROR_DB_FAILED;
+       }
+
+       return return_code;
+}
+
diff --git a/src/account_private_client.h b/src/account_private_client.h
new file mode 100644 (file)
index 0000000..20fc652
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ *  account
+ *
+ * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Wonyoung Lee <wy1115.lee@samsung.com>, Sungchan Kim <sungchan81.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ACCOUNT_PRIVATE_CLIENT_H__
+#define __ACCOUNT_PRIVATE_CLIENT_H__
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include "account.h"
+#include "account-types.h"
+
+typedef struct _account_subscribe_s
+{
+           account_event_cb account_subscription_callback;
+           void* user_data;
+}account_subscribe_s;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ACCOUNT_PRIVATE_CLIENT_H__*/
diff --git a/src/accounts-svc.pc.in b/src/accounts-svc.pc.in
new file mode 100644 (file)
index 0000000..502889f
--- /dev/null
@@ -0,0 +1,13 @@
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=@BINDIR@
+libdir=@LIBDIR@
+includedir=@INCLUDEDIR@
+
+Name: accounts-svc
+Description: Account DB library
+Version: @VERSION@
+#Requires: capi-base-common
+Libs: -L@LIBDIR@ -laccounts-svc
+Cflags: -I@INCLUDEDIR@
diff --git a/src/accounts/CMakeLists.txt b/src/accounts/CMakeLists.txt
deleted file mode 100755 (executable)
index 83ddb83..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-ADD_SUBDIRECTORY(client)
-
-CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/accounts-svc.pc.in ${CMAKE_SOURCE_DIR}/accounts-svc.pc @ONLY)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/accounts-svc.pc DESTINATION ${LIBDIR}/pkgconfig)
diff --git a/src/accounts/account_mgr.xml b/src/accounts/account_mgr.xml
deleted file mode 100644 (file)
index a8a95d5..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<node name="/org/tizen/account/manager">
-  <interface name="org.tizen.account.manager">
-    <method name="account_add">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="a{sv}" name="account_data" direction="in" />
-      <arg type="i" name="account_db_id" direction="out" />
-    </method>
-    <method name="account_type_add">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="a{sv}" name="account_type_data" direction="in" />
-      <arg type="i" name="account_type_db_id" direction="out" />
-    </method>
-    <method name="account_query_all">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="aa{sv}" name="account_data" direction="out" />
-    </method>
-    <method name="account_type_query_all">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="aa{sv}" name="account_type_data" direction="out" />
-    </method>
-    <method name="account_delete_from_db_by_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="i" name="account_db_id" direction="in" />
-    </method>
-    <method name="account_delete_from_db_by_user_name">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="user_name" direction="in" />
-      <arg type="s" name="package_name" direction="in" />
-    </method>
-    <method name="account_delete_from_db_by_package_name">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="package_name" direction="in" />
-      <arg type="b" name="permission" direction="in" />
-    </method>
-    <method name="account_update_to_db_by_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="a{sv}" name="account_data" direction="in" />
-      <arg type="i" name="account_id" direction="in" />
-    </method>
-    <method name="account_get_total_count_from_db">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="b" name="include_hidden" direction="in" />
-      <arg type="i" name="count" direction="out" />
-    </method>
-    <method name="account_query_account_by_account_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="i" name="account_db_id" direction="in" />
-      <arg type="a{sv}" name="account_data" direction="out" />
-    </method>
-    <method name="account_update_to_db_by_user_name">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="a{sv}" name="account_data" direction="in" />
-      <arg type="s" name="user_name" direction="in" />
-      <arg type="s" name="package_name" direction="in" />
-    </method>
-    <method name="account_type_query_label_by_locale">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="app_id" direction="in" />
-      <arg type="s" name="locale" direction="in" />
-      <arg type="s" name="label_name" direction="out" />
-    </method>
-    <method name="account_type_query_by_provider_feature">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="key" direction="in" />
-      <arg type="aa{sv}" name="account_type_list_data" direction="out" />
-    </method>
-    <method name="account_query_account_by_user_name">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="user_name" direction="in" />
-      <arg type="aa{sv}" name="account_list_data" direction="out" />
-    </method>
-    <method name="account_query_account_by_package_name">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="package_name" direction="in" />
-      <arg type="aa{sv}" name="account_list_data" direction="out" />
-    </method>
-    <method name="account_query_account_by_capability">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="capability_type" direction="in" />
-      <arg type="i" name="capability_value" direction="in" />
-      <arg type="aa{sv}" name="account_list_data" direction="out" />
-    </method>
-    <method name="account_query_account_by_capability_type">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="capability_type" direction="in" />
-      <arg type="aa{sv}" name="account_list_data" direction="out" />
-    </method>
-    <method name="account_query_capability_by_account_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="i" name="account_id" direction="in" />
-      <arg type="aa{sv}" name="account_list_data" direction="out" />
-    </method>
-    <method name="account_update_sync_status_by_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="i" name="account_db_id" direction="in" />
-      <arg type="i" name="sync_status" direction="in" />
-    </method>
-    <method name="account_type_query_provider_feature_by_app_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="app_id" direction="in" />
-      <arg type="a(ss)" name="feature_list_data" direction="out" />
-    </method>
-    <method name="account_type_query_supported_feature">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="app_id" direction="in" />
-      <arg type="s" name="capability" direction="in" />
-      <arg type="i" name="is_supported" direction="out" />
-    </method>
-    <method name="account_type_update_to_db_by_app_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="a{sv}" name="account_type_variant" direction="in" />
-      <arg type="s" name="app_id" direction="in" />
-    </method>
-    <method name="account_type_delete_by_app_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="app_id" direction="in" />
-    </method>
-    <method name="account_type_query_label_by_app_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="app_id" direction="in" />
-      <arg type="a(sss)" name="label_list_variant" direction="out" />
-    </method>
-    <method name="account_type_query_by_app_id">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="app_id" direction="in" />
-      <arg type="a{sv}" name="account_type_variant" direction="out" />
-    </method>
-    <method name="account_type_query_app_id_exist">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="s" name="app_id" direction="in" />
-    </method>
-    <method name="account_update_to_db_by_id_ex">
-      <arg type="s" name="account_db_path" direction="in" />
-      <arg type="a{sv}" name="account_variant" direction="in" />
-      <arg type="i" name="account_id" direction="in" />
-    </method>
-  </interface>
-</node>
diff --git a/src/accounts/accounts-svc.pc.in b/src/accounts/accounts-svc.pc.in
deleted file mode 100755 (executable)
index fead59c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# Package Information for pkg-config
-
-prefix=@PREFIX@
-exec_prefix=@EXEC_PREFIX@
-libdir=@LIBDIR@
-includedir=@INCLUDEDIR@
-
-Name: accounts-svc
-Description: Account DB library
-Version: @VERSION@
-#Requires: capi-base-common
-Libs: -L${libdir} -laccounts-svc
-Cflags: -I${includedir}
diff --git a/src/accounts/client/CMakeLists.txt b/src/accounts/client/CMakeLists.txt
deleted file mode 100755 (executable)
index 85fc041..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-
-SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-SET(EXEC_PREFIX "\${prefix}")
-#SET(LIBDIR "\${prefix}/lib")
-#SET(INCLUDEDIR "\${prefix}/include ")
-SET(VERSION_MAJOR 0)
-SET(VERSION "${VERSION_MAJOR}.3.0")
-
-SET(SRCS
-       account.c
-       ../common/account_ipc_marshal.c
-)
-
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/accounts/common)
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(clientpkgs REQUIRED
-               dbus-1
-               dlog
-               gobject-2.0
-               glib-2.0
-               gio-2.0
-               gio-unix-2.0
-               capi-base-common
-               vconf
-)
-
-FOREACH(flag ${clientpkgs_CFLAGS})
-       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-FIND_PROGRAM(UNAME NAMES uname)
-EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
-IF ("${ARCH}" STREQUAL "arm")
-        ADD_DEFINITIONS("-DTARGET_ARM")
-        MESSAGE("[TARGET] Compile")
-ELSE  ("${ARCH}" STREQUAL "arm")
-        ADD_DEFINITIONS("-DTARGET_I386")
-        MESSAGE("[i386] Compile")
-ENDIF ("${ARCH}" STREQUAL "arm")
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror")
-SET(CMAKE_LDFLAGS "-Wl,-zdefs")
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"")
-ADD_DEFINITIONS("-DSLP_DEBUG")
-
-ADD_CUSTOM_COMMAND(
-       WORKING_DIRECTORY
-       OUTPUT account-mgr-stub.c
-       COMMAND gdbus-codegen --interface-prefix org.tizen.
-       --generate-c-code account-mgr-stub ../account_mgr.xml
-       COMMENT "Generating Account Client GDBus .c/.h")
-
-ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS} account-mgr-stub.c)
-SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
-SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
-
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${clientpkgs_LDFLAGS})
-
-CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
-
-#INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib/accounts-svc)
-#INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib)
-#INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
-
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR}/accounts-svc)
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR})
-INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIBDIR}/pkgconfig)
-
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/account.h DESTINATION include)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/account-error.h DESTINATION include)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/account-types.h DESTINATION include)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/account_internal.h DESTINATION include)
-#INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/account_product.h DESTINATION include)
-
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/src/accounts/client/account-mgr-stub.h DESTINATION include)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/src/accounts/common/account_ipc_marshal.h DESTINATION include)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/src/accounts/common/account-private.h DESTINATION include)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/src/accounts/common/dbg.h DESTINATION include)
diff --git a/src/accounts/client/account.c b/src/accounts/client/account.c
deleted file mode 100755 (executable)
index 742278d..0000000
+++ /dev/null
@@ -1,2909 +0,0 @@
-/*
- *
- * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <gio/gio.h>
-#include <stdlib.h>
-#include <glib.h>
-#include <fcntl.h>
-#include <glib/gprintf.h>
-#ifdef G_OS_UNIX
-#include <gio/gunixfdlist.h>
-#include <unistd.h>
-#endif
-#include <vconf.h>
-
-#include "account.h"
-#include "account-error.h"
-#include "account-private.h"
-#include "account-types.h"
-#include "account_ipc_marshal.h"
-
-#include "dbg.h"
-#include "account-mgr-stub.h"
-
-#define ACCOUNT_DB_OPEN_READONLY 0
-#define ACCOUNT_DB_OPEN_READWRITE 1
-
-#define VCONF_OK 0
-
-static AccountManager *_acc_mgr = NULL;
-
-static char *_account_get_text(const char *text_data);
-static int _account_gslist_free(GSList* list);
-static int _account_glist_free(GList* list);
-
-static int _account_free_capability_items(account_capability_s *data)
-{
-       _ACCOUNT_FREE(data->type);
-       _ACCOUNT_FREE(data->package_name);
-       _ACCOUNT_FREE(data->user_name);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_custom_item_free(account_custom_s *data)
-{
-       _ACCOUNT_FREE(data->app_id);
-       _ACCOUNT_FREE(data->key);
-       _ACCOUNT_FREE(data->value);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_custom_gslist_free(GSList* list)
-{
-       if(!list){
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       GSList* iter;
-
-       for (iter = list; iter != NULL; iter = g_slist_next(iter)) {
-               account_custom_s *custom_data = (account_custom_s*)iter->data;
-               _account_custom_item_free(custom_data);
-               _ACCOUNT_FREE(custom_data);
-       }
-
-       g_slist_free(list);
-       list = NULL;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_list_free(GList* list)
-{
-       if(!list){
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       g_list_free_full(list, g_free);
-       list = NULL;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_free_account_items(account_s *data)
-{
-       _ACCOUNT_FREE(data->user_name);
-       _ACCOUNT_FREE(data->email_address);
-       _ACCOUNT_FREE(data->display_name);
-       _ACCOUNT_FREE(data->icon_path);
-       _ACCOUNT_FREE(data->source);
-       _ACCOUNT_FREE(data->package_name);
-       _ACCOUNT_FREE(data->domain_name);
-       _ACCOUNT_FREE(data->access_token);
-
-       int i;
-       for(i=0;i<USER_TXT_CNT;i++)
-               _ACCOUNT_FREE(data->user_data_txt[i]);
-
-       _account_gslist_free(data->capablity_list);
-       _account_glist_free(data->account_list);
-       _account_custom_gslist_free(data->custom_list);
-       _account_list_free(data->domain_list);
-       _account_list_free(data->mechanism_list);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_gslist_free(GSList* list)
-{
-       if(!list){
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       GSList* iter;
-
-       for (iter = list; iter != NULL; iter = g_slist_next(iter)) {
-               account_capability_s *cap_data = (account_capability_s*)iter->data;
-               _account_free_capability_items(cap_data);
-               _ACCOUNT_FREE(cap_data);
-       }
-
-       g_slist_free(list);
-       list = NULL;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_glist_free(GList* list)
-{
-       if(!list){
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       GList* iter;
-
-       for (iter = list; iter != NULL; iter = g_list_next(iter)) {
-               account_s *account_record = (account_s*)iter->data;
-               _account_free_account_items(account_record);
-               _ACCOUNT_FREE(account_record);
-       }
-
-       g_list_free(list);
-       list = NULL;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static char *_account_get_text(const char *text_data)
-{
-       char *text_value = NULL;
-
-       if (text_data != NULL) {
-               text_value = strdup(text_data);
-       }
-       return text_value;
-}
-
-//FIXME : add true singleton logic
-AccountManager *
-_account_manager_get_instance ()
-{
-       _INFO("_account_manager_get_instance");
-       if (_acc_mgr != NULL)
-       {
-               _INFO("instance already created.");
-               return _acc_mgr;
-       }
-
-#if !GLIB_CHECK_VERSION(2,35,0)
-       g_type_init();
-#endif
-
-       GDBusConnection *connection = NULL;
-       GError *error = NULL;
-
-       connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
-
-       _INFO("after g_bus_get_sync");
-
-
-       /* Create the object */
-       _acc_mgr =
-               account_manager_proxy_new_sync(connection,
-                                                                                G_DBUS_PROXY_FLAGS_NONE,
-                                                                                "org.tizen.account.manager",
-                                                                               "/org/tizen/account/manager",
-                                                                               NULL,
-                                                                                &error);
-       _INFO("_account_manager_get_instance end");
-       return _acc_mgr;
-}
-
-GDBusErrorEntry _account_svc_errors[] =
-{
-       {ACCOUNT_ERROR_NONE, _ACCOUNT_SVC_ERROR_PREFIX".NoError"},
-       {ACCOUNT_ERROR_OUT_OF_MEMORY, _ACCOUNT_SVC_ERROR_PREFIX".OutOfMemory"},
-       {ACCOUNT_ERROR_INVALID_PARAMETER, _ACCOUNT_SVC_ERROR_PREFIX".InvalidParameter"},
-       {ACCOUNT_ERROR_DUPLICATED, _ACCOUNT_SVC_ERROR_PREFIX".Duplicated"},
-       {ACCOUNT_ERROR_NO_DATA, _ACCOUNT_SVC_ERROR_PREFIX".NoData"},
-       {ACCOUNT_ERROR_RECORD_NOT_FOUND, _ACCOUNT_SVC_ERROR_PREFIX".RecordNotFound"},
-       {ACCOUNT_ERROR_DB_FAILED, _ACCOUNT_SVC_ERROR_PREFIX".DBFailed"},
-       {ACCOUNT_ERROR_DB_NOT_OPENED, _ACCOUNT_SVC_ERROR_PREFIX".DBNotOpened"},
-       {ACCOUNT_ERROR_QUERY_SYNTAX_ERROR, _ACCOUNT_SVC_ERROR_PREFIX".QuerySynTaxError"},
-       {ACCOUNT_ERROR_ITERATOR_END, _ACCOUNT_SVC_ERROR_PREFIX".IteratorEnd"},
-       {ACCOUNT_ERROR_NOTI_FAILED, _ACCOUNT_SVC_ERROR_PREFIX".NotiFalied"},
-       {ACCOUNT_ERROR_PERMISSION_DENIED, _ACCOUNT_SVC_ERROR_PREFIX".PermissionDenied"},
-       {ACCOUNT_ERROR_XML_PARSE_FAILED, _ACCOUNT_SVC_ERROR_PREFIX".XMLParseFailed"},
-       {ACCOUNT_ERROR_XML_FILE_NOT_FOUND, _ACCOUNT_SVC_ERROR_PREFIX".FileNotFound"},
-       {ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL, _ACCOUNT_SVC_ERROR_PREFIX".SubscriptionFailed"},
-       {ACCOUNT_ERROR_NOT_REGISTERED_PROVIDER, _ACCOUNT_SVC_ERROR_PREFIX".NotRegisteredProvider"},
-       {ACCOUNT_ERROR_NOT_ALLOW_MULTIPLE, _ACCOUNT_SVC_ERROR_PREFIX".NotAllowMultiple"},
-       {ACCOUNT_ERROR_DATABASE_BUSY, _ACCOUNT_SVC_ERROR_PREFIX".database_busy"},
-};
-
-static int _account_get_error_code(bool is_success, GError *error)
-{
-       if (!is_success)
-       {
-               _INFO("Received error Domain[%d] Message[%s] Code[%d]", error->domain, error->message, error->code);
-
-               if (g_dbus_error_is_remote_error(error))
-               {
-                       gchar *remote_error = g_dbus_error_get_remote_error(error);
-                       if (remote_error)
-                       {
-                               _INFO("Remote error[%s]", remote_error);
-
-                               //FIXME: Temp fix, error->code sent from daemon is not the same as the one received.
-                               //However error->message matches, so doing reverse lookup
-                               int error_enum_count = G_N_ELEMENTS(_account_svc_errors);
-                               int i = 0;
-                               for (i = 0; i < error_enum_count; i++)
-                               {
-                                       if (g_strcmp0(_account_svc_errors[i].dbus_error_name, remote_error) == 0)
-                                       {
-                                               _INFO("Remote error code matched[%d]", _account_svc_errors[i].error_code);
-                                               return _account_svc_errors[i].error_code;
-                                       }
-                               }
-                       }
-               }
-               //All undocumented errors mapped to ACCOUNT_ERROR_PERMISSION_DENIED
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_connect(void)
-{
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_connect_readonly(void)
-{
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_disconnect(void)
-{
-       return ACCOUNT_ERROR_NONE;
-}
-
-
-ACCOUNT_API int account_insert_to_db(account_h account, int *account_db_id)
-{
-       _INFO("1. account_insert_to_db start");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
-       ACCOUNT_RETURN_VAL((account_db_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT ID POINTER IS NULL"));
-
-       account_s *account_data = (account_s*) account;
-       int error_code = ACCOUNT_ERROR_NONE;
-       GError *error = NULL;
-
-       _INFO("2. Before _account_manager_get_instance()");
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       ACCOUNT_CATCH_ERROR((acc_mgr != NULL), {}, ACCOUNT_ERROR_PERMISSION_DENIED, "Failed to get dbus.");
-
-       int db_id = -1;
-       GVariant* account_serialized = marshal_account(account_data);
-
-       _INFO("3. Before account_manager_call_account_add_sync");
-       bool is_success = account_manager_call_account_add_sync(acc_mgr, account_db_path, account_serialized, &db_id, NULL, &error);
-       ACCOUNT_CATCH_ERROR((is_success != false), {}, _account_get_error_code(is_success, error), "Failed to get dbus.");
-
-       *account_db_id = db_id;
-       account_data->id = db_id;
-
-       _INFO("4. account_insert_to_db end, added db id [%d] [%d] [%d]", db_id, *account_db_id, account_data->id);
-
-       return ACCOUNT_ERROR_NONE;
-
-CATCH:
-       //Failed to get dbus.
-       _ERR("account_manager_call_account_add_sync()=[%d]", error_code);
-
-       return error_code;
-}
-
-ACCOUNT_API int account_delete_from_db_by_id(int account_db_id)
-{
-       _INFO("1. account_delete_from_db_by_id starting [%d]", account_db_id);
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((account_db_id > 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT ID IS LESS THAN ZERO."));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       _INFO("2. Before account_manager_call_account_query_account_by_account_id_sync");
-       GVariant *account_serialized_old = NULL;
-       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_db_path, account_db_id, &account_serialized_old, NULL, &error);
-
-       if (!is_success)
-       {
-               _ERR("account_manager_call_account_query_account_by_account_id_sync failed [%d]", error->code);
-               return _account_get_error_code(is_success, error);
-       }
-
-       _INFO("3. Before account_manager_call_account_delete_from_db_by_id_sync");
-       is_success = account_manager_call_account_delete_from_db_by_id_sync(acc_mgr, account_db_path, account_db_id, NULL, &error);
-
-       if (!is_success)
-       {
-               _ERR("account_manager_call_account_delete_from_db_by_id_sync failed [%d]", error->code);
-               return _account_get_error_code(is_success, error);
-       }
-
-       _INFO("4. Before account_delete_from_db_by_id end");
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_delete_from_db_by_user_name(char *user_name, char *package_name)
-{
-       _INFO("account_delete_from_db_by_user_name start");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((user_name != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("user_name is null!"));
-       ACCOUNT_RETURN_VAL((package_name != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("package_name is null!"));
-
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       GVariant* account_list_variant = NULL;
-       bool is_success = account_manager_call_account_query_account_by_user_name_sync(acc_mgr, account_db_path, user_name, &account_list_variant, NULL, &error);
-
-       int error_code = _account_get_error_code(is_success, error);
-       if (error_code != ACCOUNT_ERROR_NONE)
-       {
-               _ERR("account_query_account_by_user_name error=[%d]", error_code);
-               return error_code;
-       }
-
-       _INFO("before unmarshal_account_list");
-       GSList* account_list = unmarshal_account_list(account_list_variant);
-       _INFO("after unmarshal_account_list");
-       if (account_list == NULL)
-       {
-               return ACCOUNT_ERROR_NO_DATA;
-       }
-
-       //TODO free account_list, account_list_variant
-
-       is_success = account_manager_call_account_delete_from_db_by_user_name_sync(acc_mgr, account_db_path, user_name, package_name, NULL, &error);
-
-       if (!is_success)
-       {
-               _ERR("account_manager_call_account_delete_from_db_by_user_name_sync failed [%d]", error->code);
-               return _account_get_error_code(is_success, error);
-       }
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-int _account_delete_from_db_by_package_name(const char *package_name, bool permission)
-{
-       _INFO("_account_delete_from_db_by_package_name starting permission opions = %d", permission);
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((package_name != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("package_name is null!"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       //First get account list of user_name, used for gSSO DB deletion
-       GVariant* account_list_variant = NULL;
-       bool is_success = account_manager_call_account_query_account_by_package_name_sync(acc_mgr, account_db_path, package_name, &account_list_variant, NULL, &error);
-
-       int error_code = _account_get_error_code(is_success, error);
-       if (error_code != ACCOUNT_ERROR_NONE)
-       {
-               return error_code;
-       }
-
-       _INFO("before unmarshal_account_list");
-       GSList* account_list = unmarshal_account_list(account_list_variant);
-       _INFO("after unmarshal_account_list");
-       if (account_list == NULL)
-       {
-               return ACCOUNT_ERROR_NO_DATA;
-       }
-
-       is_success = account_manager_call_account_delete_from_db_by_package_name_sync(acc_mgr, account_db_path, package_name, permission, NULL, &error);
-
-       if (!is_success)
-       {
-               _ERR("account_manager_call_account_delete_from_db_by_package_name_sync failed [%d]", error->code);
-               return _account_get_error_code(is_success, error);
-       }
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_delete_from_db_by_package_name(const char *package_name)
-{
-       _INFO("account_delete_from_db_by_package_name starting with permission");
-       return _account_delete_from_db_by_package_name(package_name, true);
-}
-
-ACCOUNT_API int account_delete_from_db_by_package_name_without_permission(const char *package_name)
-{
-       _INFO("account_delete_from_db_by_package_name starting without permission");
-       return _account_delete_from_db_by_package_name(package_name, false);
-}
-
-ACCOUNT_API int account_update_to_db_by_id(account_h account, int account_id)
-{
-       //First we will update account db
-       _INFO("1. account_update_to_db_by_id start");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("DATA IS NULL"));
-       ACCOUNT_RETURN_VAL((account_id > 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("Account id is not valid"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       _INFO("2. Before account_manager_call_account_query_account_by_account_id_sync");
-       GVariant *account_serialized_old = NULL;
-       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_db_path, account_id, &account_serialized_old, NULL, &error);
-
-       if (!is_success)
-       {
-               _ERR("account_manager_call_account_query_account_by_account_id_sync failed [%d]", error->code);
-               return _account_get_error_code(is_success, error);
-       }
-
-       _INFO("3. Before account_manager_call_account_update_to_db_by_id_sync");
-       GVariant* account_serialized = marshal_account((account_s*) account);
-       is_success = account_manager_call_account_update_to_db_by_id_sync(acc_mgr, account_db_path, account_serialized, account_id, NULL, &error);
-
-       if (!is_success)
-       {
-               _ERR("account_manager_call_account_update_to_db_by_id_sync failed [%d]", error->code);
-               return _account_get_error_code(is_success, error);
-       }
-
-       _INFO("4. account_update_to_db_by_id end");
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_update_to_db_by_id_ex(account_h account, int account_id)
-{
-       int ret = -1;
-       ret = account_update_to_db_by_id(account, account_id);
-
-       return ret;
-}
-
-ACCOUNT_API int account_update_to_db_by_id_without_permission(account_h account, int account_id)
-{
-       //First we will update account db
-       //Then we will update gSSO DB, if it fails then we will rollback account db updates
-
-       _INFO("account_update_to_db_by_id_without_permission start");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("DATA IS NULL"));
-       ACCOUNT_RETURN_VAL((account_id > 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("Account id is not valid"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       GVariant *account_serialized_old = NULL;
-       _INFO("before query() account_id[%d]", account_id);
-       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_db_path, account_id, &account_serialized_old, NULL, &error);
-
-       if (!is_success)
-       {
-               _ERR("account_manager_call_account_query_account_by_account_id_sync failed [%d]", error->code);
-               return _account_get_error_code(is_success, error);
-       }
-
-       _INFO("before marshal() : account_id[%d], user_name=%s", account_id, ((account_s*)account)->user_name);
-       GVariant* account_serialized = marshal_account((account_s*) account);
-       _INFO("after marshal() : account_id[%d]", account_id);
-       if (account_serialized == NULL)
-       {
-               _ERR("Invalid input");
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       _INFO("before call update() : account_id[%d]", account_id);
-       is_success = account_manager_call_account_update_to_db_by_id_ex_sync(acc_mgr, account_db_path, account_serialized, account_id, NULL, &error);
-
-       _INFO("after call update() : is_success=%d", is_success);
-       if (!is_success)
-       {
-               _ERR("account_manager_call_account_update_to_db_by_id_ex_sync failed [%d]", error->code);
-               return _account_get_error_code(is_success, error);
-       }
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_update_to_db_by_user_name(account_h account, const char *user_name, const char *package_name)
-{
-       //First we will update account db
-       _INFO("account_update_to_db_by_user_name starting");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("DATA IS NULL"));
-       ACCOUNT_RETURN_VAL((user_name != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("USER NAME IS NULL"));
-       ACCOUNT_RETURN_VAL((package_name != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("PACKAGE NAME IS NULL"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       GVariant *account_serialized_old = NULL;
-       account_s *account_data = (account_s*) account;
-       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_db_path, account_data->id, &account_serialized_old, NULL, &error);
-
-       if (!is_success)
-       {
-               _ERR("account_manager_call_account_query_account_by_account_id_sync failed [%d]", error->code);
-               return _account_get_error_code(is_success, error);
-       }
-
-       GVariant* account_serialized = marshal_account(account_data);
-       is_success = account_manager_call_account_update_to_db_by_user_name_sync(acc_mgr, account_db_path, account_serialized, user_name, package_name, NULL, &error);
-
-       if (!is_success)
-       {
-               _ERR("account_manager_call_account_update_to_db_by_user_name_sync failed [%d]", error->code);
-               return _account_get_error_code(is_success, error);
-       }
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_create(account_h *account)
-{
-       if (!account) {
-               ACCOUNT_SLOGE("(%s)-(%d) account is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)malloc(sizeof(account_s));
-
-       if (data == NULL) {
-               ACCOUNT_FATAL("Memory Allocation Failed");
-               return ACCOUNT_ERROR_OUT_OF_MEMORY;
-       }
-       ACCOUNT_MEMSET(data, 0, sizeof(account_s));
-
-       /*Setting account as visible by default*/
-       data->secret = ACCOUNT_SECRECY_VISIBLE;
-
-       /*Setting account as not supporting sync by default*/
-       data->sync_support = ACCOUNT_SYNC_NOT_SUPPORT;
-
-       data->auth_type = ACCOUNT_AUTH_TYPE_INVALID;
-
-       data->account_list = NULL;
-       data->capablity_list = NULL;
-       data->custom_list = NULL;
-       data->domain_list = NULL;
-       data->mechanism_list = NULL;
-
-       *account = (account_h)data;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_destroy(account_h account)
-{
-       account_s *data = (account_s*)account;
-
-       ACCOUNT_RETURN_VAL((data != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("Account handle is null!"));
-
-       _account_free_account_items(data);
-       _ACCOUNT_FREE(data);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_set_user_name(account_h account, const char *user_name)
-{
-       if (!account) {
-               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!user_name) {
-               ACCOUNT_SLOGE("(%s)-(%d) user_name is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       _ACCOUNT_FREE(data->user_name);
-       data->user_name = _account_get_text(user_name);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_set_display_name(account_h account, const char *display_name)
-{
-       if (!account) {
-               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!display_name) {
-               ACCOUNT_SLOGE("(%s)-(%d) display_name is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       _ACCOUNT_FREE(data->display_name);
-       data->display_name = _account_get_text(display_name);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_set_email_address(account_h account, const char *email_address)
-{
-       if (!account) {
-               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!email_address) {
-               ACCOUNT_SLOGE("(%s)-(%d) email_address is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       _ACCOUNT_FREE(data->email_address);
-       data->email_address = _account_get_text(email_address);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_set_icon_path(account_h account, const char *icon_path)
-{
-       if (!account) {
-               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!icon_path) {
-               ACCOUNT_SLOGE("(%s)-(%d) icon_path is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       _ACCOUNT_FREE(data->icon_path);
-       data->icon_path = _account_get_text(icon_path);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_set_source(account_h account, const char *source)
-{
-       if (!account) {
-               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!source) {
-               ACCOUNT_SLOGE("(%s)-(%d) source is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-       account_s *data = (account_s*)account;
-
-       _ACCOUNT_FREE(data->source);
-       data->source = _account_get_text(source);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_set_package_name(account_h account, const char *package_name)
-{
-       if (!account) {
-               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!package_name) {
-               ACCOUNT_SLOGE("(%s)-(%d) package_name is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       _ACCOUNT_FREE(data->package_name);
-       data->package_name = _account_get_text(package_name);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_set_domain_name(account_h account, const char *domain_name)
-{
-       if (!account) {
-               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!domain_name) {
-               ACCOUNT_SLOGE("(%s)-(%d) domain_name is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-       account_s *data = (account_s*)account;
-
-       _ACCOUNT_FREE(data->domain_name);
-       data->domain_name = _account_get_text(domain_name);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_set_access_token(account_h account, const char *access_token)
-{
-       if (!account) {
-               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!access_token) {
-               ACCOUNT_SLOGE("(%s)-(%d) access_token is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       _ACCOUNT_FREE(data->access_token);
-       data->access_token = _account_get_text(access_token);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_set_user_text(account_h account, int idx, const char *user_txt)
-{
-       if (!account) {
-               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!user_txt) {
-               ACCOUNT_SLOGE("(%s)-(%d) user_txt is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-       if (idx >= USER_TXT_CNT || idx < 0) {
-               ACCOUNT_SLOGE("(%s)-(%d) idx rage should be between 0-4.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       _ACCOUNT_FREE(data->user_data_txt[idx]);
-       data->user_data_txt[idx] = _account_get_text(user_txt);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_set_custom(account_h account, const char* key, const char* value)
-{
-       if (!account) {
-               ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!key) {
-               ACCOUNT_SLOGE("(%s)-(%d) key is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!value) {
-               ACCOUNT_SLOGE("(%s)-(%d) value is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       GSList *iter;
-       bool b_is_new = TRUE;
-
-       for (iter = data->custom_list; iter != NULL; iter = g_slist_next(iter)) {
-
-               account_custom_s* custom_data = NULL;
-               custom_data = (account_custom_s*)iter->data;
-               ACCOUNT_SLOGD( "account_custom_s->key = %s, account_custom_s->value = %s \n", custom_data->key, custom_data->value);
-
-               if(!strcmp(custom_data->key, key)) {
-                       _ACCOUNT_FREE(custom_data->value);
-                       custom_data->value = _account_get_text(value);
-                       b_is_new = FALSE;
-               }
-       }
-
-       if(b_is_new) {
-               account_custom_s* custom_data = (account_custom_s*)malloc(sizeof(account_custom_s));
-
-               if (custom_data == NULL) {
-                       return ACCOUNT_ERROR_OUT_OF_MEMORY;
-               }
-               ACCOUNT_MEMSET(custom_data, 0, sizeof(account_custom_s));
-               custom_data->account_id = data->id;
-               custom_data->app_id = _account_get_text(data->package_name);
-               custom_data->key = _account_get_text(key);
-               custom_data->value = _account_get_text(value);
-               data->custom_list = g_slist_append(data->custom_list, (gpointer)custom_data);
-       }
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_set_auth_type(account_h account, const account_auth_type_e auth_type)
-{
-       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account handle is NULL.\n",  __FUNCTION__, __LINE__));
-
-       if ( ((int)auth_type < 0) || (auth_type > ACCOUNT_AUTH_TYPE_CLIENT_LOGIN)) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       data->auth_type = (int)auth_type;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_set_secret(account_h account, const account_secrecy_state_e secret)
-{
-       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account handle is NULL.\n",      __FUNCTION__, __LINE__));
-
-       if ( ((int)secret < 0) || (secret > ACCOUNT_SECRECY_VISIBLE)) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       data->secret = (int)secret;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_set_sync_support(account_h account, const account_sync_state_e sync_support)
-{
-       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account handle is NULL.\n",      __FUNCTION__, __LINE__));
-
-       if ( ((int)sync_support < 0) || (sync_support > ACCOUNT_SUPPORTS_SYNC)) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       data->sync_support= (int)sync_support;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_set_user_int(account_h account, int idx, const int user_int)
-{
-       if (!account) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (idx >= USER_INT_CNT ||idx < 0) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       data->user_data_int[idx] = user_int;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_set_capability(account_h account, const char* capability_type, account_capability_state_e capability_value)
-{
-       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("account handle is null"));
-       ACCOUNT_RETURN_VAL((capability_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_type is null"));
-
-       if ((capability_value != ACCOUNT_CAPABILITY_DISABLED) && (capability_value != ACCOUNT_CAPABILITY_ENABLED)) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       GSList *iter = NULL;
-       bool b_is_new = TRUE;
-
-       for(iter = data->capablity_list; iter != NULL; iter = g_slist_next(iter)) {
-               account_capability_s *cap_data = NULL;
-               cap_data = (account_capability_s*)iter->data;
-
-               if(!strcmp(cap_data->type, capability_type)) {
-                       cap_data->value = capability_value;
-                       b_is_new = FALSE;
-                       break;
-               }
-       }
-
-       if(b_is_new) {
-               account_capability_s* cap_data = (account_capability_s*)malloc(sizeof(account_capability_s));
-
-               if (cap_data == NULL)
-                       return ACCOUNT_ERROR_OUT_OF_MEMORY;
-               ACCOUNT_MEMSET(cap_data, 0, sizeof(account_capability_s));
-
-               cap_data->type = _account_get_text(capability_type);
-               cap_data->value = capability_value;
-               data->capablity_list = g_slist_append(data->capablity_list, (gpointer)cap_data);
-       }
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_user_name(account_h account, char **user_name)
-{
-       if (!account) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!user_name) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       (*user_name) = NULL;
-       *user_name = _account_get_text(data->user_name);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_display_name(account_h account, char **display_name)
-{
-       if (!account) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!display_name) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       (*display_name) = NULL;
-
-       *display_name = _account_get_text(data->display_name);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_email_address(account_h account,char **email_address)
-{
-       if (!account) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!email_address) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       (*email_address) = NULL;
-
-       *email_address = _account_get_text(data->email_address);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int  account_get_icon_path(account_h account, char **icon_path)
-{
-       if (!account) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!icon_path) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       (*icon_path) = NULL;
-
-       *icon_path = _account_get_text(data->icon_path);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_source(account_h account, char **source)
-{
-       if (!account) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!source) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       (*source) = NULL;
-
-       *source = _account_get_text(data->source);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_package_name(account_h account, char **package_name)
-{
-       if (!account) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!package_name) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       (*package_name) = NULL;
-
-       *package_name = _account_get_text(data->package_name);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_domain_name(account_h account, char **domain_name)
-{
-       if (!account) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!domain_name) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       (*domain_name) = NULL;
-
-       *domain_name = _account_get_text(data->domain_name);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_access_token(account_h account, char **access_token)
-{
-       if (!account) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!access_token) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       (*access_token) = NULL;
-
-       *access_token = _account_get_text(data->access_token);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_user_text(account_h account, int user_text_index, char **text)
-{
-       if (!account) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!text) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-       ACCOUNT_RETURN_VAL((user_text_index >=0 && user_text_index < USER_TXT_CNT ), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("INVALID USER TEXT INDEX"));
-
-       account_s *data = (account_s*)account;
-
-       (*text) = NULL;
-
-       *text = _account_get_text(data->user_data_txt[user_text_index]);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_auth_type(account_h account, account_auth_type_e *auth_type)
-{
-       if (!account) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-       if (!auth_type) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s* data = (account_s*)account;
-
-       *auth_type = data->auth_type;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_secret(account_h account, account_secrecy_state_e *secret)
-{
-       if (!account) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-       if (!secret) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s* data = (account_s*)account;
-
-       *secret = data->secret;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_sync_support(account_h account, account_sync_state_e *sync_support)
-{
-       if (!account) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-       if (!sync_support) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s* data = (account_s*)account;
-
-       *sync_support = data->sync_support;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_account_id(account_h account, int *account_id)
-{
-       if (!account) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-       if (!account_id) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       *account_id = data->id;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_user_int(account_h account, int user_int_index, int *integer)
-{
-       if (!account) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       ACCOUNT_RETURN_VAL((user_int_index >=0 && user_int_index < USER_TXT_CNT ), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("INVALID USER TEXT INDEX"));
-
-       if (!integer) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_s *data = (account_s*)account;
-
-       *integer = data->user_data_int[user_int_index];
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_capability(account_h account, const char* capability_type, account_capability_state_e* capability_value)
-{
-       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
-       ACCOUNT_RETURN_VAL((capability_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_type is NULL"));
-       ACCOUNT_RETURN_VAL((capability_value != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_value is NULL"));
-
-       GSList *iter;
-       account_s *data = (account_s*)account;
-
-       _ERR("before for()");
-       for (iter = data->capablity_list; iter != NULL; iter = g_slist_next(iter)) {
-               account_capability_s *cap_data = NULL;
-
-               cap_data = (account_capability_s*)iter->data;
-
-       _ERR("capability_type = %s, data->type = %s", capability_type, cap_data->type);
-       _ERR("capability_value = %d, data->value= %d", capability_value, cap_data->value);
-               if(!strcmp(capability_type, cap_data->type)) {
-                       *capability_value = cap_data->value;
-                       return ACCOUNT_ERROR_NONE;
-               }
-       }
-       _ERR("after for()");
-
-       return ACCOUNT_ERROR_RECORD_NOT_FOUND;
-}
-
-ACCOUNT_API int account_get_capability_all(account_h account, capability_cb callback, void *user_data)
-{
-       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
-       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO CALLBACK FUNCTION"));
-
-       GSList *iter;
-       account_s *data = (account_s*)account;
-
-       for (iter = data->capablity_list; iter != NULL; iter = g_slist_next(iter)) {
-               account_capability_s *cap_data = NULL;
-
-               cap_data = (account_capability_s*)iter->data;
-
-               if(callback(cap_data->type, cap_data->value, user_data)!=TRUE){
-                       return ACCOUNT_ERROR_NONE;
-               }
-       }
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_custom(account_h account, const char* key, char** value)
-{
-       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
-       ACCOUNT_RETURN_VAL((key != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO KEY TO REQUEST"));
-       ACCOUNT_RETURN_VAL((value != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("VALUE POINTER IS NULL"));
-
-       GSList *iter;
-       account_s *data = (account_s*)account;
-
-       _ERR("before for()");
-       for (iter = data->custom_list; iter != NULL; iter = g_slist_next(iter)) {
-               account_custom_s *custom_data = NULL;
-
-               custom_data = (account_custom_s*)iter->data;
-
-               _ERR("key = %s, custom_data->key = %s", key, custom_data->key);
-               _ERR("value = %s, custom_data->value = %s", value, custom_data->value);
-
-               if(!strcmp(key, custom_data->key)) {
-                       (*value) = NULL;
-                       *value = _account_get_text(custom_data->value);
-                       return ACCOUNT_ERROR_NONE;
-               }
-       }
-       _ERR("after for()");
-
-       return ACCOUNT_ERROR_RECORD_NOT_FOUND;
-}
-
-ACCOUNT_API int account_get_custom_all(account_h account, account_custom_cb callback, void* user_data)
-{
-       ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
-       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO CALLBACK FUNCTION"));
-
-       GSList *iter;
-       account_s *data = (account_s*)account;
-
-       for (iter = data->custom_list; iter != NULL; iter = g_slist_next(iter)) {
-               bool cb_ret = FALSE;
-               account_custom_s *custom_data = NULL;
-
-               custom_data = (account_custom_s*)iter->data;
-
-               cb_ret = callback(custom_data->key, custom_data->value, user_data);
-               if(!cb_ret) {
-                       break;
-               }
-       }
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_foreach_account_from_db(account_cb callback, void *user_data)
-{
-       _INFO("account_type_foreach_account_type_from_db start");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT Callback IS NULL"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       GVariant* account_list_variant = NULL;
-       bool is_success = account_manager_call_account_query_all_sync(acc_mgr, account_db_path, &account_list_variant, NULL, &error);
-
-       int error_code = _account_get_error_code(is_success, error);
-       if (error_code != ACCOUNT_ERROR_NONE)
-       {
-               return error_code;
-       }
-
-       _INFO("before unmarshal_account_list");
-       GSList* account_list = unmarshal_account_list(account_list_variant);
-       _INFO("after unmarshal_account_list");
-       GSList* iter;
-
-       for (iter = account_list; iter != NULL; iter = g_slist_next(iter))
-       {
-               _INFO("iterating received account_list");
-               account_s *account = NULL;
-               account = (account_s*)iter->data;
-               _INFO("Before _account_query_identity_info_by_id");
-
-               _INFO("account->id=%d", account->id);
-               if (callback((account_h)account, user_data) == false)
-               {
-                       _INFO("application callback requested to discontinue.");
-                       break;
-               }
-               _INFO("After one iteration callback");
-       }
-       _INFO("account_foreach_account_from_db end");
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_query_account_by_account_id(int account_db_id, account_h *account)
-{
-       _INFO("account_query_account_by_account_id start [%d]", account_db_id);
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((account_db_id > 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT INDEX IS LESS THAN 0"));
-       ACCOUNT_RETURN_VAL((*account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT IS NULL"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       GVariant* account_variant = NULL;
-       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_db_path, account_db_id, &account_variant, NULL, &error);
-
-       int error_code = _account_get_error_code(is_success, error);
-       if (error_code != ACCOUNT_ERROR_NONE)
-       {
-               return error_code;
-       }
-
-       _INFO("before unmarshal_account");
-       account_s* account_data = umarshal_account(account_variant);
-       _INFO("after unmarshal_account");
-
-       if (account_data == NULL)
-       {
-               _ERR("Failed to unmarshal");
-               return ACCOUNT_ERROR_DB_FAILED;
-       }
-
-       *account = (account_h) account_data;
-
-       _INFO("account_query_account_by_account_id end");
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_query_account_by_user_name(account_cb callback, const char* user_name, void* user_data)
-{
-       _INFO("account_query_account_by_user_name starting");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((user_name != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("USER NAME IS NULL"));
-       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("CALL BACK IS NULL"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       GVariant* account_list_variant = NULL;
-       bool is_success = account_manager_call_account_query_account_by_user_name_sync(acc_mgr, account_db_path, user_name, &account_list_variant, NULL, &error);
-
-       int error_code = _account_get_error_code(is_success, error);
-       if (error_code != ACCOUNT_ERROR_NONE)
-       {
-               return error_code;
-       }
-
-       _INFO("before unmarshal_account_list");
-       GSList* account_list = unmarshal_account_list(account_list_variant);
-       _INFO("after unmarshal_account_list");
-       if (account_list == NULL)
-       {
-               return ACCOUNT_ERROR_NO_DATA;
-       }
-
-       GSList* iter;
-
-       for (iter = account_list; iter != NULL; iter = g_slist_next(iter))
-       {
-               _INFO("iterating received account_list");
-               account_s *account = NULL;
-               account = (account_s*)iter->data;
-               if (callback((account_h)account, user_data) == false)
-               {
-                       _INFO("application callback requested to discontinue.");
-                       break;
-               }
-       }
-       _INFO("account_query_account_by_user_name end");
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_query_account_by_package_name(account_cb callback, const char *package_name, void *user_data)
-{
-       _INFO("account_query_account_by_package_name starting");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((package_name != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("PACKAGE NAME IS NULL"));
-       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("CALL BACK IS NULL"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       GVariant* account_list_variant = NULL;
-       bool is_success = account_manager_call_account_query_account_by_package_name_sync(acc_mgr, account_db_path, package_name, &account_list_variant, NULL, &error);
-
-       int error_code = _account_get_error_code(is_success, error);
-       if (error_code != ACCOUNT_ERROR_NONE)
-       {
-               return error_code;
-       }
-
-       _INFO("before unmarshal_account_list");
-       GSList* account_list = unmarshal_account_list(account_list_variant);
-       _INFO("after unmarshal_account_list");
-       if (account_list == NULL)
-       {
-               return ACCOUNT_ERROR_NO_DATA;
-       }
-
-       GSList* iter;
-
-       for (iter = account_list; iter != NULL; iter = g_slist_next(iter))
-       {
-               _INFO("iterating received account_list");
-               account_s *account = NULL;
-               account = (account_s*)iter->data;
-
-               if (callback((account_h)account, user_data) == false)
-               {
-                       _INFO("application callback requested to discontinue.");
-                       break;
-               }
-       }
-       _INFO("account_query_account_by_package_name end");
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_query_account_by_capability(account_cb callback, const char* capability_type, account_capability_state_e capability_value, void *user_data)
-{
-       _INFO("account_query_account_by_capability starting");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((capability_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_type IS NULL"));
-
-       if (((int)capability_value  < 0) || (capability_value > ACCOUNT_CAPABILITY_ENABLED)) {
-               ACCOUNT_SLOGE("(%s)-(%d) capability_value is not equal to 0 or 1.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("CALL BACK IS NULL"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       GVariant* account_list_variant = NULL;
-       bool is_success = account_manager_call_account_query_account_by_capability_sync(acc_mgr, account_db_path, capability_type, capability_value, &account_list_variant, NULL, &error);
-
-       int error_code = _account_get_error_code(is_success, error);
-       if (error_code != ACCOUNT_ERROR_NONE)
-       {
-               return error_code;
-       }
-
-       _INFO("before unmarshal_account_list");
-       GSList* account_list = unmarshal_account_list(account_list_variant);
-       _INFO("after unmarshal_account_list");
-       if (account_list == NULL)
-       {
-               return ACCOUNT_ERROR_NO_DATA;
-       }
-
-       GSList* iter;
-
-       for (iter = account_list; iter != NULL; iter = g_slist_next(iter))
-       {
-               _INFO("iterating received account_list");
-               account_s *account = NULL;
-               account = (account_s*)iter->data;
-
-               if (callback((account_h)account, user_data) == false)
-               {
-                       _INFO("application callback requested to discontinue.");
-                       break;
-               }
-       }
-       _INFO("account_query_account_by_capability end");
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_query_account_by_capability_type(account_cb callback, const char* capability_type, void* user_data)
-{
-       _INFO("account_query_account_by_capability_type starting");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((capability_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_type IS NULL"));
-       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("CALL BACK IS NULL"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       GVariant* account_list_variant = NULL;
-       bool is_success = account_manager_call_account_query_account_by_capability_type_sync(acc_mgr, account_db_path, capability_type, &account_list_variant, NULL, &error);
-
-       int error_code = _account_get_error_code(is_success, error);
-       if (error_code != ACCOUNT_ERROR_NONE)
-       {
-               return error_code;
-       }
-
-       _INFO("before unmarshal_account_list");
-       GSList* account_list = unmarshal_account_list(account_list_variant);
-       _INFO("after unmarshal_account_list");
-       if (account_list == NULL)
-       {
-               return ACCOUNT_ERROR_NO_DATA;
-       }
-
-       GSList* iter;
-
-       for (iter = account_list; iter != NULL; iter = g_slist_next(iter))
-       {
-               _INFO("iterating received account_list");
-               account_s *account = NULL;
-               account = (account_s*)iter->data;
-
-               if (callback((account_h)account, user_data) == false)
-               {
-                       _INFO("application callback requested to discontinue.");
-                       break;
-               }
-       }
-       _INFO("account_query_account_by_capability end");
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_query_capability_by_account_id(capability_cb callback, int account_id, void *user_data)
-{
-       _INFO("account_query_capability_by_account_id starting");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((account_id > 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT INDEX IS LESS THAN 0"));
-       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO CALLBACK FUNCTION"));
-
-       GError *error = NULL;
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       GVariant* capability_list_variant = NULL;
-       bool is_success = account_manager_call_account_query_capability_by_account_id_sync(acc_mgr, account_db_path, account_id, &capability_list_variant, NULL, &error);
-
-       int error_code = _account_get_error_code(is_success, error);
-       if (error_code != ACCOUNT_ERROR_NONE)
-       {
-               return error_code;
-       }
-
-       _INFO("before unmarshal_capability_list");
-       GSList* capability_list = unmarshal_capability_list(capability_list_variant);
-       _INFO("after unmarshal_capability_list");
-       if (capability_list == NULL)
-       {
-               return ACCOUNT_ERROR_NO_DATA;
-       }
-
-       GSList* iter;
-
-       for (iter = capability_list; iter != NULL; iter = g_slist_next(iter))
-       {
-               _INFO("iterating received account_list");
-               account_capability_s *capability = NULL;
-               capability = (account_capability_s*)iter->data;
-               _INFO("");
-               if (callback(capability->type, capability->value, user_data) == false)
-               {
-                       _INFO("application callback requested to discontinue.");
-                       break;
-               }
-               _INFO("");
-       }
-       _INFO("account_query_capability_by_account_id end");
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_get_total_count(int *count, bool include_hidden)
-{
-       _INFO("account_get_total_count_from_db starting");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       if (!count)
-       {
-               ACCOUNT_SLOGE("(%s)-(%d) count is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       GError *error = NULL;
-
-       if (count == NULL)
-       {
-               _INFO("Invalid input");
-               return -1;
-       }
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       int temp_count = -1;
-       bool is_success = account_manager_call_account_get_total_count_from_db_sync(acc_mgr, account_db_path, include_hidden, &temp_count, NULL, &error);
-       int error_code = _account_get_error_code(is_success, error);
-       if (error_code != ACCOUNT_ERROR_NONE)
-       {
-               return error_code;
-       }
-
-       *count = temp_count;
-       _INFO("account_get_total_count_from_db end");
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_total_count_from_db(int *count)
-{
-       _INFO("account_get_total_count_from_db starting");
-
-       return _account_get_total_count(count, true);
-}
-
-ACCOUNT_API int account_get_total_count_from_db_ex(int *count)
-{
-       _INFO("account_get_total_count_from_db_ex starting");
-
-       return _account_get_total_count(count, false);
-}
-
-ACCOUNT_API int account_update_sync_status_by_id(int account_db_id, const account_sync_state_e sync_status)
-{
-       _INFO("account_update_sync_status_by_id starting");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((account_db_id > 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT INDEX IS LESS THAN 0"));
-       if ( ((int)sync_status < 0) || (sync_status > ACCOUNT_SYNC_STATUS_RUNNING)) {
-               ACCOUNT_SLOGE("(%s)-(%d) sync_status is less than 0 or more than enum max.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       bool is_success = account_manager_call_account_update_sync_status_by_id_sync(acc_mgr, account_db_path, account_db_id, sync_status, NULL, &error);
-
-       return _account_get_error_code(is_success, error);
-}
-
-static int _account_type_free_label_items(label_s *data)
-{
-       _ACCOUNT_FREE(data->app_id);
-       _ACCOUNT_FREE(data->label);
-       _ACCOUNT_FREE(data->locale);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_type_gslist_free(GSList* list)
-{
-       ACCOUNT_RETURN_VAL((list != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("GSlist is NULL"));
-
-       GSList* iter;
-
-       for (iter = list; iter != NULL; iter = g_slist_next(iter)) {
-               label_s *label_data = (label_s*)iter->data;
-               _account_type_free_label_items(label_data);
-               _ACCOUNT_FREE(label_data);
-       }
-
-       g_slist_free(list);
-       list = NULL;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_type_item_free(account_type_s *data)
-{
-       _ACCOUNT_FREE(data->app_id);
-       _ACCOUNT_FREE(data->service_provider_id);
-       _ACCOUNT_FREE(data->icon_path);
-       _ACCOUNT_FREE(data->small_icon_path);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_type_glist_free(GList* list)
-{
-       ACCOUNT_RETURN_VAL((list != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("Glist is NULL"));
-
-       GList* iter;
-
-       for (iter = list; iter != NULL; iter = g_list_next(iter)) {
-               account_type_s *account_type_record = (account_type_s*)iter->data;
-               _account_type_item_free(account_type_record);
-               _ACCOUNT_FREE(account_type_record);
-       }
-
-       g_list_free(list);
-       list = NULL;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static int _account_type_free_account_type_items(account_type_s *data)
-{
-       _account_type_item_free(data);
-
-       _account_type_gslist_free(data->label_list);
-       _account_type_glist_free(data->account_type_list);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_create(account_type_h *account_type)
-{
-       if (!account_type) {
-               ACCOUNT_SLOGE("(%s)-(%d) account type handle is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_type_s *data = (account_type_s*)malloc(sizeof(account_type_s));
-
-       if (data == NULL)
-       {
-               ACCOUNT_ERROR("Memory Allocation Failed");
-               return ACCOUNT_ERROR_OUT_OF_MEMORY;
-       }
-
-       ACCOUNT_MEMSET(data, 0, sizeof(account_type_s));
-
-       data->id = -1;
-       data->app_id = NULL;
-       data->service_provider_id = NULL;
-       data->icon_path = NULL;
-       data->small_icon_path = NULL;
-       data->multiple_account_support = false;
-       data->label_list = NULL;
-       data->account_type_list = NULL;
-       data->provider_feature_list = NULL;
-
-       *account_type = (account_type_h)data;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_destroy(account_type_h account_type)
-{
-       _INFO("account_type_destroy");
-
-       account_type_s *data = (account_type_s*)account_type;
-
-       if (data == NULL)
-       {
-               _ERR("Account type handle is null!");
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       _account_type_free_account_type_items(data);
-       _ACCOUNT_FREE(data);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_set_app_id(account_type_h account_type, const char *app_id)
-{
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_set_app_id_internal(account_type_h account_type, const char *app_id)
-{
-       if (!account_type) {
-               ACCOUNT_SLOGE("(%s)-(%d) account_type handle is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!app_id) {
-               ACCOUNT_SLOGE("(%s)-(%d) app_id is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_type_s *data = (account_type_s*)account_type;
-
-       _ACCOUNT_FREE(data->app_id);
-       data->app_id = _account_get_text(app_id);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_set_service_provider_id(account_type_h account_type, const char *service_provider_id)
-{
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_set_service_provider_id_internal(account_type_h account_type, const char *service_provider_id)
-{
-       if (!account_type) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!service_provider_id) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_type_s *data = (account_type_s*)account_type;
-
-       _ACCOUNT_FREE(data->service_provider_id);
-       data->service_provider_id = _account_get_text(service_provider_id);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_set_icon_path(account_type_h account_type, const char *icon_path)
-{
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_set_icon_path_internal(account_type_h account_type, const char *icon_path)
-{
-       if (!account_type) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!icon_path) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_type_s *data = (account_type_s*)account_type;
-
-       _ACCOUNT_FREE(data->icon_path);
-       data->icon_path = _account_get_text(icon_path);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_set_small_icon_path(account_type_h account_type, const char *small_icon_path)
-{
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_set_small_icon_path_internal(account_type_h account_type, const char *small_icon_path)
-{
-       if (!account_type) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!small_icon_path) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_type_s *data = (account_type_s*)account_type;
-
-       _ACCOUNT_FREE(data->small_icon_path);
-       data->small_icon_path = _account_get_text(small_icon_path);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_set_multiple_account_support(account_type_h account_type, const bool multiple_account_support)
-{
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_set_multiple_account_support_internal(account_type_h account_type, const bool multiple_account_support)
-{
-       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account handle is NULL.\n",  __FUNCTION__, __LINE__));
-
-       account_type_s *data = (account_type_s*)account_type;
-
-       data->multiple_account_support = multiple_account_support;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_set_label(account_type_h account_type, const char* label, const char* locale)
-{
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_set_label_internal(account_type_h account_type, const char* label, const char* locale)
-{
-       if (!account_type) {
-               ACCOUNT_SLOGE("(%s)-(%d) account_type handle is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if(!label || !locale) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_type_s *data = (account_type_s*)account_type;
-       label_s *label_data = (label_s*)malloc(sizeof(label_s));
-
-       if (label_data == NULL) {
-               return ACCOUNT_ERROR_OUT_OF_MEMORY;
-       }
-       ACCOUNT_MEMSET(label_data, 0, sizeof(label_s));
-
-       label_data->label = _account_get_text(label);
-       label_data->locale = _account_get_text(locale);
-
-       data->label_list = g_slist_append(data->label_list, (gpointer)label_data);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_set_provider_feature(account_type_h account_type, const char* provider_feature)
-{
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_set_provider_feature_internal(account_type_h account_type, const char* provider_feature)
-{
-       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("account type handle is null"));
-       ACCOUNT_RETURN_VAL((provider_feature != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("provider_feature is null"));
-
-       account_type_s *data = (account_type_s*)account_type;
-
-       GSList *iter = NULL;
-       bool b_is_new = TRUE;
-
-       for(iter = data->provider_feature_list; iter != NULL; iter = g_slist_next(iter)) {
-               provider_feature_s *feature_data = NULL;
-               feature_data = (provider_feature_s*)iter->data;
-
-               if(!strcmp(feature_data->key, provider_feature)) {
-                       b_is_new = FALSE;
-                       break;
-               }
-       }
-
-       if(b_is_new) {
-               provider_feature_s* feature_data = (provider_feature_s*)malloc(sizeof(provider_feature_s));
-
-               if (feature_data == NULL)
-                       return ACCOUNT_ERROR_OUT_OF_MEMORY;
-               ACCOUNT_MEMSET(feature_data, 0, sizeof(provider_feature_s));
-
-               feature_data->key = _account_get_text(provider_feature);
-               data->provider_feature_list = g_slist_append(data->provider_feature_list, (gpointer)feature_data);
-       }
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_query_provider_feature_by_app_id(provider_feature_cb callback, const char* app_id, void *user_data )
-{
-       _INFO("account_type_query_provider_feature_by_app_id start");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((app_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
-       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO CALLBACK FUNCTION"));
-
-       GError *error = NULL;
-       gint error_code = ACCOUNT_ERROR_NONE;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       GVariant* feature_list_variant = NULL;
-       bool is_success = account_manager_call_account_type_query_provider_feature_by_app_id_sync(acc_mgr, account_db_path, app_id, &feature_list_variant, NULL, &error);
-
-       _INFO("account_manager_call_account_type_query_provider_feature_by_app_id_sync end=[%d]", is_success);
-
-       if (!is_success)
-       {
-               error_code = error->code;
-               _ERR("Account IPC call returned error[%d]", error_code);
-               return error_code;
-       }
-
-       GSList* provider_feature_list = variant_to_provider_feature_list(feature_list_variant);
-       if (provider_feature_list == NULL)
-       {
-               error_code = ACCOUNT_ERROR_NO_DATA;
-               _ERR("[%d]", error_code);
-               return error_code;
-       }
-
-       GSList *iter;
-       for (iter = provider_feature_list; iter != NULL; iter = g_slist_next(iter)) {
-               provider_feature_s *feature_data = NULL;
-
-               feature_data = (provider_feature_s*)iter->data;
-
-               if(callback(feature_data->app_id, feature_data->key, user_data)!=TRUE) {
-                       ACCOUNT_DEBUG("Callback func returs FALSE, its iteration is stopped!!!!\n");
-                       return ACCOUNT_ERROR_NONE;
-               }
-       }
-
-       _INFO("account_type_query_provider_feature_by_app_id end");
-       return error_code;
-}
-
-ACCOUNT_API bool account_type_query_supported_feature(const char* app_id, const char* capability)
-{
-       _INFO("account_type_query_supported_feature start");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       if (app_id == NULL || capability == NULL)
-       {
-               set_last_result(ACCOUNT_ERROR_INVALID_PARAMETER);
-               return false;
-       }
-
-       int is_supported = 0;
-       GError *error = NULL;
-       gint ret = ACCOUNT_ERROR_NONE;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               set_last_result(ACCOUNT_ERROR_PERMISSION_DENIED);
-               return false;
-       }
-
-       bool is_success = account_manager_call_account_type_query_supported_feature_sync(acc_mgr, account_db_path, app_id, capability, &is_supported, NULL, &error);
-
-       _INFO("account_manager_call_account_type_query_supported_feature_sync end=[%d]", is_success);
-
-       if (!is_success)
-       {
-               ret = error->code;
-               _ERR("Account IPC call returned error[%d]", ret);
-               set_last_result(ret);
-               return false;
-       }
-
-       set_last_result(ACCOUNT_ERROR_NONE);
-       _INFO("account_type_query_supported_feature end");
-       return is_supported;
-}
-
-ACCOUNT_API int account_type_get_app_id(account_type_h account_type, char **app_id)
-{
-       if (!account_type) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!app_id) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_type_s *data = (account_type_s*)account_type;
-
-       (*app_id) = NULL;
-       *app_id = _account_get_text(data->app_id);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_get_service_provider_id(account_type_h account_type, char **service_provider_id)
-{
-       if (!account_type) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!service_provider_id) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_type_s *data = (account_type_s*)account_type;
-
-       (*service_provider_id) = NULL;
-       *service_provider_id = _account_get_text(data->service_provider_id);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_get_icon_path(account_type_h account_type, char **icon_path)
-{
-       if (!account_type) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!icon_path) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_type_s *data = (account_type_s*)account_type;
-
-       (*icon_path) = NULL;
-       *icon_path = _account_get_text(data->icon_path);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_get_small_icon_path(account_type_h account_type, char **small_icon_path)
-{
-       if (!account_type) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       if (!small_icon_path) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_type_s *data = (account_type_s*)account_type;
-
-       (*small_icon_path) = NULL;
-       *small_icon_path = _account_get_text(data->small_icon_path);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_get_multiple_account_support(account_type_h account_type, int *multiple_account_support)
-{
-       if (!account_type) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-       if (!multiple_account_support) {
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_type_s *data = (account_type_s*)account_type;
-
-       *multiple_account_support = data->multiple_account_support;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_get_provider_feature_all(account_type_h account_type, provider_feature_cb callback, void* user_data)
-{
-       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
-       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO CALLBACK FUNCTION"));
-
-       GSList *iter;
-       account_type_s *data = (account_type_s*)account_type;
-
-       for (iter = data->provider_feature_list; iter != NULL; iter = g_slist_next(iter)) {
-               provider_feature_s *feature_data = NULL;
-
-               feature_data = (provider_feature_s*)iter->data;
-
-               if(callback(feature_data->app_id, feature_data->key, user_data)!=TRUE) {
-                       ACCOUNT_DEBUG("Callback func returs FALSE, its iteration is stopped!!!!\n");
-                       return ACCOUNT_ERROR_NONE;
-               }
-       }
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_get_label_by_locale(account_type_h account_type, const char* locale, char** label)
-{
-       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
-       ACCOUNT_RETURN_VAL((label != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("INVALID PARAMETER"));
-
-       GSList *iter;
-       account_type_s *data = (account_type_s*)account_type;
-
-       for (iter = data->label_list; iter != NULL; iter = g_slist_next(iter)) {
-               label_s *label_data = NULL;
-
-               label_data = (label_s*)iter->data;
-
-               *label = NULL;
-
-               if(!strcmp(locale, label_data->locale)) {
-                       *label = _account_get_text(label_data->label);
-                       return ACCOUNT_ERROR_NONE;
-               }
-               gchar** tokens = g_strsplit(locale, "-", 2);
-               if(tokens != NULL) {
-                       if((char*)(tokens[1]) != NULL) {
-                               char* upper_token = g_ascii_strup(tokens[1], strlen(tokens[1]));
-                               if(upper_token != NULL) {
-                                       char* converted_locale = g_strdup_printf("%s_%s", tokens[0], upper_token);
-                                       if(!strcmp(converted_locale, label_data->locale)) {
-                                               _ACCOUNT_FREE(converted_locale);
-                                               _ACCOUNT_FREE(upper_token);
-                                               g_strfreev(tokens);
-                                               *label = _account_get_text(label_data->label);
-                                               return ACCOUNT_ERROR_NONE;
-                                       }
-                                       _ACCOUNT_FREE(converted_locale);
-                               }
-                               _ACCOUNT_FREE(upper_token);
-                       }
-               }
-               g_strfreev(tokens);
-       }
-
-       return ACCOUNT_ERROR_RECORD_NOT_FOUND;
-}
-
-ACCOUNT_API int account_type_get_label(account_type_h account_type, account_label_cb callback, void *user_data)
-{
-       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
-       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO CALLBACK FUNCTION"));
-
-       GSList *iter;
-       account_type_s *data = (account_type_s*)account_type;
-
-       for (iter = data->label_list; iter != NULL; iter = g_slist_next(iter)) {
-               label_s *label_data = NULL;
-
-               label_data = (label_s*)iter->data;
-
-               if(callback(label_data->app_id, label_data->label, label_data->locale, user_data)!=TRUE) {
-                       ACCOUNT_DEBUG("Callback func returs FALSE, its iteration is stopped!!!!\n");
-                       return ACCOUNT_ERROR_NONE;
-               }
-       }
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_insert_to_db(account_type_h account_type, int* account_type_id)
-{
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_insert_to_db_internal(account_type_h account_type, int* account_type_id)
-{
-       _INFO("account_type_insert_to_db starting");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT TYPE HANDLE IS NULL"));
-       ACCOUNT_RETURN_VAL((account_type_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT TYPE ID POINTER IS NULL"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       int db_id = -1;
-       GVariant* account_type_serialized = marshal_account_type((account_type_s*) account_type);
-       bool is_success = account_manager_call_account_type_add_sync(acc_mgr, account_db_path, account_type_serialized, &db_id, NULL, &error);
-
-       int ret = _account_get_error_code(is_success, error);
-       if (ret != ACCOUNT_ERROR_NONE)
-       {
-               return ret;
-       }
-
-       _INFO("account_type_insert_to_db end id=[%d]", db_id);
-
-       *account_type_id = db_id;
-
-       account_type_s* account_type_data = (account_type_s*)account_type;
-       account_type_data->id = db_id;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_update_to_db_by_app_id(const account_type_h account_type, const char* app_id)
-{
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_update_to_db_by_app_id_internal(const account_type_h account_type, const char* app_id)
-{
-       _INFO("account_type_update_to_db_by_app_id starting");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("DATA IS NULL"));
-       ACCOUNT_RETURN_VAL((app_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       GVariant* account_type_variant = marshal_account_type((account_type_s*) account_type);
-       if (account_type_variant == NULL)
-       {
-               _ERR("Failed to serialize");
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       bool is_success = account_manager_call_account_type_update_to_db_by_app_id_sync(acc_mgr, account_db_path, account_type_variant, app_id, NULL, &error);
-
-       return _account_get_error_code(is_success, error);
-}
-
-ACCOUNT_API int account_type_delete_by_app_id(const char* app_id)
-{
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_delete_by_app_id_internal(const char* app_id)
-{
-       _INFO("account_type_delete_by_app_id starting");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((app_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       bool is_success = account_manager_call_account_type_delete_by_app_id_sync(acc_mgr, account_db_path, app_id, NULL, &error);
-
-       return _account_get_error_code(is_success, error);
-}
-
-ACCOUNT_API int account_type_query_label_by_app_id(account_label_cb callback, const char* app_id, void *user_data )
-{
-       _INFO("account_type_query_label_by_app_id starting");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT Callback IS NULL"));
-       ACCOUNT_RETURN_VAL((app_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       GVariant* label_list_variant = NULL;
-       bool is_success = account_manager_call_account_type_query_label_by_app_id_sync(acc_mgr, account_db_path, app_id, &label_list_variant, NULL, &error);
-
-       int ret = _account_get_error_code(is_success, error);
-       if (ret != ACCOUNT_ERROR_NONE)
-       {
-               return ret;
-       }
-
-       _INFO("before variant_to_label_list");
-       GSList* label_list = variant_to_label_list (label_list_variant);
-       _INFO("after variant_to_label_list");
-       if (label_list == NULL)
-       {
-               return ACCOUNT_ERROR_NO_DATA;
-       }
-
-       GSList* iter;
-
-       for (iter = label_list; iter != NULL; iter = g_slist_next(iter))
-       {
-               _INFO("iterating received account_list");
-               label_s *label_record = NULL;
-               label_record = (label_s*)iter->data;
-               _INFO("");
-               if (callback(label_record->app_id, label_record->label, label_record->locale, user_data) == false)
-               {
-                       _INFO("application callback requested to discontinue.");
-                       break;
-               }
-               _INFO("");
-       }
-       _INFO("account_type_query_label_by_app_id end");
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_query_by_app_id(const char* app_id, account_type_h *account_type)
-{
-       _INFO("account_type_query_by_app_id starting");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((app_id != 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
-       ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT TYPE'S POINTER IS NULL"));
-       ACCOUNT_RETURN_VAL((*account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT TYPE IS NULL"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       GVariant* account_type_variant = NULL;
-       account_type_s *in_data = (account_type_s*) (*account_type);
-
-       bool is_success = account_manager_call_account_type_query_by_app_id_sync(acc_mgr, account_db_path, app_id, &account_type_variant, NULL, &error);
-
-       int ret = _account_get_error_code(is_success, error);
-       if (ret != ACCOUNT_ERROR_NONE)
-       {
-               return ret;
-       }
-
-       _INFO("before umarshal_account_type");
-       account_type_s* received_account_type = umarshal_account_type (account_type_variant);
-       _INFO("after umarshal_account_type");
-       ACCOUNT_RETURN_VAL((received_account_type != NULL), {}, ACCOUNT_ERROR_DB_FAILED, ("INVALID DATA RECEIVED FROM SVC"));
-
-       in_data->id = received_account_type->id;
-       in_data->app_id = received_account_type->app_id;
-       in_data->service_provider_id = received_account_type->service_provider_id;
-       in_data->icon_path = received_account_type->icon_path;
-       in_data->small_icon_path = received_account_type->small_icon_path;
-       in_data->multiple_account_support = received_account_type->multiple_account_support;
-       in_data->label_list = received_account_type->label_list;
-       in_data->account_type_list = received_account_type->account_type_list;
-       in_data->provider_feature_list = received_account_type->provider_feature_list;
-
-       _INFO("account_type_query_by_app_id end");
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_foreach_account_type_from_db(account_type_cb callback, void *user_data)
-{
-       _INFO("account_type_foreach_account_type_from_db starting");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT Callback IS NULL"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       GVariant* account_type_list_variant = NULL;
-       _INFO("before account_type_query_all_sync()");
-       bool is_success = account_manager_call_account_type_query_all_sync(acc_mgr, account_db_path, &account_type_list_variant, NULL, &error);
-
-       _INFO("after account_type_query_all_sync()");
-       int ret = _account_get_error_code(is_success, error);
-       if (ret != ACCOUNT_ERROR_NONE)
-       {
-               return ret;
-       }
-
-       _INFO("before unmarshal_account_type_list");
-       GSList* account_type_list = unmarshal_account_type_list(account_type_list_variant);
-       _INFO("after unmarshal_account_type_list");
-       if (account_type_list == NULL)
-       {
-               return ACCOUNT_ERROR_NO_DATA;
-       }
-
-       GSList* iter;
-
-       for (iter = account_type_list; iter != NULL; iter = g_slist_next(iter))
-       {
-               _INFO("iterating received account_list");
-               account_type_s *account_type = NULL;
-               account_type = (account_type_s*)iter->data;
-
-               if (callback((account_type_h)account_type, user_data) == false)
-               {
-                       _INFO("application callback requested to discontinue.");
-                       break;
-               }
-       }
-       _INFO("account_foreach_account_from_db end");
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_query_label_by_locale(const char* app_id, const char* locale, char** label)
-{
-       _INFO("account_type_query_label_by_locale starting");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((app_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO APP ID"));
-       ACCOUNT_RETURN_VAL((locale != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO LOCALE"));
-       ACCOUNT_RETURN_VAL((label != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("label char is null"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       char* label_temp = NULL;
-       _INFO("before account_type_query_label_by_locale_sync()");
-       bool is_success = account_manager_call_account_type_query_label_by_locale_sync(acc_mgr, account_db_path, app_id, locale, &label_temp, NULL, &error);
-
-       _INFO("after account_type_query_label_by_locale_sync() : is_success=%d", is_success);
-       int ret = _account_get_error_code(is_success, error);
-       if (ret != ACCOUNT_ERROR_NONE)
-       {
-               return ret;
-       }
-
-       if (label_temp == NULL)
-       {
-               return ACCOUNT_ERROR_NO_DATA;
-       }
-
-       *label = _account_get_text(label_temp);
-       _INFO("account_type_query_label_by_locale end");
-       return ACCOUNT_ERROR_NONE;
-
-}
-
-ACCOUNT_API int account_type_query_by_provider_feature(account_type_cb callback, const char* key, void* user_data)
-{
-       _INFO("account_type_query_by_provider_feature starting");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((key != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_type IS NULL"));
-       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("CALL BACK IS NULL"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       GVariant* account_type_list_variant = NULL;
-       bool is_success = account_manager_call_account_type_query_by_provider_feature_sync(acc_mgr, account_db_path, key, &account_type_list_variant, NULL, &error);
-
-       int ret = _account_get_error_code(is_success, error);
-       if (ret != ACCOUNT_ERROR_NONE)
-       {
-               return ret;
-       }
-
-       _INFO("before unmarshal_account_type_list");
-       GSList* account_type_list = unmarshal_account_type_list(account_type_list_variant);
-       _INFO("after unmarshal_account_type_list");
-       if (account_type_list == NULL)
-       {
-               return ACCOUNT_ERROR_NO_DATA;
-       }
-
-       GSList* iter;
-
-       for (iter = account_type_list; iter != NULL; iter = g_slist_next(iter))
-       {
-               _INFO("iterating received account_type_list");
-               account_type_s *account_type = NULL;
-               account_type = (account_type_s*)iter->data;
-               _INFO("");
-               if (callback((account_type_h)account_type, user_data) == false)
-               {
-                       _INFO("Application callback requested not to continue");
-                       break;
-               }
-               _INFO("");
-       }
-       _INFO("account_type_query_by_provider_feature end");
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_type_query_app_id_exist(const char* app_id)
-{
-       _INFO("account_type_query_app_id_exist starting");
-       char* account_db_path = ACCOUNT_DB_NAME;
-
-       ACCOUNT_RETURN_VAL((app_id != 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
-
-       GError *error = NULL;
-
-       AccountManager* acc_mgr = _account_manager_get_instance();
-       if (acc_mgr == NULL)
-       {
-               _ERR("g_bus_get_sync failed");
-               return ACCOUNT_ERROR_PERMISSION_DENIED;
-       }
-
-       bool is_success = account_manager_call_account_type_query_app_id_exist_sync(acc_mgr, account_db_path, app_id, NULL, &error);
-
-       return _account_get_error_code(is_success, error);
-}
-
-
-static void _account_subscribe_vconf_callback(keynode_t *key, void *user_data)
-{
-       account_subscribe_s* tmp = (account_subscribe_s*)user_data;
-       char *msg = NULL, *vconf_key = NULL;
-       char event_msg[256] ={0, };
-       int account_id = -1;
-
-       if(!key) {
-               ACCOUNT_ERROR("No subscribtion msg !!!!!\n");
-               return;
-       }
-
-       if(!tmp) {
-               ACCOUNT_ERROR("user data required\n");
-               return;
-       }
-
-       if(!memcmp(vconf_keynode_get_name(key), VCONFKEY_ACCOUNT_MSG_STR, strlen(VCONFKEY_ACCOUNT_MSG_STR)))
-       {
-               vconf_key = vconf_keynode_get_str(key);
-
-               if( vconf_key == NULL){
-                       ACCOUNT_ERROR("vconf key is NULL.\n");
-                       return;
-               }
-               msg = strdup(vconf_key);
-
-               char* event_type = NULL;
-               char* id = NULL;
-               char* ptr = NULL;
-
-               event_type = strtok_r(msg, ":", &ptr);
-               id = strtok_r(NULL, ":", &ptr);
-
-               ACCOUNT_SLOGD("msg(%s), event_type(%s), id(%s)", msg, event_type, id);
-
-               ACCOUNT_SNPRINTF(event_msg,sizeof(event_msg),"%s", event_type);
-
-               account_id = atoi(id);
-
-               if(tmp->account_subscription_callback)
-                       tmp->account_subscription_callback(event_msg, account_id, tmp->user_data);
-       }
-
-       _ACCOUNT_FREE(msg);
-
-}
-
-ACCOUNT_API int account_subscribe_create(account_subscribe_h* account_subscribe)
-{
-       if (!account_subscribe) {
-               ACCOUNT_SLOGE("account is NULL.\n", __FUNCTION__, __LINE__);
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-
-       account_subscribe_s *data = (account_subscribe_s*)calloc(1,sizeof(account_subscribe_s));
-
-       if(!data) {
-               ACCOUNT_FATAL("OUT OF MEMORY\n");
-               return ACCOUNT_ERROR_OUT_OF_MEMORY;
-       }
-
-       *account_subscribe = (account_subscribe_h)data;
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_subscribe_notification(account_subscribe_h account_subscribe, account_event_cb callback, void* user_data)
-{
-       ACCOUNT_RETURN_VAL((account_subscribe != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account subscribe handle is NULL.\n",  __FUNCTION__, __LINE__));
-
-       account_subscribe_s* tmp =(account_subscribe_s*)account_subscribe;
-
-       tmp->account_subscription_callback = callback;
-       tmp->user_data = user_data;
-
-       int ret = -1;
-       ret = vconf_notify_key_changed(VCONFKEY_ACCOUNT_MSG_STR,
-                               (vconf_callback_fn)_account_subscribe_vconf_callback,
-                               (void*)tmp);
-
-       ACCOUNT_SLOGI("vconf_notify_key_changed ret = %d", ret);
-
-       if(ret != VCONF_OK) {
-               ACCOUNT_ERROR("Vconf Subscription Failed ret = %d", ret);
-               return ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL;
-       }
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_unsubscribe_notification(account_subscribe_h account_subscribe)
-{
-       ACCOUNT_RETURN_VAL((account_subscribe != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account subscribe handle is NULL.\n",  __FUNCTION__, __LINE__));
-
-       account_subscribe_s* tmp =(account_subscribe_s*)account_subscribe;
-
-       _ACCOUNT_FREE(tmp);
-
-       if (vconf_ignore_key_changed(VCONFKEY_ACCOUNT_MSG_STR,
-          (vconf_callback_fn)_account_subscribe_vconf_callback) != 0) {
-               ACCOUNT_ERROR("Vconf Subscription Failed !!!!!\n");
-               return ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL;
-       }
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static void _account_subscribe_vconf_callback_ex(keynode_t *key, void *user_data)
-{
-       account_subscribe_s* tmp = (account_subscribe_s*)user_data;
-       char *msg = NULL, *vconf_key = NULL;
-       char event_msg[256] ={0, };
-       int account_id = -1;
-
-       if(!key) {
-               ACCOUNT_ERROR("No subscribtion msg !!!!!\n");
-               return;
-       }
-
-       if(!tmp) {
-               ACCOUNT_ERROR("user data required\n");
-               return;
-       }
-
-       if(!memcmp(vconf_keynode_get_name(key), VCONFKEY_ACCOUNT_MSG_STR, strlen(VCONFKEY_ACCOUNT_MSG_STR)))
-       {
-               vconf_key = vconf_keynode_get_str(key);
-
-               if( vconf_key == NULL){
-                       ACCOUNT_ERROR("vconf key is NULL.\n");
-                       return;
-               }
-               msg = strdup(vconf_key);
-
-               char* event_type = NULL;
-               char* id = NULL;
-               char* ptr = NULL;
-
-               event_type = strtok_r(msg, ":", &ptr);
-               id = strtok_r(NULL, ":", &ptr);
-
-               ACCOUNT_SLOGD("msg(%s), event_type(%s), id(%s)", msg, event_type, id);
-
-               ACCOUNT_SNPRINTF(event_msg,sizeof(event_msg),"%s", event_type);
-
-               account_id = atoi(id);
-
-               if(tmp->account_subscription_callback)
-                       tmp->account_subscription_callback(event_msg, account_id, tmp->user_data);
-       }
-
-       _ACCOUNT_FREE(msg);
-
-}
-
-ACCOUNT_API int account_unsubscribe_notification_ex(account_subscribe_h account_subscribe)
-{
-       ACCOUNT_RETURN_VAL((account_subscribe != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account subscribe handle is NULL.\n",  __FUNCTION__, __LINE__));
-
-       account_subscribe_s* tmp =(account_subscribe_s*)account_subscribe;
-
-       _ACCOUNT_FREE(tmp);
-
-       if (vconf_ignore_key_changed(VCONFKEY_ACCOUNT_MSG_STR,
-          (vconf_callback_fn)_account_subscribe_vconf_callback_ex) != 0) {
-               ACCOUNT_ERROR("Vconf Subscription Failed !!!!!\n");
-               return ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL;
-       }
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_subscribe_notification_ex(account_subscribe_h account_subscribe, account_event_cb callback, void* user_data)
-{
-       ACCOUNT_RETURN_VAL((account_subscribe != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account subscribe handle is NULL.\n",  __FUNCTION__, __LINE__));
-
-       account_subscribe_s* tmp =(account_subscribe_s*)account_subscribe;
-
-       tmp->account_subscription_callback = callback;
-       tmp->user_data = user_data;
-
-       int ret = -1;
-       ret = vconf_notify_key_changed(VCONFKEY_ACCOUNT_MSG_STR,
-                               (vconf_callback_fn)_account_subscribe_vconf_callback_ex,
-                               (void*)tmp);
-
-       ACCOUNT_SLOGI("vconf_notify_key_changed ret = %d", ret);
-
-       if(ret != VCONF_OK) {
-               ACCOUNT_ERROR("Vconf Subscription Failed ret = %d", ret);
-               return ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL;
-       }
-
-       return ACCOUNT_ERROR_NONE;
-}
diff --git a/src/accounts/client/accounts-svc.pc.in b/src/accounts/client/accounts-svc.pc.in
deleted file mode 100755 (executable)
index fead59c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# Package Information for pkg-config
-
-prefix=@PREFIX@
-exec_prefix=@EXEC_PREFIX@
-libdir=@LIBDIR@
-includedir=@INCLUDEDIR@
-
-Name: accounts-svc
-Description: Account DB library
-Version: @VERSION@
-#Requires: capi-base-common
-Libs: -L${libdir} -laccounts-svc
-Cflags: -I${includedir}
diff --git a/src/accounts/common/account-private.h b/src/accounts/common/account-private.h
deleted file mode 100755 (executable)
index 83b5f80..0000000
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- *  account
- *
- * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Wonyoung Lee <wy1115.lee@samsung.com>, Sungchan Kim <sungchan81.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef __ACCOUNT_PRIVATE_H__
-#define __ACCOUNT_PRIVATE_H__
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#include <glib.h>
-#include <dlog.h>
-#include <dbus/dbus.h>
-
-#include "account.h"
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "ACCOUNT"
-
-#define ACCOUNT_VERBOSE(fmt, arg...) \
-               LOGD(": " fmt "\n", ##arg);
-#define ACCOUNT_DEBUG(fmt, arg...) \
-               LOGD(": " fmt "\n", ##arg);
-#define ACCOUNT_ERROR(fmt, arg...) \
-               LOGE(": " fmt "\n", ##arg);
-#define ACCOUNT_FATAL(fmt, arg...) \
-               LOGF(": " fmt "\n", ##arg);
-#define ACCOUNT_SLOGD(fmt, arg...) \
-               SECURE_LOGD(": " fmt "\n", ##arg);
-#define ACCOUNT_SLOGI(fmt, arg...) \
-               SECURE_LOGI(": " fmt "\n", ##arg);
-#define ACCOUNT_SLOGE(fmt, arg...) \
-               SECURE_LOGE(": " fmt "\n", ##arg);
-
-#define ACCOUNT_RETURN_VAL(eval, expr, ret_val, X)\
-       if (!(eval)) \
-{\
-       expr; \
-       return ret_val;\
-} else {;}
-
-#define ACCOUNT_SNPRINTF(dest,size,format,arg...)      \
-       do { \
-                       snprintf(dest,size-1,format,##arg); \
-       }while(0)
-       /*      If the same pointer is passed to free twice,    known as a double free. To avoid this, set pointers to
-NULL after passing     them to free: free(NULL) is safe (it does nothing).
-        */
-
-#define ACCOUNT_MEMSET(dest,value,size)        \
-       do { \
-                       memset(dest,value,size); \
-       }while(0)
-
-#define ACCOUNT_CATCH_ERROR(eval, expr, error_val, X) \
-       if (!(eval)) \
-{\
-       expr; \
-       error_code = (error_val);\
-       goto CATCH;\
-} else {;}
-
-#define ACCOUNT_CATCH_ERROR_P(eval, expr, error_val, X) \
-       if (!(eval)) \
-{\
-       expr; \
-       *error_code = (error_val);\
-       goto CATCH;\
-} else {;}
-
-#define _ACCOUNT_FREE(ptr)     \
-               if (ptr != NULL) {      \
-                       free(ptr);      \
-                       ptr = NULL; \
-               }       \
-
-
-#define _ACCOUNT_GFREE(ptr)    \
-                               if (ptr != NULL) {      \
-                                       g_free(ptr);    \
-                                       ptr = NULL; \
-                               }       \
-
-#define ACCOUNT_DB_NAME "/opt/usr/dbspace/.account.db"
-#define ACCOUNT_TABLE "account"
-#define CAPABILITY_TABLE "capability"
-#define ACCOUNT_CUSTOM_TABLE "account_custom"
-#define ACCOUNT_TYPE_TABLE "account_type"
-#define LABEL_TABLE "label"
-#define PROVIDER_FEATURE_TABLE "provider_feature"
-#define ACCOUNT_SQLITE_SEQ "sqlite_sequence"
-#define ACCOUNT_SQL_LEN_MAX    1024
-#define ACCOUNT_TABLE_TOTAL_COUNT      6
-
-#define FACEBOOK_PKG_NAME              "com.samsung.facebook"
-//#define EMAIL_PKG_NAME                       "email-setting-efl"
-#define EXCHANGE_PKG_NAME              "activesync-ui"
-#define IMS_SERVICE_PKG_NAME           "ims-service"
-#define SAMSUNGACCOUNTFRONT_PKG_NAME  "com.samsung.samsung-account-front"
-//#define SAMSUNGACCOUNT_PKG_NAME  "gr47by21a5.SamsungAccount"
-#define SAMSUNGACCOUNT_PKG_NAME  "com.samsung.samsungaccount"
-#define CHATON_PKG_NAME                        "xnq5eh9vop.ChatON"
-#define DROPBOX_PKG_NAME  "com.samsung.dropbox"
-#define SYNCHRONISE_PKG_NAME "setting-synchronise-efl"
-
-#define USER_TXT_CNT 5
-#define USER_INT_CNT 5
-
-
-/* account uri list */
-#define ACCOUNT_DATA_SERVICE_PROVIDER                     "http://tizen.org/account/data/service_provider"
-#define ACCOUNT_OPERATION_SIGNIN_OLD                      "http://tizen.org/account/operation/signin"
-
-// private account operation type
-#define ACCOUNT_OPERATION_FMM                             "http://tizen.org/account/operation/fmm"
-#define ACCOUNT_OPERATION_MYACCOUNT                       "http://tizen.org/account/operation/signin_from_myaccount"
-// End of private account operation type
-
-#define ACCOUNT_SUPPORTS_CAPABILITY_POST                  "http://tizen.org/account/capability/post"
-#define ACCOUNT_SUPPORTS_CAPABILITY_VOIP                  "http://tizen.org/account/capability/voip"
-#define ACCOUNT_SUPPORTS_CAPABILITY_SAMSUNG_APPS          "http://tizen.org/account/capability/samsungapps"
-#define ACCOUNT_SUPPORTS_CAPABILITY_TASK                  "http://tizen.org/account/capability/task"
-#define ACCOUNT_SUPPORTS_CAPABILITY_MOBILE_TRACKER        "http://tizen.org/account/capability/mobiletracker"
-#define ACCOUNT_SUPPORTS_CAPABILITY_S_NOTE                "http://tizen.org/account/capability/snote"
-#define ACCOUNT_SUPPORTS_CAPABILITY_GALLERY               "http://tizen.org/account/capability/gallery"
-#define ACCOUNT_SUPPORTS_CAPABILITY_MEMO                  "http://tizen.org/account/capability/memo"
-#define ACCOUNT_SUPPORTS_CAPABILITY_CHAT                  "http://tizen.org/account/capability/chat"
-#define ACCOUNT_SUPPORTS_CAPABILITY_BOOKMARK              "http://tizen.org/account/capability/bookmark"
-#define ACCOUNT_SUPPORTS_CAPABILITY_SYNCHRONISE           "http://tizen.org/account/capability/synchronise"
-#define ACCOUNT_SUPPORTS_CAPABILITY_TIZEN_EMAIL           "http://tizen.org/account/capability/tizen_email"
-#define ACCOUNT_SUPPORTS_CAPABILITY_INTERNET              "http://tizen.org/account/capability/internet"
-#define ACCOUNT_SUPPORTS_CAPABILITY_DOCOMO_SCHEDULE_MEMO  "http://tizen.org/account/capability/docomo"
-/* end of account uri list */
-
-typedef struct _account_sso_access_list_s
-{
-       GList *acl;
-}account_sso_access_list_s;
-
-typedef struct _account_s
-{
-       int                     id;
-       char*           user_name;
-       char*           email_address;
-       char*           display_name;
-       char*           icon_path;
-       char*           source;
-       char*           package_name;
-       char*           access_token;
-       char*           domain_name;            /*< domain name [Ex: google, facebook, twitter, samsung, ...] */
-//     char*           auth_method;
-       int                     auth_type;
-       int                     secret;
-       int                     sync_support;
-       int                     user_data_int[USER_INT_CNT];
-       char*           user_data_txt[USER_TXT_CNT];
-       GSList*         capablity_list;
-       GList*          account_list;
-       GSList*         custom_list;
-       GList*          domain_list;
-       GList*          mechanism_list;
-//     account_sso_access_list_s *acl;
-}account_s;
-
-typedef struct _capability_s
-{
-       int id;
-       char* type;
-       int value;
-       char* package_name;
-       char* user_name;
-       int account_id;
-}account_capability_s;
-
-
-typedef struct _account_custom_s
-{
-       int     account_id;
-       char*   app_id;
-       char*   key;
-       char*   value;
-}account_custom_s;
-
-typedef struct _account_type_s
-{
-       int     id;
-       char*   app_id;
-       char*   service_provider_id;
-       char*   icon_path;
-       char*   small_icon_path;
-       bool    multiple_account_support;
-       GSList* label_list;
-       GList*  account_type_list;
-       GSList* provider_feature_list;
-}account_type_s;
-
-
-typedef struct _label_s
-{
-       char* app_id;
-       char* label;
-       char* locale;
-}label_s;
-
-typedef struct _provider_feature_s
-{
-       char* key;
-       char* app_id;
-}provider_feature_s;
-
-typedef struct _account_subscribe_s
-{
-       account_event_cb account_subscription_callback;
-       void* user_data;
-}account_subscribe_s;
-
-typedef struct _account_auth_data_s
-{
-       GVariant* auth_data;
-}account_auth_data_s;
-
-/**
- * @brief   Enumarations for account handle fields.
- */
-
-typedef enum {
-       ACCOUNT_FIELD_NONE = -1,
-       ACCOUNT_FIELD_ID,
-       ACCOUNT_FIELD_USER_NAME,
-       ACCOUNT_FIELD_EMAIL_ADDRESS,
-       ACCOUNT_FIELD_DISPLAY_NAME,
-       ACCOUNT_FIELD_ICON_PATH,
-       ACCOUNT_FIELD_SOURCE,
-       ACCOUNT_FIELD_PACKAGE_NAME,
-       ACCOUNT_FIELD_ACCESS_TOKEN,
-       ACCOUNT_FIELD_DOMAIN_NAME,
-//     ACCOUNT_FIELD_AUTH_METHOD,
-       ACCOUNT_FIELD_AUTH_TYPE,
-       ACCOUNT_FIELD_SECRET,
-       ACCOUNT_FIELD_SYNC_SUPPORT,
-       ACCOUNT_FIELD_USER_TEXT_0,
-       ACCOUNT_FIELD_USER_TEXT_1,
-       ACCOUNT_FIELD_USER_TEXT_2,
-       ACCOUNT_FIELD_USER_TEXT_3,
-       ACCOUNT_FIELD_USER_TEXT_4,
-       ACCOUNT_FIELD_USER_INT_0,
-       ACCOUNT_FIELD_USER_INT_1,
-       ACCOUNT_FIELD_USER_INT_2,
-       ACCOUNT_FIELD_USER_INT_3,
-       ACCOUNT_FIELD_USER_INT_4,
-       ACCOUNT_DB_FIELD_END
-} ACCOUNT_DB_IDX;
-
-/**
- * @brief      Enumarations for capability fields.
- */
-
-typedef enum {
-       CAPABILITY_FIELD_NONE = -1,
-       CAPABILITY_FIELD_ID,
-       CAPABILITY_FIELD_KEY,
-       CAPABILITY_FIELD_VALUE,
-       CAPABILITY_FIELD_PACKAGE_NAME,
-       CAPABILITY_FIELD_USER_NAME,
-       CAPABILITY_FIELD_ACCOUNT_ID,
-       CAPABILITY_FIELD_END,
-}CAPABILITY_DB_IDX;
-
-
-typedef enum {
-       ACCOUNT_CUSTOM_FIELD_NONE = -1,
-       ACCOUNT_CUSTOM_FIELD_ACCOUNT_ID,
-       ACCOUNT_CUSTOM_FIELD_APP_ID,
-       ACCOUNT_CUSTOM_FIELD_KEY,
-       ACCOUNT_CUSTOM_FIELD_VALUE,
-       ACCOUNT_CUSTOM_FIELD_END,
-}ACCOUNT_CUSTOM_DB_IDX;
-
-typedef enum {
-       ACCOUNT_TYPE_FIELD_NONE = -1,
-       ACCOUNT_TYPE_FIELD_ID,
-       ACCOUNT_TYPE_FIELD_APP_ID,
-       ACCOUNT_TYPE_FIELD_SERVICE_PROVIDER_ID,
-       ACCOUNT_TYPE_FIELD_ICON_PATH,
-       ACCOUNT_TYPE_FIELD_SMALL_ICON_PATH,
-       ACCOUNT_TYPE_FIELD_MULTIPLE_ACCOUNT_SUPPORT,
-       ACCOUNT_TYPE_FIELD_END,
-}ACCOUNT_TYPE_DB_IDX;
-
-typedef enum {
-       LABEL_FIELD_NONE = -1,
-       LABEL_FIELD_APP_ID,
-       LABEL_FIELD_LABEL,
-       LABEL_FIELD_LOCALE,
-       LABEL_FIELD_END,
-}LABEL_DB_IDX;
-
-typedef enum {
-       PROVIDER_FEATURE_FIELD_NONE = -1,
-       PROVIDER_FEATURE_FIELD_APP_ID,
-       PROVIDER_FEATURE_FIELD_KEY,
-       PROVIDER_FEATURE_FIELD_END,
-}PROVIDER_FEATURE_DB_IDX;
-
-typedef struct GSList          account_iterator_s;
-
-#define ACCOUNT_SSO_MAX_LIST_COUNT 100
-#define ACCOUNT_SSO_MAX_APP_NAME_LENGTH 128
-
-#define _ACCOUNT_SVC_ERROR_DOMAIN "accounts-svc"
-#define _ACCOUNT_SVC_ERROR_PREFIX "org.tizen.account.manager.Error"
-
-#define EAS_CMDLINE "/usr/bin/eas-engine"
-#define EMAIL_SERVICE_CMDLINE "/usr/bin/email-service"
-#define IMS_ENGINE_CMDLINE "/usr/bin/ims-srv"
-#define IMS_AGENT_CMDLINE "/usr/bin/ims-agent"
-#define MDM_SERVER_CMDLINE "/usr/bin/mdm-server"
-
-#define RCS_APPID "com.samsung.rcs-im"
-#define IMS_SERVICE_APPID "ims-service"
-#define ACTIVESYNC_APPID "activesync-ui"
-//#define EMAIL_APPID "email-setting-efl"
-#define SYNCHRONISE_APPID "setting-synchronise-efl"
-#define DS_AGENT_CMDLINE "/usr/bin/oma-ds-agent"
-
-#define FACEBOOK_SDK_APPID "com.samsung.facebook-service"
-#define FACEBOOK_APPID "com.samsung.facebook"
-
-//Used by both accounts and gtme. However as of now, gtme does not have any dependency on account, so duplicating the same
-#define MAX_SYS_CONTEXT_SIZE 1024
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ACCOUNT_PRIVATE_H__*/
diff --git a/src/accounts/common/account_ipc_marshal.c b/src/accounts/common/account_ipc_marshal.c
deleted file mode 100644 (file)
index ba903f0..0000000
+++ /dev/null
@@ -1,1489 +0,0 @@
-/*
- *
- * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>     //snprintf
-#include <stdlib.h> //calloc
-#include <string.h>
-#include "account_ipc_marshal.h"
-
-#include "dbg.h"
-
-#define ACCOUNT_DATA_KEY_ID "id"
-#define ACCOUNT_DATA_KEY_USER_NAME "user_name"
-#define ACCOUNT_DATA_KEY_EMAIL "email_address"
-#define ACCOUNT_DATA_KEY_DISPLAY_NAME "display_name"
-#define ACCOUNT_DATA_KEY_ICON_PATH "icon_path"
-#define ACCOUNT_DATA_KEY_SOURCE "source"
-#define ACCOUNT_DATA_KEY_PACKAGE_NAME "package_name"
-#define ACCOUNT_DATA_KEY_ACCESS_TOKEN "access_token"
-#define ACCOUNT_DATA_KEY_DOMAIN_NAME "domain_name"
-#define ACCOUNT_DATA_KEY_AUTH_TYPE "auth_type"
-#define ACCOUNT_DATA_KEY_SECRET "secret"
-#define ACCOUNT_DATA_KEY_SYNC_SUPPORT "sync_support"
-#define ACCOUNT_DATA_KEY_USER_DATA_INT "user_data_int"
-#define ACCOUNT_DATA_KEY_USER_DATA_TXT "user_data_txt"
-#define ACCOUNT_DATA_KEY_CAPABILITY_LIST "capability_list"
-#define ACCOUNT_DATA_KEY_ACCOUNT_LIST "account_list"
-#define ACCOUNT_DATA_KEY_CUSTOM_LIST "custom_list"
-
-#define ACCOUNT_TYPE_DATA_KEY_ID "id"
-#define ACCOUNT_TYPE_DATA_KEY_APP_ID "app_id"
-#define ACCOUNT_TYPE_DATA_KEY_SERVICE_PROVIDER_ID "service_provider_id"
-#define ACCOUNT_TYPE_DATA_KEY_ICON_PATH "icon_path"
-#define ACCOUNT_TYPE_DATA_KEY_SMALL_ICON_PATH "small_icon_path"
-#define ACCOUNT_TYPE_DATA_KEY_MULTI_SUPPORT "multiple_account_support"
-#define ACCOUNT_TYPE_DATA_KEY_LABEL_LIST "label_list"
-#define ACCOUNT_TYPE_DATA_KEY_ACC_TYPE_LIST "account_type_list"
-#define ACCOUNT_TYPE_DATA_KEY_PROVIDER_FEATURE_LIST "provider_feature_list"
-
-#define ACCOUNT_CAPABILITY_DATA_KEY_ID "id"
-#define ACCOUNT_CAPABILITY_DATA_KEY_TYPE "type"
-#define ACCOUNT_CAPABILITY_DATA_KEY_VALUE "value"
-#define ACCOUNT_CAPABILITY_DATA_KEY_PACKAGE_NAME "package_name"
-#define ACCOUNT_CAPABILITY_DATA_KEY_USER_NAME "user_name"
-#define ACCOUNT_CAPABILITY_DATA_KEY_ACC_ID "account_id"
-
-#define ACCOUNT_CUSTOM_DATA_KEY_ACC_ID "account_id"
-#define ACCOUNT_CUSTOM_DATA_KEY_APP_ID "app_id"
-#define ACCOUNT_CUSTOM_DATA_KEY_KEY "key"
-#define ACCOUNT_CUSTOM_DATA_KEY_VALUE "value"
-
-static label_s*
-_variant_to_label(GVariant *variant)
-{
-       gchar *app_id = NULL;
-       gchar *label = NULL;
-       gchar *locale = NULL;
-
-       g_return_val_if_fail (variant != NULL, NULL);
-
-       g_variant_get (variant, "(sss)", &app_id, &label, &locale);
-
-       label_s* label_data = (label_s*) calloc(1, sizeof(label_s));
-       label_data->app_id = g_strdup(app_id);
-       label_data->label = g_strdup(label);
-       label_data->locale = g_strdup(locale);
-
-       g_free (app_id);
-       g_free (label);
-       g_free (locale);
-
-       return label_data;
-}
-
-GSList*
-variant_to_label_list(GVariant *variant)
-{
-       GSList *list = NULL;
-       GVariantIter iter;
-       GVariant *value;
-
-       g_return_val_if_fail (variant != NULL, NULL);
-
-       g_variant_iter_init (&iter, variant);
-       while ((value = g_variant_iter_next_value (&iter))) {
-               list = g_slist_append (list,
-                                                         _variant_to_label(value));
-               g_variant_unref (value);
-       }
-
-       return list;
-}
-
-
-static GVariant *
-_label_to_variant (label_s *label_data)
-{
-       GVariant *variant;
-
-       g_return_val_if_fail (label_data != NULL, NULL);
-
-       variant = g_variant_new ("(sss)",
-                                                        label_data->app_id ? label_data->app_id : "",
-                                                        label_data->label ? label_data->label : "",
-                                                        label_data->locale ? label_data->locale : "");
-
-       return variant;
-}
-
-GVariant *
-label_list_to_variant (GSList *list)
-{
-       GVariantBuilder builder;
-       GVariant *variant;
-       label_s *label_data;
-
-       GSList* iter;
-       g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
-       for (iter = list ; iter != NULL; iter = g_slist_next (iter))
-       {
-               label_data = (label_s*) (iter->data);
-               g_variant_builder_add_value (
-                                                                       &builder,
-                                                                       _label_to_variant(label_data));
-       }
-       variant = g_variant_builder_end (&builder);
-
-       return variant;
-}
-
-
-static provider_feature_s*
-_variant_to_provider_feature(GVariant *variant)
-{
-       gchar *key = NULL;
-       gchar *app_id = NULL;
-
-       g_return_val_if_fail (variant != NULL, NULL);
-
-       g_variant_get (variant, "(ss)", &key, &app_id);
-
-       provider_feature_s* provider_feature_data = (provider_feature_s*) calloc(1, sizeof(provider_feature_s));
-       provider_feature_data->key = g_strdup(key);
-       provider_feature_data->app_id = g_strdup(app_id);
-
-       g_free (key);
-       g_free (app_id);
-
-       return provider_feature_data;
-}
-
-GSList*
-variant_to_provider_feature_list(GVariant *variant)
-{
-       GSList *list = NULL;
-       GVariantIter iter;
-       GVariant *value;
-
-       g_return_val_if_fail (variant != NULL, NULL);
-
-       g_variant_iter_init (&iter, variant);
-       while ((value = g_variant_iter_next_value (&iter))) {
-               list = g_slist_append (list,
-                                                         _variant_to_provider_feature(value));
-               g_variant_unref (value);
-       }
-
-       return list;
-}
-
-static GVariant *
-_provider_feature_to_variant (const provider_feature_s *pro_feature_data)
-{
-       GVariant *variant;
-
-       g_return_val_if_fail (pro_feature_data != NULL, NULL);
-
-       variant = g_variant_new ("(ss)",
-                                                        pro_feature_data->key ? pro_feature_data->key : "",
-                                                        pro_feature_data->app_id ? pro_feature_data->app_id : "");
-
-       return variant;
-}
-
-GVariant *
-provider_feature_list_to_variant (GSList *list)
-{
-       GVariantBuilder builder;
-       GVariant *variant;
-       provider_feature_s *provider_feature_data;
-
-       GSList* iter;
-       g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
-       for (iter = list ; iter != NULL; iter = g_slist_next (iter)) {
-               provider_feature_data = (provider_feature_s *) (iter->data);
-               g_variant_builder_add_value (
-                                                                       &builder,
-                                                                       _provider_feature_to_variant(provider_feature_data));
-       }
-       variant = g_variant_builder_end (&builder);
-
-       return variant;
-}
-
-GVariant *
-marshal_account(const account_s* account)
-{
-       _INFO("_marshal_account start");
-
-       const account_s* in_data = account;
-       GVariantBuilder builder;
-       int i;
-
-       g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
-
-       g_variant_builder_add (&builder, "{sv}",
-                                                  ACCOUNT_DATA_KEY_ID,
-                                                  g_variant_new_int32 (in_data->id));
-
-       _INFO("in_data->id=[%d]", in_data->id);
-
-       if (in_data->user_name != NULL)
-       {
-               _INFO("user name");
-
-               g_variant_builder_add (&builder, "{sv}",
-                                                          ACCOUNT_DATA_KEY_USER_NAME,
-                                                          g_variant_new_string (in_data->user_name));
-       }
-       if (in_data->email_address != NULL)
-       {
-               _INFO("email");
-
-               g_variant_builder_add (&builder, "{sv}",
-                                                          ACCOUNT_DATA_KEY_EMAIL,
-                                                          g_variant_new_string (in_data->email_address));
-       }
-       if (in_data->display_name != NULL)
-       {
-               _INFO("user display name");
-
-               g_variant_builder_add (&builder, "{sv}",
-                                                          ACCOUNT_DATA_KEY_DISPLAY_NAME,
-                                                          g_variant_new_string (in_data->display_name));
-       }
-       if (in_data->icon_path != NULL)
-       {
-               _INFO("icon path");
-
-               g_variant_builder_add (&builder, "{sv}",
-                                                          ACCOUNT_DATA_KEY_ICON_PATH,
-                                                          g_variant_new_string (in_data->icon_path));
-       }
-       if (in_data->source != NULL)
-       {
-               _INFO("source");
-
-               g_variant_builder_add (&builder, "{sv}",
-                                                          ACCOUNT_DATA_KEY_SOURCE,
-                                                          g_variant_new_string (in_data->source));
-       }
-       if (in_data->package_name != NULL)
-       {
-               _INFO("pkg name");
-               g_variant_builder_add (&builder, "{sv}",
-                                                          ACCOUNT_DATA_KEY_PACKAGE_NAME,
-                                                          g_variant_new_string (in_data->package_name));
-       }
-       if (in_data->access_token != NULL)
-       {
-               _INFO("acc token");
-               g_variant_builder_add (&builder, "{sv}",
-                                                          ACCOUNT_DATA_KEY_ACCESS_TOKEN,
-                                                          g_variant_new_string (in_data->access_token));
-       }
-       if (in_data->domain_name != NULL)
-       {
-               _INFO("domain");
-
-               g_variant_builder_add (&builder, "{sv}",
-                                                          ACCOUNT_DATA_KEY_DOMAIN_NAME,
-                                                          g_variant_new_string (in_data->domain_name));
-       }
-
-       _INFO("auth_type = %d", in_data->auth_type);
-       g_variant_builder_add (&builder, "{sv}", ACCOUNT_DATA_KEY_AUTH_TYPE, g_variant_new_int32 (in_data->auth_type));
-
-       _INFO("secret = %d", in_data->secret);
-       g_variant_builder_add (&builder, "{sv}", ACCOUNT_DATA_KEY_SECRET, g_variant_new_int32 (in_data->secret));
-
-       _INFO("sync_support = %d", in_data->sync_support);
-       g_variant_builder_add (&builder, "{sv}", ACCOUNT_DATA_KEY_SYNC_SUPPORT, g_variant_new_int32 (in_data->sync_support));
-
-       _INFO("user_data_int");
-       for(i=0; i<USER_INT_CNT; i++)
-       {
-               g_variant_builder_add (&builder, "{sv}",
-                               ACCOUNT_DATA_KEY_USER_DATA_INT,
-                               marshal_user_int_array((const int*) in_data->user_data_int));
-       }
-
-       _INFO("user_data_txt");
-       for(i=0; i<USER_TXT_CNT; i++)
-       {
-               g_variant_builder_add (&builder, "{sv}",
-                               ACCOUNT_DATA_KEY_USER_DATA_TXT,
-                               marshal_user_txt_array((char* const*)in_data->user_data_txt));
-       }
-
-       if (in_data->capablity_list != NULL)
-       {
-               _INFO("capablity_list");
-
-               g_variant_builder_add (&builder, "{sv}",
-                                                          ACCOUNT_DATA_KEY_CAPABILITY_LIST,
-                                                          marshal_capability_list (in_data->capablity_list));
-       }
-
-       if (in_data->custom_list != NULL)
-       {
-               _INFO("custom_list");
-
-               g_variant_builder_add (&builder, "{sv}",
-                                                          ACCOUNT_DATA_KEY_CUSTOM_LIST,
-                                                          marshal_custom_list (in_data->custom_list));
-       }
-
-       //TODO: add support for rest
-
-       _INFO("__marshal_account end");
-
-       return g_variant_builder_end (&builder);
-}
-
-account_s* umarshal_account(GVariant* in_data)
-{
-       _INFO("");
-
-       if (in_data == NULL)
-       {
-               _ERR("Null input");
-               return NULL;
-       }
-
-       GVariant* temp_var = in_data;
-       gchar* print_type = NULL;
-       print_type = g_variant_print(temp_var, TRUE);
-       if (print_type == NULL)
-       {
-               _ERR("Invalid input");
-               return NULL;
-       }
-       _INFO("input=%s", print_type);
-
-       account_s* account = (account_s*)calloc(1, sizeof(account_s));
-       if (account == NULL)
-       {
-               _ERR("Out of memory");
-               return NULL;
-       }
-
-       _INFO("");
-
-       GVariantIter iter;
-       gchar *key = NULL;
-       GVariant *value = NULL;
-
-       _INFO("");
-       g_variant_iter_init (&iter, in_data);
-       _INFO("");
-       while (g_variant_iter_next (&iter, "{sv}", &key, &value))
-       {
-               _INFO("[%s]", key);
-
-               if (!strcmp(key, ACCOUNT_DATA_KEY_ID))
-               {
-                       _INFO("");
-
-                       account->id = g_variant_get_int32 (value);
-                       _INFO("id = %d", account->id);
-               }
-
-               if (!strcmp(key, ACCOUNT_DATA_KEY_USER_NAME))
-               {
-                       _INFO("");
-                       account->user_name = g_strdup(g_variant_get_string (value, NULL));
-                       _INFO("unmarshaled user name=[%s]", account->user_name);
-               }
-
-               else if (!strcmp(key, ACCOUNT_DATA_KEY_EMAIL))
-               {
-                       _INFO("");
-                       account->email_address = g_strdup(g_variant_get_string (value, NULL));
-               }
-
-               else if (!strcmp(key, ACCOUNT_DATA_KEY_DISPLAY_NAME))
-               {
-                       _INFO("");
-
-                       account->display_name = g_strdup(g_variant_get_string (value, NULL));
-               }
-
-               else if (!strcmp(key, ACCOUNT_DATA_KEY_ICON_PATH))
-               {
-                       _INFO("");
-
-                       account->icon_path = g_strdup(g_variant_get_string (value, NULL));
-               }
-
-               else if (!strcmp(key, ACCOUNT_DATA_KEY_SOURCE))
-               {
-                       _INFO("");
-
-                       account->source = g_strdup(g_variant_get_string (value, NULL));
-               }
-
-               else if (!strcmp(key, ACCOUNT_DATA_KEY_PACKAGE_NAME))
-               {
-                       _INFO("");
-
-                       account->package_name = g_strdup(g_variant_get_string (value, NULL));
-               }
-
-               else if (!strcmp(key, ACCOUNT_DATA_KEY_ACCESS_TOKEN))
-               {
-                       _INFO("");
-
-                       account->access_token = g_strdup(g_variant_get_string (value, NULL));
-               }
-
-               else if (!strcmp(key, ACCOUNT_DATA_KEY_DOMAIN_NAME))
-               {
-                       _INFO("");
-
-                       account->domain_name = g_strdup(g_variant_get_string (value, NULL));
-               }
-
-               else if (!strcmp(key, ACCOUNT_DATA_KEY_AUTH_TYPE))
-               {
-                       _INFO("");
-
-                       account->auth_type = g_variant_get_int32 (value);
-                       _INFO("auth_type = %d", account->auth_type);
-               }
-
-               else if (!strcmp(key, ACCOUNT_DATA_KEY_SECRET))
-               {
-                       _INFO("");
-
-                       account->secret = g_variant_get_int32 (value);
-                       _INFO("secret = %d", account->secret);
-               }
-
-               else if (!strcmp(key, ACCOUNT_DATA_KEY_SYNC_SUPPORT))
-               {
-                       account->sync_support = g_variant_get_int32 (value);
-                       _INFO("sync_support = %d", account->sync_support);
-               }
-               else if (!strcmp(key, ACCOUNT_DATA_KEY_USER_DATA_INT))
-               {
-                       int i;
-                       int* tmp_user_ints = unmarshal_user_int_array(value);
-                       for(i=0; i<USER_INT_CNT; i++)
-                       {
-                               account->user_data_int[i] = tmp_user_ints[i];
-                       }
-                       _ACCOUNT_FREE(tmp_user_ints);
-               }
-               else if (!strcmp(key, ACCOUNT_DATA_KEY_USER_DATA_TXT))
-               {
-                       int i;
-                       char** tmp_user_txts = unmarshal_user_txt_array(value);
-                       for(i=0; i<USER_TXT_CNT; i++)
-                       {
-                               account->user_data_txt[i] = strdup(tmp_user_txts[i]);
-                               _ACCOUNT_FREE(tmp_user_txts[i]);
-                       }
-                       _ACCOUNT_FREE(tmp_user_txts);
-               }
-               else if (!strcmp(key, ACCOUNT_DATA_KEY_CAPABILITY_LIST))
-               {
-                       account->capablity_list = unmarshal_capability_list (value);
-                       _INFO("unmarshalled capablity_list");
-               }
-               else if (!strcmp(key, ACCOUNT_DATA_KEY_CUSTOM_LIST))
-               {
-                       account->custom_list = unmarshal_custom_list (value);
-                       _INFO("unmarshalled custom_list");
-               }
-               //TODO: support for rest
-       }
-
-       return account;
-}
-
-GVariant* marshal_account_list_double(GList* account_list)
-{
-       _INFO("marshal_account_list start");
-       if (account_list == NULL)
-       {
-               _ERR("input NULL.");
-               return NULL;
-       }
-
-       GVariantBuilder builder;
-       account_s *account_data;
-
-       GList* iter;
-       g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
-
-       for (iter = account_list ; iter != NULL; iter = g_list_next (iter))
-       {
-               _INFO("iterating account_list");
-               account_data = (account_s *) (iter->data);
-               g_variant_builder_add_value(&builder, marshal_account(account_data));
-               _INFO("end one iteration of account_list");
-       }
-       _INFO("marshal_account_list end");
-       return g_variant_builder_end (&builder);
-}
-
-GVariant* marshal_account_list(GSList* account_list)
-{
-       _INFO("marshal_account_list start");
-       if (account_list == NULL)
-       {
-               _ERR("input NULL.");
-               return NULL;
-       }
-
-       GVariantBuilder builder;
-       account_s *account_data;
-
-       GSList* iter;
-       g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
-
-       for (iter = account_list ; iter != NULL; iter = g_slist_next (iter))
-       {
-               _INFO("iterating account_list");
-               account_data = (account_s *) (iter->data);
-               g_variant_builder_add_value(&builder, marshal_account(account_data));
-               _INFO("end one iteration of account_list");
-       }
-       _INFO("marshal_account_list end");
-       return g_variant_builder_end (&builder);
-}
-
-GSList* unmarshal_account_list(GVariant* variant)
-{
-       _INFO("");
-       GSList *list = NULL;
-       GVariantIter iter;
-       GVariantIter* iter_row = NULL;
-       const gchar *key = NULL;
-       GVariant *value = NULL;
-
-       if (variant == NULL)
-       {
-               _ERR("input NULL");
-               return NULL;
-       }
-
-       _INFO ("type %s", g_variant_get_type_string (variant));
-       gchar* var_type = g_variant_print (variant, TRUE);
-       _INFO("var_type = %s", var_type);
-
-       _INFO("before iter");
-       g_variant_iter_init (&iter, variant);
-       _INFO("after iter");
-
-       _INFO("g_variant_iter_n_children=%d", g_variant_iter_n_children (&iter));
-
-       while (g_variant_iter_next (&iter, "a{sv}", &iter_row))
-       {
-               _INFO("");
-               account_s* account = (account_s*)calloc(1, sizeof(account_s));
-
-               while (g_variant_iter_loop(iter_row, "{sv}", &key, &value))
-               {
-                       if (!g_strcmp0(key, ACCOUNT_DATA_KEY_ID))
-                       {
-                               _INFO("");
-
-                               account->id = g_variant_get_int32 (value);
-                               _INFO("id = %d", account->id);
-                       }
-
-                       if (!g_strcmp0(key, ACCOUNT_DATA_KEY_USER_NAME))
-                       {
-                               account->user_name = g_strdup(g_variant_get_string(value, NULL));
-                               _INFO("[%s]", account->user_name);
-                       }
-                       else if (!g_strcmp0(key, ACCOUNT_DATA_KEY_EMAIL))
-                       {
-                               _INFO("");
-                               account->email_address = g_strdup(g_variant_get_string (value, NULL));
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_DATA_KEY_DISPLAY_NAME))
-                       {
-                               _INFO("");
-
-                               account->display_name = g_strdup(g_variant_get_string (value, NULL));
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_DATA_KEY_ICON_PATH))
-                       {
-                               _INFO("");
-
-                               account->icon_path = g_strdup(g_variant_get_string (value, NULL));
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_DATA_KEY_SOURCE))
-                       {
-                               _INFO("");
-
-                               account->source = g_strdup(g_variant_get_string (value, NULL));
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_DATA_KEY_PACKAGE_NAME))
-                       {
-                               _INFO("");
-
-                               account->package_name = g_strdup(g_variant_get_string (value, NULL));
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_DATA_KEY_ACCESS_TOKEN))
-                       {
-                               _INFO("");
-
-                               account->access_token = g_strdup(g_variant_get_string (value, NULL));
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_DATA_KEY_DOMAIN_NAME))
-                       {
-                               _INFO("");
-
-                               account->domain_name = g_strdup(g_variant_get_string (value, NULL));
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_DATA_KEY_AUTH_TYPE))
-                       {
-                               _INFO("");
-
-                               account->auth_type = g_variant_get_int32 (value);
-                               _INFO("auth_type = %d", account->auth_type);
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_DATA_KEY_SECRET))
-                       {
-                               _INFO("");
-
-                               account->secret = g_variant_get_int32 (value);
-                               _INFO("secret = %d", account->secret);
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_DATA_KEY_SYNC_SUPPORT))
-                       {
-                               account->sync_support = g_variant_get_int32 (value);
-                               _INFO("sync_support = %d", account->sync_support);
-                       }
-                       else if (!strcmp(key, ACCOUNT_DATA_KEY_USER_DATA_INT))
-                       {
-                               int i;
-                               int* tmp_user_ints = unmarshal_user_int_array(value);
-                               for(i=0; i<USER_INT_CNT; i++)
-                               {
-                                       account->user_data_int[i] = tmp_user_ints[i];
-                               }
-                               _ACCOUNT_FREE(tmp_user_ints);
-                       }
-                       else if (!strcmp(key, ACCOUNT_DATA_KEY_USER_DATA_TXT))
-                       {
-                               int i;
-                               char** tmp_user_txts = unmarshal_user_txt_array(value);
-                               for(i=0; i<USER_TXT_CNT; i++)
-                               {
-                                       account->user_data_txt[i] = strdup(tmp_user_txts[i]);
-                                       _ACCOUNT_FREE(tmp_user_txts[i]);
-                               }
-                               _ACCOUNT_FREE(tmp_user_txts);
-                       }
-                       else if (!strcmp(key, ACCOUNT_DATA_KEY_CAPABILITY_LIST))
-                       {
-                               account->capablity_list = unmarshal_capability_list (value);
-                               _INFO("unmarshalled capablity_list");
-                       }
-                       else if (!strcmp(key, ACCOUNT_DATA_KEY_CUSTOM_LIST))
-                       {
-                               account->custom_list = unmarshal_custom_list (value);
-                               _INFO("unmarshalled custom_list");
-                       }
-               }
-               list = g_slist_append (list, account);
-               _INFO("");
-
-       }
-
-       _INFO("");
-       return list;
-}
-
-GVariant* marshal_account_type_list(GSList* account_type_list)
-{
-       _INFO("marshal_account_type_list start");
-       if (account_type_list == NULL)
-       {
-               _ERR("input NULL.");
-               return NULL;
-       }
-
-       GVariantBuilder builder;
-       account_type_s *account_type_data = NULL;
-
-       GSList* iter;
-       g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
-
-       for (iter = account_type_list ; iter != NULL; iter = g_slist_next (iter))
-       {
-               _INFO("iterating account_type_list");
-               account_type_data = (account_type_s *) (iter->data);
-               g_variant_builder_add_value(&builder, marshal_account_type((account_type_s*)account_type_data));
-               _INFO("end one iteration of account_type_list");
-       }
-       _INFO("marshal_account_type_list end");
-       return g_variant_builder_end (&builder);
-}
-
-account_s* create_empty_account_instance(void)
-{
-       account_s *data = (account_s*)malloc(sizeof(account_s));
-
-       if (data == NULL)
-       {
-               ACCOUNT_ERROR("Memory Allocation Failed");
-               return NULL;
-       }
-
-       ACCOUNT_MEMSET(data, 0, sizeof(account_s));
-
-       data->id = -1;
-       data->user_name = NULL;
-       data->email_address = NULL;
-       data->display_name = NULL;
-       data->icon_path = NULL;
-       data->source = NULL;
-       data->package_name = NULL;
-       data->access_token = NULL;
-       data->domain_name = NULL;
-       data->auth_type = 0;
-       data->secret = 0;
-       data->sync_support = false;
-       data->capablity_list = NULL;
-       data->account_list = false;
-       data->custom_list = false;
-
-       return data;
-}
-
-account_type_s* create_empty_account_type_instance(void)
-{
-       account_type_s *data = (account_type_s*)malloc(sizeof(account_type_s));
-
-       if (data == NULL)
-       {
-               ACCOUNT_ERROR("Memory Allocation Failed");
-               return NULL;
-       }
-
-       ACCOUNT_MEMSET(data, 0, sizeof(account_type_s));
-
-       data->id = -1;
-       data->app_id = NULL;
-       data->service_provider_id = NULL;
-       data->icon_path = NULL;
-       data->small_icon_path = NULL;
-       data->multiple_account_support = false;
-       data->label_list = NULL;
-       data->account_type_list = NULL;
-       data->provider_feature_list = NULL;
-
-       return data;
-}
-
-GSList* unmarshal_account_type_list(GVariant* variant)
-{
-       _INFO("");
-       GSList *list = NULL;
-       GVariantIter iter;
-       GVariantIter* iter_row = NULL;
-       const gchar *key = NULL;
-       GVariant *value = NULL;
-
-       if (variant == NULL)
-       {
-               _ERR("input NULL");
-               return NULL;
-       }
-
-       _INFO ("type %s", g_variant_get_type_string (variant));
-       gchar* var_type = g_variant_print (variant, TRUE);
-       _INFO("var_type = %s", var_type);
-
-       _INFO("before iter");
-       g_variant_iter_init (&iter, variant);
-       _INFO("after iter");
-
-       _INFO("g_variant_iter_n_children=%d", g_variant_iter_n_children (&iter));
-
-       while (g_variant_iter_next (&iter, "a{sv}", &iter_row))
-       {
-               _INFO("");
-               account_type_s* account_type = create_empty_account_type_instance();
-
-               while (g_variant_iter_loop(iter_row, "{sv}", &key, &value))
-               {
-                       if (!g_strcmp0(key, ACCOUNT_TYPE_DATA_KEY_ID))
-                       {
-                               account_type->id = g_variant_get_int32(value);
-                       }
-                       else if (!g_strcmp0(key, ACCOUNT_TYPE_DATA_KEY_APP_ID))
-                       {
-                               _INFO("");
-                               account_type->app_id = g_strdup(g_variant_get_string (value, NULL));
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_TYPE_DATA_KEY_SERVICE_PROVIDER_ID))
-                       {
-                               _INFO("");
-                               account_type->service_provider_id = g_strdup(g_variant_get_string (value, NULL));
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_TYPE_DATA_KEY_ICON_PATH))
-                       {
-                               _INFO("");
-                               account_type->icon_path = g_strdup(g_variant_get_string (value, NULL));
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_TYPE_DATA_KEY_SMALL_ICON_PATH))
-                       {
-                               _INFO("");
-                               account_type->small_icon_path = g_strdup(g_variant_get_string (value, NULL));
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_TYPE_DATA_KEY_MULTI_SUPPORT))
-                       {
-                               _INFO("");
-                               account_type->multiple_account_support = g_variant_get_int32 (value);
-                       }
-                       else if (!g_strcmp0(key, ACCOUNT_TYPE_DATA_KEY_LABEL_LIST))
-                       {
-                               _INFO("");
-                               account_type->label_list = variant_to_label_list(value);
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_TYPE_DATA_KEY_PROVIDER_FEATURE_LIST))
-                       {
-                               _INFO("");
-                               account_type->provider_feature_list = variant_to_provider_feature_list(value);
-                       }
-
-               }
-               list = g_slist_append (list, account_type);
-               _INFO("");
-
-       }
-
-       _INFO("");
-       return list;
-}
-
-GVariant* marshal_account_type(const account_type_s* account_type)
-{
-       _INFO("marshal_account_type start");
-       if (account_type == NULL)
-       {
-               _ERR("NULL input");
-               return NULL;
-       }
-
-       const account_type_s* in_data = account_type;
-       GVariantBuilder builder;
-
-
-       g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
-
-
-       if (in_data->app_id != NULL)
-       {
-               g_variant_builder_add (&builder, "{sv}",
-                                                          ACCOUNT_TYPE_DATA_KEY_APP_ID,
-                                                          g_variant_new_string (in_data->app_id));
-       }
-
-       if (in_data->service_provider_id != NULL)
-       {
-               g_variant_builder_add (&builder, "{sv}",
-                                                          ACCOUNT_TYPE_DATA_KEY_SERVICE_PROVIDER_ID,
-                                                          g_variant_new_string (in_data->service_provider_id));
-       }
-
-       if (in_data->icon_path != NULL)
-       {
-               g_variant_builder_add (&builder, "{sv}",
-                                                          ACCOUNT_TYPE_DATA_KEY_ICON_PATH,
-                                                          g_variant_new_string (in_data->icon_path));
-       }
-
-       if (in_data->small_icon_path != NULL)
-       {
-               g_variant_builder_add (&builder, "{sv}",
-                                                          ACCOUNT_TYPE_DATA_KEY_SMALL_ICON_PATH,
-                                                          g_variant_new_string (in_data->small_icon_path));
-       }
-
-       if (in_data->multiple_account_support == false)
-       {
-               _INFO("Multi account support false");
-               g_variant_builder_add (&builder, "{sv}", ACCOUNT_TYPE_DATA_KEY_MULTI_SUPPORT,
-                                                  g_variant_new_int32 (0));
-       }
-       else
-       {
-               _INFO("Multi account support true");
-               g_variant_builder_add (&builder, "{sv}", ACCOUNT_TYPE_DATA_KEY_MULTI_SUPPORT,
-                                                  g_variant_new_int32 (1));
-       }
-
-       if (in_data->label_list != NULL)
-       {
-               g_variant_builder_add (&builder, "{sv}",
-                                                          ACCOUNT_TYPE_DATA_KEY_LABEL_LIST,
-                                                          label_list_to_variant(in_data->label_list));
-       }
-
-       if (in_data->provider_feature_list != NULL)
-       {
-               g_variant_builder_add (&builder, "{sv}",
-                                                          ACCOUNT_TYPE_DATA_KEY_PROVIDER_FEATURE_LIST,
-                                                          provider_feature_list_to_variant(in_data->provider_feature_list));
-       }
-
-
-       _INFO("__marshal_account_type end");
-
-       return g_variant_builder_end (&builder);
-}
-
-account_type_s* umarshal_account_type(GVariant* in_data)
-{
-       if (in_data == NULL)
-       {
-               _ERR("Null input");
-               return NULL;
-       }
-
-       account_type_s* account_type = (account_type_s*)calloc(1, sizeof(account_type_s));
-       if (account_type == NULL)
-       {
-               _ERR("Out of memory");
-               return NULL;
-       }
-
-       GVariantIter iter;
-       gchar *key = NULL;
-       GVariant *value = NULL;
-
-       g_variant_iter_init (&iter, in_data);
-       while (g_variant_iter_next (&iter, "{sv}", &key, &value))
-       {
-               _INFO("[%s]", key);
-
-               if (!strcmp(key, ACCOUNT_TYPE_DATA_KEY_APP_ID))
-               {
-                       _INFO("");
-                       account_type->app_id = g_strdup(g_variant_get_string (value, NULL));
-
-               }
-
-               else if (!strcmp(key, ACCOUNT_TYPE_DATA_KEY_SERVICE_PROVIDER_ID))
-               {
-                       _INFO("");
-                       account_type->service_provider_id = g_strdup(g_variant_get_string (value, NULL));
-
-               }
-
-               else if (!strcmp(key, ACCOUNT_TYPE_DATA_KEY_ICON_PATH))
-               {
-                       _INFO("");
-
-                       account_type->icon_path = g_strdup(g_variant_get_string (value, NULL));
-
-               }
-
-               else if (!strcmp(key, ACCOUNT_TYPE_DATA_KEY_SMALL_ICON_PATH))
-               {
-                       _INFO("");
-
-                       account_type->small_icon_path = g_strdup(g_variant_get_string (value, NULL));
-
-               }
-
-               else if (!strcmp(key, ACCOUNT_TYPE_DATA_KEY_MULTI_SUPPORT))
-               {
-                       _INFO("");
-
-                       account_type->multiple_account_support = g_variant_get_int32 (value);
-
-               }
-
-               else if (!strcmp(key, ACCOUNT_TYPE_DATA_KEY_LABEL_LIST))
-               {
-                       _INFO("");
-
-                       account_type->label_list = variant_to_label_list(value);
-
-               }
-
-               else if (!strcmp(key, ACCOUNT_TYPE_DATA_KEY_PROVIDER_FEATURE_LIST))
-               {
-                       _INFO("");
-
-                       account_type->provider_feature_list = variant_to_provider_feature_list(value);
-
-               }
-
-       }
-       //TODO: support for collections
-
-       return account_type;
-}
-
-GVariant* marshal_account_capability(account_capability_s* capability)
-{
-       _INFO("marshal_account_capability start");
-
-       if (capability == NULL)
-       {
-               _ERR("Null input");
-               return NULL;
-       }
-
-       GVariantBuilder builder;
-       g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT);
-
-       g_variant_builder_add(&builder, "{sv}",
-                                                 ACCOUNT_CAPABILITY_DATA_KEY_ID, g_variant_new_int32(capability->id));
-
-       if (capability->type != NULL)
-       {
-               _INFO("capability->type = %s", capability->type);
-               g_variant_builder_add(&builder, "{sv}",
-                                                         ACCOUNT_CAPABILITY_DATA_KEY_TYPE, g_variant_new_string(capability->type));
-
-       }
-
-       _INFO("capability->value = %d", capability->value);
-       g_variant_builder_add(&builder, "{sv}",
-                                                 ACCOUNT_CAPABILITY_DATA_KEY_VALUE, g_variant_new_int32(capability->value));
-
-       if (capability->package_name != NULL)
-       {
-               g_variant_builder_add(&builder, "{sv}",
-                                                         ACCOUNT_CAPABILITY_DATA_KEY_PACKAGE_NAME, g_variant_new_string(capability->package_name));
-
-       }
-
-       if (capability->user_name != NULL)
-       {
-               g_variant_builder_add(&builder, "{sv}",
-                                                         ACCOUNT_CAPABILITY_DATA_KEY_USER_NAME, g_variant_new_string(capability->user_name));
-
-       }
-
-       g_variant_builder_add(&builder, "{sv}",
-                                                 ACCOUNT_CAPABILITY_DATA_KEY_ACC_ID, g_variant_new_int32(capability->account_id));
-
-       _INFO("marshal_account_capability end");
-
-       return g_variant_builder_end(&builder);
-}
-
-GVariant* marshal_capability_list(GSList* capability_list)
-{
-       _INFO("marshal_capability_list start");
-       if (capability_list == NULL)
-       {
-               _ERR("input NULL.");
-               return NULL;
-       }
-
-       GVariantBuilder builder;
-       account_capability_s *account_capability_data = NULL;
-
-       GSList* iter;
-       g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
-
-       for (iter = capability_list ; iter != NULL; iter = g_slist_next (iter))
-       {
-               _INFO("iterating capability_list");
-               account_capability_data = (account_capability_s *) (iter->data);
-               g_variant_builder_add_value(&builder, marshal_account_capability(account_capability_data));
-               _INFO("end one iteration of capability_list");
-       }
-       _INFO("marshal_capability_list end");
-       return g_variant_builder_end (&builder);
-}
-
-GVariant* marshal_account_custom(account_custom_s* custom)
-{
-       _INFO("marshal_account_custom start");
-
-       if (custom == NULL)
-       {
-               _ERR("Null input");
-               return NULL;
-       }
-
-       GVariantBuilder builder;
-       g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT);
-
-       g_variant_builder_add(&builder, "{sv}",
-                                                 ACCOUNT_CUSTOM_DATA_KEY_ACC_ID, g_variant_new_int32(custom->account_id));
-
-       if (custom->app_id != NULL)
-       {
-               g_variant_builder_add(&builder, "{sv}",
-                                                         ACCOUNT_CUSTOM_DATA_KEY_APP_ID, g_variant_new_string(custom->app_id));
-
-       }
-
-       if (custom->key != NULL)
-       {
-               _INFO("custom->key = %s", custom->key);
-               g_variant_builder_add(&builder, "{sv}",
-                                                         ACCOUNT_CUSTOM_DATA_KEY_KEY, g_variant_new_string(custom->key));
-
-       }
-
-       if (custom->value != NULL)
-       {
-               _INFO("custom->value = %s", custom->value);
-               g_variant_builder_add(&builder, "{sv}",
-                                                         ACCOUNT_CUSTOM_DATA_KEY_VALUE, g_variant_new_string(custom->value));
-
-       }
-
-       _INFO("marshal_account_custom end");
-
-       return g_variant_builder_end(&builder);
-}
-
-GVariant* marshal_custom_list(GSList* custom_list)
-{
-       _INFO("marshal_custom_list start");
-       if (custom_list == NULL)
-       {
-               _ERR("input NULL.");
-               return NULL;
-       }
-
-       GVariantBuilder builder;
-       account_custom_s *account_custom_data = NULL;
-
-       GSList* iter;
-       g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
-
-       for (iter = custom_list ; iter != NULL; iter = g_slist_next (iter))
-       {
-               _INFO("iterating custom_list");
-               account_custom_data = (account_custom_s *) (iter->data);
-               g_variant_builder_add_value(&builder, marshal_account_custom(account_custom_data));
-               _INFO("end one iteration of custom_list");
-       }
-       _INFO("marshal_custom_list end");
-       return g_variant_builder_end (&builder);
-}
-
-GSList* unmarshal_capability_list(GVariant* variant)
-{
-       _INFO("unmarshal_capability_list start");
-       GSList *list = NULL;
-       GVariantIter iter;
-       GVariantIter* iter_row = NULL;
-       const gchar *key = NULL;
-       GVariant *value = NULL;
-
-       if (variant == NULL)
-       {
-               _ERR("input NULL");
-               return NULL;
-       }
-
-       gchar* var_type = g_variant_print (variant, TRUE);
-       _INFO("var_type = %s", var_type);
-
-       _INFO("before iter");
-       g_variant_iter_init (&iter, variant);
-       _INFO("after iter");
-
-       _INFO("g_variant_iter_n_children=%d", g_variant_iter_n_children (&iter));
-
-       while (g_variant_iter_next (&iter, "a{sv}", &iter_row))
-       {
-               _INFO("");
-               account_capability_s* account_capability = (account_capability_s*)calloc(1, sizeof(account_capability_s));
-
-               while (g_variant_iter_loop(iter_row, "{sv}", &key, &value))
-               {
-                       if (!g_strcmp0(key, ACCOUNT_CAPABILITY_DATA_KEY_ID))
-                       {
-                               account_capability->id = g_variant_get_int32(value);
-                               _INFO("[%d]", account_capability->id);
-                       }
-                       else if (!g_strcmp0(key, ACCOUNT_CAPABILITY_DATA_KEY_TYPE))
-                       {
-                               _INFO("account_capability->type = %s", value);
-                               account_capability->type = g_strdup(g_variant_get_string (value, NULL));
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_CAPABILITY_DATA_KEY_VALUE))
-                       {
-                               _INFO("account_capability->value = %s", value);
-
-                               account_capability->value = g_variant_get_int32(value);
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_CAPABILITY_DATA_KEY_PACKAGE_NAME))
-                       {
-                               _INFO("");
-
-                               account_capability->package_name = g_strdup(g_variant_get_string (value, NULL));
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_CAPABILITY_DATA_KEY_USER_NAME))
-                       {
-                               _INFO("");
-
-                               account_capability->user_name = g_strdup(g_variant_get_string (value, NULL));
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_CAPABILITY_DATA_KEY_ACC_ID))
-                       {
-                               _INFO("");
-
-                               account_capability->account_id = g_variant_get_int32(value);
-                       }
-
-               }
-               list = g_slist_append (list, account_capability);
-               _INFO("");
-
-       }
-
-       _INFO("unmarshal_capability_list end");
-       return list;
-}
-
-GSList* unmarshal_custom_list(GVariant* variant)
-{
-       _INFO("unmarshal_custom_list start");
-       GSList *list = NULL;
-       GVariantIter iter;
-       GVariantIter* iter_row = NULL;
-       const gchar *key = NULL;
-       GVariant *value = NULL;
-
-       if (variant == NULL)
-       {
-               _ERR("input NULL");
-               return NULL;
-       }
-
-       gchar* var_type = g_variant_print (variant, TRUE);
-       _INFO("var_type = %s", var_type);
-
-       _INFO("before iter");
-       g_variant_iter_init (&iter, variant);
-       _INFO("after iter");
-
-       _INFO("g_variant_iter_n_children=%d", g_variant_iter_n_children (&iter));
-
-       while (g_variant_iter_next (&iter, "a{sv}", &iter_row))
-       {
-               _INFO("");
-               account_custom_s* account_custom = (account_custom_s*)calloc(1, sizeof(account_custom_s));
-
-               while (g_variant_iter_loop(iter_row, "{sv}", &key, &value))
-               {
-                       if (!g_strcmp0(key, ACCOUNT_CUSTOM_DATA_KEY_ACC_ID))
-                       {
-                               account_custom->account_id = g_variant_get_int32(value);
-                               _INFO("[%d]", account_custom->account_id);
-                       }
-                       else if (!g_strcmp0(key, ACCOUNT_CUSTOM_DATA_KEY_APP_ID))
-                       {
-                               _INFO("");
-                               account_custom->app_id = g_strdup(g_variant_get_string (value, NULL));
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_CUSTOM_DATA_KEY_KEY))
-                       {
-                               _INFO("account_custom->key = %s", value);
-
-                               account_custom->key = g_strdup(g_variant_get_string (value, NULL));
-                       }
-
-                       else if (!g_strcmp0(key, ACCOUNT_CUSTOM_DATA_KEY_VALUE))
-                       {
-                               _INFO("account_custom->value = %s", value);
-
-                               account_custom->value = g_strdup(g_variant_get_string (value, NULL));
-                       }
-               }
-               list = g_slist_append (list, account_custom);
-               _INFO("");
-
-       }
-
-       _INFO("unmarshal_custom_list end");
-       return list;
-}
-
-GVariant* marshal_user_int_array(const int* user_data_int_array)
-{
-       int i;
-
-       _INFO("marshal_user_data_int_list start");
-       if (user_data_int_array == NULL)
-       {
-               _ERR("input NULL.");
-               return NULL;
-       }
-
-       GVariantBuilder builder;
-
-       g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
-
-       for(i = 0; i < USER_INT_CNT; i++)
-       {
-               char key[256];
-               ACCOUNT_SNPRINTF(key, strlen(ACCOUNT_DATA_KEY_USER_DATA_INT)+3, "%s%d", ACCOUNT_DATA_KEY_USER_DATA_INT, i);
-               _INFO("iterating user_data_int[%d]", i);
-               g_variant_builder_add(&builder, "{sv}",
-                               key,
-                               g_variant_new_int32(user_data_int_array[i]));
-               _INFO("marshal user_data_int[%d]=%d, key=%s", i, user_data_int_array[i], key);
-               _INFO("end one iteration of user_data_int");
-       }
-
-       _INFO("marshal_user_data_int_list end");
-       return g_variant_builder_end (&builder);
-}
-
-GVariant* marshal_user_txt_array(char* const* user_data_txt_array)
-{
-       int i;
-
-       _INFO("marshal_user_data_int_list start");
-       if (user_data_txt_array == NULL)
-       {
-               _ERR("input NULL.");
-               return NULL;
-       }
-
-       GVariantBuilder builder;
-
-       g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
-
-       for(i = 0; i < USER_TXT_CNT; i++)
-       {
-               _INFO("iterating user_data_txt[%s]", user_data_txt_array[i]);
-               char key[256];
-               ACCOUNT_SNPRINTF(key, strlen(ACCOUNT_DATA_KEY_USER_DATA_TXT)+3, "%s%d", ACCOUNT_DATA_KEY_USER_DATA_TXT, i);
-               g_variant_builder_add(&builder, "{sv}",
-                               key,
-                               g_variant_new_string(user_data_txt_array[i]));
-               _INFO("end one iteration of user_data_txt");
-       }
-
-       _INFO("marshal_user_data_int_list end");
-       return g_variant_builder_end (&builder);
-}
-
-int* unmarshal_user_int_array(GVariant* variant)
-{
-       _INFO("unmarshal_user_int_array start");
-       GVariantIter iter;
-       const gchar *key = NULL;
-       char compare_key[USER_INT_CNT][256];
-       GVariant *value = NULL;
-       int* user_data_int;
-       int i;
-
-       if (variant == NULL)
-       {
-               _ERR("input NULL");
-               return NULL;
-       }
-
-       gchar* var_type = g_variant_print (variant, TRUE);
-       _INFO("var_type = %s", var_type);
-
-       _INFO("before iter");
-       g_variant_iter_init (&iter, variant);
-       _INFO("after iter");
-
-       user_data_int = (int*)calloc(USER_INT_CNT, sizeof(int));
-
-       for(i=0; i<USER_INT_CNT; i++)
-       {
-               ACCOUNT_SNPRINTF(compare_key[i], strlen(ACCOUNT_DATA_KEY_USER_DATA_INT)+3, "%s%d", ACCOUNT_DATA_KEY_USER_DATA_INT, i);
-       }
-
-       while (g_variant_iter_next (&iter, "{sv}", &key, &value))
-       {
-               for(i=0; i<USER_INT_CNT; i++)
-               {
-                       if (!g_strcmp0(key, compare_key[i]))
-                       {
-                               user_data_int[i] = g_variant_get_int32(value);
-                               _INFO("unmarshal user_data_int[%d]=%d, key=%s, compare=%s", i, user_data_int[i],key, compare_key[i]);
-                       }
-               }
-       }
-
-       _INFO("unmarshal_user_int_array end");
-       return user_data_int;
-}
-
-char** unmarshal_user_txt_array(GVariant* variant)
-{
-       _INFO("unmarshal_user_txt_array start");
-       GVariantIter iter;
-       const gchar *key = NULL;
-       char compare_key[USER_TXT_CNT][256];
-       GVariant *value = NULL;
-       char** user_data_txts;
-       int i;
-
-       if (variant == NULL)
-       {
-               _ERR("input NULL");
-               return NULL;
-       }
-
-       gchar* var_type = g_variant_print (variant, TRUE);
-       _INFO("var_type = %s", var_type);
-
-       _INFO("before iter");
-       g_variant_iter_init (&iter, variant);
-       _INFO("after iter");
-
-       user_data_txts = (char**)calloc(USER_TXT_CNT, sizeof(char*));
-
-       for(i=0; i<USER_TXT_CNT; i++)
-       {
-               ACCOUNT_SNPRINTF(compare_key[i], strlen(ACCOUNT_DATA_KEY_USER_DATA_TXT)+3, "%s%d", ACCOUNT_DATA_KEY_USER_DATA_TXT, i);
-       }
-
-       while (g_variant_iter_next (&iter, "{sv}", &key, &value))
-       {
-               for(i=0; i<USER_TXT_CNT; i++)
-               {
-                       if (!g_strcmp0(key, compare_key[i]))
-                       {
-                               user_data_txts[i] = g_strdup(g_variant_get_string (value, NULL));
-                               _INFO("[%s]", user_data_txts[i]);
-                       }
-               }
-       }
-
-       _INFO("unmarshal_user_txt_array end");
-       return user_data_txts;
-}
diff --git a/src/accounts/common/account_ipc_marshal.h b/src/accounts/common/account_ipc_marshal.h
deleted file mode 100644 (file)
index 39e8405..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *
- * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef __ACC_IPC_MARSHAL_H__
-#define __ACC_IPC_MARSHAL_H__
-
-#include "account-private.h"
-
-ACCOUNT_API GVariant* marshal_account(const account_s* account);
-ACCOUNT_API account_s* umarshal_account(GVariant* in_data);
-
-ACCOUNT_API GVariant* marshal_account_type(const account_type_s* account_type);
-ACCOUNT_API account_type_s* umarshal_account_type(GVariant* in_data);
-
-ACCOUNT_API GVariant* marshal_account_list_double(GList* account_list);
-ACCOUNT_API GVariant* marshal_account_list(GSList* account_list);
-ACCOUNT_API GSList* unmarshal_account_list(GVariant* variant);
-
-ACCOUNT_API GVariant* marshal_account_type_list(GSList* account_type_list);
-ACCOUNT_API GSList* unmarshal_account_type_list(GVariant* variant);
-
-ACCOUNT_API GVariant* marshal_capability_list(GSList* capability_list);
-ACCOUNT_API GSList* unmarshal_capability_list(GVariant* variant);
-
-ACCOUNT_API GVariant* marshal_custom_list(GSList* capability_list);
-ACCOUNT_API GSList* unmarshal_custom_list(GVariant* variant);
-
-ACCOUNT_API GVariant* marshal_user_int_array(const int* user_data_int_array);
-ACCOUNT_API GVariant* marshal_user_txt_array(char* const* user_txt_array);
-
-ACCOUNT_API int* unmarshal_user_int_array(GVariant* variant);
-ACCOUNT_API char** unmarshal_user_txt_array(GVariant* variant);
-
-ACCOUNT_API account_s* create_empty_account_instance(void);
-
-ACCOUNT_API GVariant * provider_feature_list_to_variant (GSList *list);
-ACCOUNT_API GSList* variant_to_provider_feature_list(GVariant *variant);
-
-ACCOUNT_API GVariant *label_list_to_variant (GSList *list);
-ACCOUNT_API GSList *variant_to_label_list (GVariant *variant);
-
-ACCOUNT_API account_type_s* create_empty_account_type_instance(void);
-
-#endif
diff --git a/src/accounts/common/dbg.h b/src/accounts/common/dbg.h
deleted file mode 100644 (file)
index 14e9978..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __DBG_H__
-
-#include <dlog.h>
-
-#ifdef  LOG_TAG
-#undef  LOG_TAG
-#endif
-#define LOG_TAG "org.tizen.accountServer"
-
-#ifndef _ERR
-#define _ERR(fmt, args...) LOGE("[%s:%d] "fmt"\n", __func__, __LINE__, ##args)
-#endif
-
-#ifndef _DBG
-#define _DBG(fmt, args...) LOGD("[%s:%d] "fmt"\n", __func__, __LINE__, ##args)
-#endif
-
-#ifndef _INFO
-#define _INFO(fmt, args...) LOGI("[%s:%d] "fmt"\n", __func__, __LINE__, ##args)
-#endif
-
-
-#endif /* __DBG_H__ */