remove ifdef ENABLE_SIM_FEATURE (using telephony feature)
[platform/core/pim/contacts-service.git] / common / ctsvc_sim.c
1 /*
2  * Contacts Service
3  *
4  * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Dohyung Jin <dh.jin@samsung.com>
7  *                 Jongwon Lee <gogosing.lee@samsung.com>
8  *                 Donghee Ye <donghee.ye@samsung.com>
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */
23
24 #include "contacts.h"
25 #include "ctsvc_internal.h"
26 #include "ctsvc_mutex.h"
27 #include "ctsvc_socket.h"
28
29 API int contacts_sim_import_all_contacts()
30 {
31         int ret;
32
33         ctsvc_mutex_lock(CTS_MUTEX_SOCKET_FD);
34         ret = ctsvc_request_sim_import(0);
35         ctsvc_mutex_unlock(CTS_MUTEX_SOCKET_FD);
36
37         return ret;
38 }
39
40 API int contacts_sim_get_initialization_status(bool *completed)
41 {
42         int ret;
43
44         RETVM_IF(completed == NULL, CONTACTS_ERROR_INVALID_PARAMETER,
45                                         "parameter is NULL");
46         ctsvc_mutex_lock(CTS_MUTEX_SOCKET_FD);
47         ret = ctsvc_request_sim_get_initialization_status(0, completed);
48         ctsvc_mutex_unlock(CTS_MUTEX_SOCKET_FD);
49
50         return ret;
51 }
52