remove ifdef ENABLE_SIM_FEATURE (using telephony feature) 68/44968/2
authorGukhwan Cho <gh78.cho@samsung.com>
Thu, 18 Jun 2015 09:57:32 +0000 (18:57 +0900)
committerMyungHoon Chae <mhoon.chae@samsung.com>
Tue, 4 Aug 2015 05:01:21 +0000 (22:01 -0700)
Change-Id: I44a257354dcf0ad0a92e35bde90585520601bb5e
Signed-off-by: Gukhwan Cho <gh78.cho@samsung.com>
17 files changed:
CMakeLists.txt
client/CMakeLists.txt
common/ctsvc_record.c
common/ctsvc_record_result.c
common/ctsvc_sim.c
common/ctsvc_socket.c
common/ctsvc_socket.h
common/ctsvc_view.c
common/ipc/ctsvc_ipc_marshal.c
native/ctsvc_db_init.c
native/ctsvc_db_plugin_phonelog.c
native/ctsvc_db_query.c
native/ctsvc_phonelog.c
packaging/contacts-service.spec
server/CMakeLists.txt
server/ctsvc_server_socket.c
server/ctsvc_server_utils.c

index 485006e..31949e5 100755 (executable)
@@ -35,9 +35,6 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC")
 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
 
 # for tizen open build test
-IF(ENABLE_SIM_FEATURE)
-       ADD_DEFINITIONS("-DENABLE_SIM_FEATURE")
-ENDIF(ENABLE_SIM_FEATURE)
 IF(ENABLE_LOG_FEATURE)
        ADD_DEFINITIONS("-DENABLE_LOG_FEATURE")
 ENDIF(ENABLE_LOG_FEATURE)
index 4c2db0a..a4e6bb0 100755 (executable)
@@ -62,17 +62,13 @@ SET(SRCS
        ${CMAKE_SOURCE_DIR}/common/ctsvc_socket.c
        ${CMAKE_SOURCE_DIR}/common/ctsvc_vcard.c
        ${CMAKE_SOURCE_DIR}/common/ctsvc_view.c
-)
 
-IF(ENABLE_SIM_FEATURE)
-SET(SRCS ${SRCS}
        ${CMAKE_SOURCE_DIR}/common/ipc/ctsvc_ipc_sdn.c
        ${CMAKE_SOURCE_DIR}/common/ctsvc_record_sdn.c
        ${CMAKE_SOURCE_DIR}/common/ctsvc_sim.c
        ${CMAKE_SOURCE_DIR}/common/ipc/ctsvc_ipc_speeddial.c
        ${CMAKE_SOURCE_DIR}/common/ctsvc_record_speeddial.c
 )
