modified to use record, filter, query apis without connect() 09/121009/1 accepted/tizen/common/20170328.140839 accepted/tizen/ivi/20170328.061810 accepted/tizen/mobile/20170328.061717 accepted/tizen/unified/20170328.061829 accepted/tizen/wearable/20170328.061754 submit/tizen/20170328.040246
authorJongkyu Koo <jk.koo@samsung.com>
Mon, 27 Mar 2017 05:01:03 +0000 (14:01 +0900)
committerJongkyu Koo <jk.koo@samsung.com>
Mon, 27 Mar 2017 05:01:03 +0000 (14:01 +0900)
Change-Id: I625d15518f81998c7edb08647a45761d5d39e8aa
Signed-off-by: Jongkyu Koo <jk.koo@samsung.com>
common/ctsvc_filter.c
common/ctsvc_query.c
common/ctsvc_record.c
common/ctsvc_view.c

index b08282b..d7dac1a 100644 (file)
@@ -50,6 +50,10 @@ EXPORT_API int contacts_filter_create(const char *view_uri, contacts_filter_h *o
 
        RETV_IF(NULL == view_uri, CONTACTS_ERROR_INVALID_PARAMETER);
 
+#ifdef _CONTACTS_IPC_CLIENT
+       ctsvc_view_uri_init();
+#endif
+
        com_filter = calloc(1, sizeof(ctsvc_composite_filter_s));
        RETV_IF(NULL == com_filter, CONTACTS_ERROR_OUT_OF_MEMORY);
 
@@ -311,7 +315,9 @@ static int __ctsvc_composite_filter_destroy(ctsvc_composite_filter_s *com_filter
 EXPORT_API int contacts_filter_destroy(contacts_filter_h filter)
 {
        RETV_IF(NULL == filter, CONTACTS_ERROR_INVALID_PARAMETER);
-
+#ifdef _CONTACTS_IPC_CLIENT
+       ctsvc_view_uri_deinit();
+#endif
        return __ctsvc_composite_filter_destroy((ctsvc_composite_filter_s*)filter);
 }
 
index c639df5..b550457 100644 (file)
@@ -57,6 +57,10 @@ EXPORT_API int contacts_query_create(const char *view_uri, contacts_query_h *out
 
        RETV_IF(NULL == view_uri || NULL == out_query, CONTACTS_ERROR_INVALID_PARAMETER);
 
+#ifdef _CONTACTS_IPC_CLIENT
+       ctsvc_view_uri_init();
+#endif
+
        query = calloc(1, sizeof(ctsvc_query_s));
        RETV_IF(NULL == query, CONTACTS_ERROR_OUT_OF_MEMORY);
 
@@ -137,6 +141,10 @@ EXPORT_API int contacts_query_destroy(contacts_query_h query)
        RETV_IF(NULL == query, CONTACTS_ERROR_INVALID_PARAMETER);
        s_query = (ctsvc_query_s*)query;
 
+#ifdef _CONTACTS_IPC_CLIENT
+       ctsvc_view_uri_deinit();
+#endif
+
        if (s_query->filter)
                contacts_filter_destroy((contacts_filter_h)s_query->filter);
 
index ac7e0cc..615ffd5 100644 (file)
@@ -209,6 +209,10 @@ EXPORT_API int contacts_record_create(const char *view_uri, contacts_record_h *o
        RETV_IF(NULL == out_record, CONTACTS_ERROR_INVALID_PARAMETER);
        *out_record = NULL;
 
+#ifdef _CONTACTS_IPC_CLIENT
+       ctsvc_view_uri_init();
+#endif
+
        r_type = ctsvc_view_get_record_type(view_uri);
        RETVM_IF(CTSVC_RECORD_INVALID == r_type, CONTACTS_ERROR_INVALID_PARAMETER,
                        "view_uri(%s)", view_uri);
@@ -231,6 +235,9 @@ EXPORT_API int contacts_record_destroy(contacts_record_h record, bool delete_chi
 
        RETV_IF(NULL == record, CONTACTS_ERROR_INVALID_PARAMETER);
        s_record = (ctsvc_record_s*)record;
+#ifdef _CONTACTS_IPC_CLIENT
+       ctsvc_view_uri_deinit();
+#endif
 
        if (s_record && s_record->plugin_cbs && s_record->plugin_cbs->destroy)
                return s_record->plugin_cbs->destroy(record, delete_child);
index 0751395..b1f4f64 100644 (file)
@@ -1375,6 +1375,7 @@ void ctsvc_view_uri_deinit()
        __ctsvc_view_ref_count--;
        if (__ctsvc_view_ref_count != 0)
                return;
+#endif
 
        if (NULL == __ctsvc_view_uri_hash) {
                ERR("contacts-service is not initialized");
@@ -1383,7 +1384,7 @@ void ctsvc_view_uri_deinit()
 
        g_hash_table_destroy(__ctsvc_view_uri_hash);
        __ctsvc_view_uri_hash = NULL;
-#endif
+
 }
 
 ctsvc_record_type_e ctsvc_view_get_record_type(const char *view_uri)