-ENDIF(ENABLE_SIM_FEATURE)
 
 IF(ENABLE_LOG_FEATURE)
 SET(SRCS ${SRCS}
index 46b2933..09cd022 100644 (file)
@@ -52,10 +52,8 @@ extern ctsvc_record_plugin_cb_s profile_plugin_cbs;
 extern ctsvc_record_plugin_cb_s nickname_plugin_cbs;
 extern ctsvc_record_plugin_cb_s email_plugin_cbs;
 extern ctsvc_record_plugin_cb_s result_plugin_cbs;
-#ifdef ENABLE_SIM_FEATURE
 extern ctsvc_record_plugin_cb_s sdn_plugin_cbs;
 extern ctsvc_record_plugin_cb_s speeddial_plugin_cbs;
-#endif /* ENABLE_SIM_FEATURE */
 extern ctsvc_record_plugin_cb_s extension_plugin_cbs;
 #ifdef ENABLE_LOG_FEATURE
 extern ctsvc_record_plugin_cb_s phonelog_plugin_cbs;
@@ -114,12 +112,10 @@ static const ctsvc_record_plugin_cb_s *__ctsvc_record_get_plugin_cb(int r_type)
        case CTSVC_RECORD_PHONELOG:
                return &phonelog_plugin_cbs;
 #endif /* ENABLE_LOG_FEATURE */
-#ifdef ENABLE_SIM_FEATURE
        case CTSVC_RECORD_SPEEDDIAL:
                return &speeddial_plugin_cbs;
        case CTSVC_RECORD_SDN:
                return &sdn_plugin_cbs;
-#endif /* ENABLE_SIM_FEATURE */
        case CTSVC_RECORD_UPDATED_INFO:
                return &updated_info_plugin_cbs;
        case CTSVC_RECORD_RESULT:
index 76e7fcb..16e3474 100644 (file)
 #include "ctsvc_notify.h"
 
 #ifdef _CONTACTS_IPC_SERVER
-#ifdef ENABLE_SIM_FEATURE
 #include "ctsvc_server_sim.h"
-#endif /* ENABLE_SIM_FEATURE */
-#endif
+#endif /* _CONTACTS_IPC_SERVER */
 
 static int __ctsvc_result_create(contacts_record_h* out_record);
 static int __ctsvc_result_destroy(contacts_record_h record, bool delete_child);
@@ -222,13 +220,10 @@ static int __ctsvc_result_set_int(contacts_record_h record, unsigned int propert
                if (data->property_id == property_id) {
                        if (data->type == CTSVC_VIEW_DATA_TYPE_INT) {
 #ifdef _CONTACTS_IPC_SERVER
-#ifdef ENABLE_SIM_FEATURE
-
                                if (property_id == CTSVC_PROPERTY_PHONELOG_SIM_SLOT_NO)
                                        data->value.i = ctsvc_server_sim_get_sim_slot_no_by_info_id(value);
                                else
-#endif /* ENABLE_SIM_FEATURE */
-#endif
+#endif /* _CONTACTS_IPC_SERVER */
                                data->value.i = value;
                                return CONTACTS_ERROR_NONE;
                        }
@@ -247,12 +242,10 @@ static int __ctsvc_result_set_int(contacts_record_h record, unsigned int propert
        data->property_id = property_id;
        data->type = CTSVC_VIEW_DATA_TYPE_INT;
 #ifdef _CONTACTS_IPC_SERVER
-#ifdef ENABLE_SIM_FEATURE
        if (property_id == CTSVC_PROPERTY_PHONELOG_SIM_SLOT_NO)
                data->value.i = ctsvc_server_sim_get_sim_slot_no_by_info_id(value);
        else
-#endif /* ENABLE_SIM_FEATURE */
-#endif
+#endif /* _CONTACTS_IPC_SERVER */
        data->value.i = value;
        result->values = g_slist_append(result->values, (void*)data);
        return CONTACTS_ERROR_NONE;
index 5e350e6..0ab3684 100644 (file)
 
 API int contacts_sim_import_all_contacts()
 {
-#ifndef ENABLE_SIM_FEATURE
-       return CONTACTS_ERROR_NOT_SUPPORTED;
-#endif /* ENABLE_SIM_FEATURE */
-
        int ret;
 
        ctsvc_mutex_lock(CTS_MUTEX_SOCKET_FD);
@@ -43,10 +39,6 @@ API int contacts_sim_import_all_contacts()
 
 API int contacts_sim_get_initialization_status(bool *completed)
 {
-#ifndef ENABLE_SIM_FEATURE
-       return CONTACTS_ERROR_NOT_SUPPORTED;
-#endif /* ENABLE_SIM_FEATURE */
-
        int ret;
 
        RETVM_IF(completed == NULL, CONTACTS_ERROR_INVALID_PARAMETER,
index 685d918..35b56dd 100644 (file)
@@ -115,7 +115,6 @@ static inline int __ctsvc_safe_read(int fd, char *buf, int buf_size)
        return read_size;
 }
 
-#ifdef ENABLE_SIM_FEATURE
 static int __ctsvc_socket_handle_return(int fd, ctsvc_socket_msg_s *msg)
 {
        CTS_FN_CALL;
@@ -233,5 +232,3 @@ int ctsvc_request_sim_get_initialization_status(int sim_slot_no, bool *completed
 
        return msg.val;
 }
-
-#endif /* ENABLE_SIM_FEATURE */
index 0ee8963..c47184f 100644 (file)
@@ -46,11 +46,8 @@ typedef struct{
        int attach_sizes[CTSVC_SOCKET_MSG_REQUEST_MAX_ATTACH];
 }ctsvc_socket_msg_s;
 
-#ifdef ENABLE_SIM_FEATURE
 int ctsvc_request_sim_import(int sim_slot_no);
 int ctsvc_request_sim_get_initialization_status(int sim_slot_no, bool* completed);
-#endif /* ENABLE_SIM_FEATURE */
-
 int ctsvc_socket_init(void);
 void ctsvc_socket_final(void);
 
index 193048b..f2f87e2 100644 (file)
@@ -297,7 +297,6 @@ API const _contacts_messenger_property_ids _contacts_messenger = {
        .im_id          = CTSVC_PROPERTY_MESSENGER_IM_ID,
 };
 
-#ifdef ENABLE_SIM_FEATURE
 API const _contacts_sdn_property_ids _contacts_sdn = {
        ._uri   = CTSVC_VIEW_URI_SDN,
        .id             = CTSVC_PROPERTY_SDN_ID,
@@ -320,7 +319,6 @@ API const _contacts_speeddial_property_ids _contacts_speeddial = {
        .cleaned_number         = CTSVC_PROPERTY_SPEEDDIAL_CLEANED_NUMBER,
        .number_filter          = CTSVC_PROPERTY_SPEEDDIAL_NUMBER_FILTER,
 };
-#endif /* ENABLE_SIM_FEATURE */
 
 API const _contacts_contact_updated_info_property_ids _contacts_contact_updated_info = {
        ._uri                   = CTSVC_VIEW_URI_CONTACTS_UPDATED_INFO,
@@ -666,14 +664,12 @@ const property_info_s __property_addressbook[] = {
        {CTSVC_PROPERTY_ADDRESSBOOK_MODE,               CTSVC_SEARCH_PROPERTY_ALL,      "mode"},
 };
 
-#ifdef ENABLE_SIM_FEATURE
 const property_info_s __property_sdn[] = {   /* _contacts_sdn */
        {CTSVC_PROPERTY_SDN_ID,         CTSVC_SEARCH_PROPERTY_ALL,      "id"},
        {CTSVC_PROPERTY_SDN_NAME,               CTSVC_SEARCH_PROPERTY_ALL,      "name"},
        {CTSVC_PROPERTY_SDN_NUMBER,     CTSVC_SEARCH_PROPERTY_ALL,      "number"},
        {CTSVC_PROPERTY_SDN_SIM_SLOT_NO,        CTSVC_SEARCH_PROPERTY_ALL,      "sim_slot_no"},
 };
-#endif /* ENABLE_SIM_FEATURE */
 
 const property_info_s __property_group[] = {
        {CTSVC_PROPERTY_GROUP_ID,                               CTSVC_SEARCH_PROPERTY_ALL,      "group_id"},
@@ -953,7 +949,6 @@ const property_info_s __property_my_profile[] = {
        {CTSVC_PROPERTY_MY_PROFILE_EXTENSION,                   CTSVC_SEARCH_PROPERTY_NONE,(void*)__property_extension},
 };
 
-#ifdef ENABLE_SIM_FEATURE
 const property_info_s __property_speeddial[] = {   /* _contacts_speeddial */
        {CTSVC_PROPERTY_SPEEDDIAL_DIAL_NUMBER,          CTSVC_SEARCH_PROPERTY_ALL,      "speed_number"},
        {CTSVC_PROPERTY_SPEEDDIAL_NUMBER_ID,                    CTSVC_SEARCH_PROPERTY_ALL,      "number_id"},
@@ -967,7 +962,6 @@ const property_info_s __property_speeddial[] = {   /* _contacts_speeddial */
        {CTSVC_PROPERTY_SPEEDDIAL_CLEANED_NUMBER,       CTSVC_SEARCH_PROPERTY_FILTER,   "cleaned_number"},
        {CTSVC_PROPERTY_SPEEDDIAL_NUMBER_FILTER,        CTSVC_SEARCH_PROPERTY_FILTER,   "minmatch"},
 };
-#endif /* ENABLE_SIM_FEATURE */
 
 #ifdef ENABLE_LOG_FEATURE
 const property_info_s __property_phonelog[] = {   /* _contacts_phone_log */
@@ -985,25 +979,6 @@ const property_info_s __property_phonelog[] = {   /* _contacts_phone_log */
 };
 #endif /* ENABLE_LOG_FEATURE */
 
-#if 0
-const property_info_s __property_updated_info[] = {
-       {CTSVC_PROPERTY_UPDATE_INFO_ID,                                 CTSVC_SEARCH_PROPERTY_ALL,      "id"},
-       {CTSVC_PROPERTY_UPDATE_INFO_ADDRESSBOOK_ID, CTSVC_SEARCH_PROPERTY_ALL,  "addressbook_id"},
-       {CTSVC_PROPERTY_UPDATE_INFO_TYPE,                       CTSVC_SEARCH_PROPERTY_ALL,      "type"},
-       {CTSVC_PROPERTY_UPDATE_INFO_VERSION,            CTSVC_SEARCH_PROPERTY_ALL,      "version"},
-       {CTSVC_PROPERTY_UPDATE_INFO_IMAGE_CHANGED,      CTSVC_SEARCH_PROPERTY_ALL,      "image_changed"},
-       {CTSVC_PROPERTY_UPDATE_INFO_LAST_CHANGED_TYPE,  CTSVC_SEARCH_PROPERTY_ALL,      "is_deleted"},
-};
-
-const property_info_s __property_grouprel_updated_info[] = {
-       {CTSVC_PROPERTY_GROUP_ID,                               CTSVC_SEARCH_PROPERTY_ALL,      "group_id"},
-       {CTSVC_PROPERTY_CONTACT_ID,                     CTSVC_SEARCH_PROPERTY_ALL,      "id"},
-       {CTSVC_PROPERTY_ADDRESSBOOK_ID,         CTSVC_SEARCH_PROPERTY_ALL,      "addressbook_id"},
-       {CTSVC_PROPERTY_UPDATE_INFO_TYPE,       CTSVC_SEARCH_PROPERTY_ALL,      "type"},
-       {CTSVC_PROPERTY_UPDATE_INFO_VERSION,    CTSVC_SEARCH_PROPERTY_ALL,      "version"},
-};
-#endif
-
 /* search properties */
 const property_info_s __property_person_contact[] = {   /* _contacts_person_contact */
        {CTSVC_PROPERTY_PERSON_ID,                                              CTSVC_SEARCH_PROPERTY_ALL,      "person_id"},
@@ -1272,10 +1247,8 @@ static const view_uri_info_s __tables[] = {
 #ifdef ENABLE_LOG_FEATURE
        {CTSVC_VIEW_URI_PHONELOG,               CTSVC_RECORD_PHONELOG,                  PTR_COUNT(__property_phonelog)},
 #endif /* ENABLE_LOG_FEATURE */
-#ifdef ENABLE_SIM_FEATURE
        {CTSVC_VIEW_URI_SPEEDDIAL,              CTSVC_RECORD_SPEEDDIAL,                 PTR_COUNT(__property_speeddial)},
        {CTSVC_VIEW_URI_SDN,                    CTSVC_RECORD_SDN,                               PTR_COUNT(__property_sdn)},
-#endif /* ENABLE_SIM_FEATURE */
 
        {CTSVC_VIEW_URI_NAME,                   CTSVC_RECORD_NAME,                              PTR_COUNT(__property_name)},
        {CTSVC_VIEW_URI_COMPANY,                CTSVC_RECORD_COMPANY,                   PTR_COUNT(__property_company)},
index 17331d8..15f6b78 100644 (file)
@@ -36,10 +36,8 @@ extern ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_person_plugin_cb;
 extern ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_phonelog_plugin_cb;
 #endif /* ENABLE_LOG_FEATURE */
 extern ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_result_plugin_cb;
-#ifdef ENABLE_SIM_FEATURE
 extern ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_sdn_plugin_cb;
 extern ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_speeddial_plugin_cb;
-#endif /* ENABLE_SIM_FEATURE */
 extern ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_updated_info_plugin_cb;
 
 extern ctsvc_ipc_marshal_record_plugin_cb_s _ctsvc_ipc_record_simple_contact_plugin_cb;
@@ -89,12 +87,10 @@ static ctsvc_ipc_marshal_record_plugin_cb_s* __ctsvc_ipc_marshal_get_plugin_cb(c
        case CTSVC_RECORD_PHONELOG:
                return (&_ctsvc_ipc_record_phonelog_plugin_cb);
 #endif /* ENABLE_LOG_FEATURE */
-#ifdef ENABLE_SIM_FEATURE
        case CTSVC_RECORD_SPEEDDIAL:
                return (&_ctsvc_ipc_record_speeddial_plugin_cb);
        case CTSVC_RECORD_SDN:
                return (&_ctsvc_ipc_record_sdn_plugin_cb);
-#endif /* ENABLE_SIM_FEATURE */
        case CTSVC_RECORD_RESULT:
                return (&_ctsvc_ipc_record_result_plugin_cb);
        case CTSVC_RECORD_SIMPLE_CONTACT:
index 3e017fa..40b7dc1 100644 (file)
@@ -42,10 +42,8 @@ extern ctsvc_db_plugin_info_s ctsvc_db_plugin_person;
 #ifdef ENABLE_LOG_FEATURE
 extern ctsvc_db_plugin_info_s ctsvc_db_plugin_phonelog;
 #endif /* ENABLE_LOG_FEATURE */
-#ifdef ENABLE_SIM_FEATURE
 extern ctsvc_db_plugin_info_s ctsvc_db_plugin_speeddial;
 extern ctsvc_db_plugin_info_s ctsvc_db_plugin_sdn;
-#endif /* ENABLE_SIM_FEATURE */
 extern ctsvc_db_plugin_info_s ctsvc_db_plugin_activity;
 extern ctsvc_db_plugin_info_s ctsvc_db_plugin_activity_photo;
 extern ctsvc_db_plugin_info_s ctsvc_db_plugin_address;
@@ -302,12 +300,10 @@ ctsvc_db_plugin_info_s* ctsvc_db_get_plugin_info(ctsvc_record_type_e type)
        case CTSVC_RECORD_PHONELOG:
                return &ctsvc_db_plugin_phonelog;
 #endif /* ENABLE_LOG_FEATURE */
-#ifdef ENABLE_SIM_FEATURE
        case CTSVC_RECORD_SPEEDDIAL:
                return &ctsvc_db_plugin_speeddial;
        case CTSVC_RECORD_SDN:
                return &ctsvc_db_plugin_sdn;
-#endif /* ENABLE_SIM_FEATURE */
        case CTSVC_RECORD_UPDATED_INFO:
        case CTSVC_RECORD_RESULT:
        default:
@@ -671,7 +667,6 @@ static int __ctsvc_db_create_views()
        ret = ctsvc_query_exec(query);
        RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "DB error : ctsvc_query_exec() Fail(%d)", ret);
 
-#ifdef ENABLE_SIM_FEATURE
        /* CTSVC_DB_VIEW_SPEEDIDAL */
        snprintf(query, sizeof(query),
                "CREATE VIEW IF NOT EXISTS "CTSVC_DB_VIEW_SPEEDIDAL" AS "
@@ -700,8 +695,6 @@ static int __ctsvc_db_create_views()
                        "ORDER BY speeddials.speed_number");
        ret = ctsvc_query_exec(query);
        RETVM_IF(CONTACTS_ERROR_NONE != ret, ret, "DB error : ctsvc_query_exec() Fail(%d)", ret);
-#endif /* ENABLE_SIM_FEATURE */
-
 
        /* CTSVC_DB_VIEW_PERSON_CONTACT */
        snprintf(query, sizeof(query),
index c92cd1d..9c9816b 100644 (file)
 
 #ifdef _CONTACTS_IPC_SERVER
 #include "ctsvc_server_change_subject.h"
-#ifdef ENABLE_SIM_FEATURE
 #include "ctsvc_server_sim.h"
-#endif /* ENABLE_SIM_FEATURE */
-#endif
+#endif /* _CONTACTS_IPC_SERVER */
 
 static int __ctsvc_db_phonelog_insert_record(contacts_record_h record, int *id);
 static int __ctsvc_db_phonelog_get_record(int id, contacts_record_h* out_record);
@@ -91,10 +89,8 @@ static int __ctsvc_db_phonelog_value_set(cts_stmt stmt, contacts_record_h *recor
        temp = ctsvc_stmt_get_text(stmt, i++);
        phonelog->extra_data2 = SAFE_STRDUP(temp);
 #ifdef _CONTACTS_IPC_SERVER
-#ifdef ENABLE_SIM_FEATURE
        phonelog->sim_slot_no = ctsvc_server_sim_get_sim_slot_no_by_info_id(ctsvc_stmt_get_int(stmt, i++));
-#endif /* ENABLE_SIM_FEATURE */
-#endif
+#endif /* _CONTACTS_IPC_SERVER */
        return CONTACTS_ERROR_NONE;
 }
 
@@ -349,11 +345,9 @@ static int __ctsvc_db_phonelog_get_records_with_query(contacts_query_h query, in
                                free(phonelog->extra_data2);
                                phonelog->extra_data2 = SAFE_STRDUP(temp);
                                break;
-#ifdef ENABLE_SIM_FEATURE
                        case CTSVC_PROPERTY_PHONELOG_SIM_SLOT_NO:
                                phonelog->sim_slot_no = ctsvc_server_sim_get_sim_slot_no_by_info_id(ctsvc_stmt_get_int(stmt, i));
                                break;
-#endif /* ENABLE_SIM_FEATURE */
                        default:
                                break;
                        }
@@ -453,7 +447,6 @@ static int  __ctsvc_db_phonelog_insert(ctsvc_phonelog_s *phonelog, int *id)
        if (phonelog->extra_data2)
                ctsvc_stmt_bind_text(stmt, 6, phonelog->extra_data2);
 
-#ifdef ENABLE_SIM_FEATURE
        if (0 <= phonelog->sim_slot_no) {
                int sim_info_id;
                sim_info_id = ctsvc_server_sim_get_info_id_by_sim_slot_no(phonelog->sim_slot_no);
@@ -461,7 +454,6 @@ static int  __ctsvc_db_phonelog_insert(ctsvc_phonelog_s *phonelog, int *id)
                        ctsvc_stmt_bind_int(stmt, 7, sim_info_id);
        }
        else
-#endif /* ENABLE_SIM_FEATURE */
                ctsvc_stmt_bind_int(stmt, 7, -1);
 
        ret = ctsvc_stmt_step(stmt);
index b9e3ee5..1b88efa 100644 (file)
 #include "ctsvc_db_plugin_company_helper.h"
 
 #ifdef _CONTACTS_IPC_SERVER
-#ifdef ENABLE_SIM_FEATURE
 #include "ctsvc_server_sim.h"
-#endif /* ENABLE_SIM_FEATURE */
 #include "ctsvc_server_change_subject.h"
-#endif
+#endif /* _CONTACTS_IPC_SERVER */
 
 /* It is used to sort search results */
 const char *hangul_syllable[19][3] = {
@@ -152,7 +150,6 @@ static inline int __ctsvc_db_create_int_condition(ctsvc_composite_filter_s *com_
                        "Invalid parameter : property id(%d)", filter->property_id);
 
 #ifdef _CONTACTS_IPC_SERVER
-#ifdef ENABLE_SIM_FEATURE
        if (filter->property_id == CTSVC_PROPERTY_PHONELOG_SIM_SLOT_NO) {
                /* get real sim info id by SIM slot number 0/1 */
                int sim_info_id = ctsvc_server_sim_get_info_id_by_sim_slot_no(filter->value.i);
@@ -163,8 +160,7 @@ static inline int __ctsvc_db_create_int_condition(ctsvc_composite_filter_s *com_
                }
                return CONTACTS_ERROR_INVALID_PARAMETER;
        }
-#endif /* ENABLE_SIM_FEATURE */
-#endif
+#endif /* _CONTACTS_IPC_SERVER */
 
        switch(filter->match) {
        case CONTACTS_MATCH_EQUAL:
index 51eb1a2..8bbb494 100644 (file)
 
 #ifdef _CONTACTS_IPC_SERVER
 #include "ctsvc_server_change_subject.h"
-#ifdef ENABLE_SIM_FEATURE
 #include "ctsvc_server_sim.h"
-#endif /* ENABLE_SIM_FEATURE */
-#endif
+#endif /* _CONTACTS_IPC_SERVER */
 
 API int contacts_phone_log_reset_statistics()
 {
index ae5502c..6a3005a 100644 (file)
@@ -62,7 +62,6 @@ export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
 
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 %cmake . -DTZ_SYS_ETC=%TZ_SYS_ETC \
--DENABLE_SIM_FEATURE:BOOL=ON \
 -DENABLE_LOG_FEATURE:BOOL=ON \
 -DMAJORVER=${MAJORVER} \
 -DFULLVER=%{version}
index 812e8b2..9aa9acc 100755 (executable)
@@ -154,10 +154,7 @@ SET(SRCS
        ctsvc_server_update.c
        ctsvc_server_bg.c
        ctsvc_server.c
-)
 
-IF(ENABLE_SIM_FEATURE)
-SET(SRCS ${SRCS}
        ${CMAKE_SOURCE_DIR}/common/ipc/ctsvc_ipc_sdn.c
        ${CMAKE_SOURCE_DIR}/common/ctsvc_record_sdn.c
        ${CMAKE_SOURCE_DIR}/native/ctsvc_db_plugin_sdn.c
@@ -166,7 +163,6 @@ SET(SRCS ${SRCS}
        ${CMAKE_SOURCE_DIR}/native/ctsvc_db_plugin_speeddial.c
        ctsvc_server_sim.c
 )
-ENDIF(ENABLE_SIM_FEATURE)
 
 IF(ENABLE_LOG_FEATURE)
 SET(SRCS ${SRCS}
index b82e30f..09b6852 100644 (file)
 #include <errno.h>
 #include <pims-ipc-svc.h>
 
-#ifdef ENABLE_SIM_FEATURE
 #include <cynara-client.h>
 #include <cynara-error.h>
 #include <cynara-session.h>
 #include <cynara-creds-socket.h>
-#endif
 
 #include "contacts.h"
 #include "ctsvc_internal.h"
 #include "ctsvc_server_socket.h"
 #include "ctsvc_server_utils.h"
 
-#ifdef ENABLE_SIM_FEATURE
 #include "ctsvc_mutex.h"
 #include "ctsvc_server_sim.h"
 #include "ctsvc_db_access_control.h"
-#endif
 
 
 
 
 static int sockfd = -1;
 
-#ifdef ENABLE_SIM_FEATURE
 struct client_info {
        char *smack;
        char *uid;
        char *client_session;
 };
 static GHashTable *_client_info_table = NULL; // key : socket_fd, value : struct client_info*
-#endif
 
 static inline int __ctsvc_server_socket_safe_write(int fd, char *buf, int buf_size)
 {
@@ -127,7 +121,6 @@ int ctsvc_server_socket_return(GIOChannel *src, int value, int attach_num, int *
        return CONTACTS_ERROR_NONE;
 }
 
-#ifdef ENABLE_SIM_FEATURE
 static void __ctsvc_server_socket_import_sim(GIOChannel *src, int size)
 {
        CTS_FN_CALL;
@@ -227,10 +220,8 @@ static void __ctsvc_server_socket_read_flush(GIOChannel *src, int size)
                g_error_free(gerr);
        }
 }
-#endif /* ENABLIE_SIM_FEATURE */
 
 
-#ifdef ENABLE_SIM_FEATURE
 static cynara *_cynara = NULL;
 static int _ctsvc_server_initialize_cynara()
 {
@@ -246,9 +237,7 @@ static int _ctsvc_server_initialize_cynara()
        }
        return CONTACTS_ERROR_NONE;
 }
-#endif
 
-#ifdef ENABLE_SIM_FEATURE
 static void _ctsvc_server_finalize_cynara()
 {
        int ret;
@@ -263,9 +252,7 @@ static void _ctsvc_server_finalize_cynara()
                CTS_ERR("cynara_finish() Fail(%d,%s)", ret, errmsg);
        }
 }
-#endif
 
-#ifdef ENABLE_SIM_FEATURE
 static bool _ctsvc_server_check_privilege(struct client_info *info, const char *privilege)
 {
        RETVM_IF(NULL == info, false, "info is NULL");
@@ -278,29 +265,24 @@ static bool _ctsvc_server_check_privilege(struct client_info *info, const char *
 
        return false;
 }
-#endif
 
 static gboolean __ctsvc_server_socket_request_handler(GIOChannel *src, GIOCondition condition,
                gpointer data)
 {
        int ret;
        int fd;
-#ifdef ENABLE_SIM_FEATURE
        bool have_read_permission = false;
        bool have_write_permission = false;
-#endif /* ENABLE_SIM_FEATURE */
 
        ctsvc_socket_msg_s msg = {0};
        CTS_FN_CALL;
        fd = g_io_channel_unix_get_fd(src);
 
        if (G_IO_HUP & condition) {
-#ifdef ENABLE_SIM_FEATURE
                ctsvc_mutex_lock(CTS_MUTEX_SOCKET_CLIENT_INFO);
                if (_client_info_table)
                        g_hash_table_remove(_client_info_table, GINT_TO_POINTER(fd));
                ctsvc_mutex_unlock(CTS_MUTEX_SOCKET_CLIENT_INFO);
-#endif
                close(fd);
                return FALSE;
        }
@@ -319,7 +301,6 @@ static gboolean __ctsvc_server_socket_request_handler(GIOChannel *src, GIOCondit
                return TRUE;
        }
 
-#ifdef ENABLE_SIM_FEATURE
        ctsvc_mutex_lock(CTS_MUTEX_SOCKET_CLIENT_INFO);
        struct client_info *info = g_hash_table_lookup(_client_info_table, GINT_TO_POINTER(fd));
        have_read_permission = _ctsvc_server_check_privilege(info, CTSVC_PRIVILEGE_CONTACT_READ);
@@ -330,10 +311,8 @@ static gboolean __ctsvc_server_socket_request_handler(GIOChannel *src, GIOCondit
        if (!have_write_permission)
                INFO("fd(%d) : does not have contact write permission", fd);
        ctsvc_mutex_unlock(CTS_MUTEX_SOCKET_CLIENT_INFO);
-#endif /* ENABLE_SIM_FEATURE */
 
        switch (msg.type) {
-#ifdef ENABLE_SIM_FEATURE
        case CTSVC_SOCKET_MSG_TYPE_REQUEST_IMPORT_SIM:
                if (false == have_write_permission) {
                        CTS_ERR("write permission denied");
@@ -352,7 +331,6 @@ static gboolean __ctsvc_server_socket_request_handler(GIOChannel *src, GIOCondit
                }
                __ctsvc_server_socket_get_sim_init_status(src, msg.attach_sizes[0]);
                break;
-#endif /* ENABLE_SIM_FEATURE */
        default:
                CTS_ERR("Unknown request type(%d)", msg.type);
                break;
@@ -360,7 +338,6 @@ static gboolean __ctsvc_server_socket_request_handler(GIOChannel *src, GIOCondit
        return TRUE;
 }
 
-#ifdef ENABLE_SIM_FEATURE
 static void _ctsvc_server_destroy_client_info(gpointer p)
 {
        struct client_info *info = p;
@@ -372,9 +349,7 @@ static void _ctsvc_server_destroy_client_info(gpointer p)
        free(info->client_session);
        free(info);
 }
-#endif
 
-#ifdef ENABLE_SIM_FEATURE
 static int _ctsvc_server_create_client_info(int fd, struct client_info **p_info)
 {
        int ret;
@@ -421,7 +396,6 @@ static int _ctsvc_server_create_client_info(int fd, struct client_info **p_info)
 
        return CONTACTS_ERROR_NONE;
 }
-#endif
 
 
 static gboolean __ctsvc_server_socket_handler(GIOChannel *src,
@@ -438,7 +412,6 @@ static gboolean __ctsvc_server_socket_handler(GIOChannel *src,
        client_sockfd = accept(sockfd, (struct sockaddr *)&clientaddr, &client_len);
        RETVM_IF(-1 == client_sockfd, TRUE, "accept() Fail(errno = %d)", errno);
 
-#ifdef ENABLE_SIM_FEATURE
        if (NULL == _client_info_table)
                _client_info_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, _ctsvc_server_destroy_client_info);
        struct client_info *info = NULL;
@@ -447,7 +420,6 @@ static gboolean __ctsvc_server_socket_handler(GIOChannel *src,
                CTS_ERR("_create_client_info() Fail(%d)", ret);
        else
                g_hash_table_insert(_client_info_table, GINT_TO_POINTER(client_sockfd), info);
-#endif
 
        channel = g_io_channel_unix_new(client_sockfd);
        g_io_add_watch(channel, G_IO_IN|G_IO_HUP, __ctsvc_server_socket_request_handler, NULL);
@@ -464,9 +436,7 @@ int ctsvc_server_socket_init(void)
        struct sockaddr_un addr;
        GIOChannel *gio;
 
-#ifdef ENABLE_SIM_FEATURE
        _ctsvc_server_initialize_cynara();
-#endif
 
        char sock_file[CTSVC_PATH_MAX_LEN] = {0};
        snprintf(sock_file, sizeof(sock_file), CTSVC_SOCK_PATH"/%s", getuid(), CTSVC_SOCKET_FILE);
@@ -505,9 +475,7 @@ int ctsvc_server_socket_init(void)
 
 int ctsvc_server_socket_deinit(void)
 {
-#ifdef ENABLE_SIM_FEATURE
        _ctsvc_server_finalize_cynara();
-#endif
        if (sockfd != -1)
                close(sockfd);
        return CONTACTS_ERROR_NONE;
index befd2b8..4b5fbb4 100644 (file)
@@ -28,9 +28,7 @@
 #include "ctsvc_internal.h"
 #include "ctsvc_setting.h"
 #include "ctsvc_server_utils.h"
-#ifdef ENABLE_SIM_FEATURE
 #include "ctsvc_server_sim.h"
-#endif /* ENABLE_SIM_FEATURE */
 #include "ctsvc_server_sqlite.h"
 #include "ctsvc_localize.h"
 #include "ctsvc_normalize.h"
@@ -124,9 +122,7 @@ void ctsvc_server_final_configuration(void)
        ret = vconf_ignore_key_changed(VCONFKEY_LANGSET, __ctsvc_server_change_language_cb);
        RETM_IF(ret<0,"vconf_ignore_key_changed(%s) Fail(%d)", VCONFKEY_LANGSET, ret);
 
-#ifdef ENABLE_SIM_FEATURE
        ctsvc_server_sim_final();
-#endif /* ENABLE_SIM_FEATURE */
 }
 
 int ctsvc_server_init_configuration(void)
@@ -154,10 +150,8 @@ int ctsvc_server_init_configuration(void)
        RETVM_IF(ret<0, CONTACTS_ERROR_SYSTEM, "vconf_notify_key_changed(%s) Fail(%d)",
                        VCONFKEY_LANGSET, ret);
 
-#ifdef ENABLE_SIM_FEATURE
        ret = ctsvc_server_sim_init();
        RETVM_IF(ret !=CONTACTS_ERROR_NONE, ret, "ctsvc_server_sim_init Fail(%d)", ret);
-#endif /* ENABLE_SIM_FEATURE */
 
        return CONTACTS_ERROR_NONE;
 }