4 * Copyright (c) 2010 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 #include "ctsvc_internal.h"
22 #include "ctsvc_mutex.h"
23 #include "ctsvc_socket.h"
25 EXPORT_API int contacts_sim_import_all_contacts()
28 WARN(DEPRECATED_STRING_FORMAT, __FUNCTION__);
30 ctsvc_mutex_lock(CTS_MUTEX_SOCKET_FD);
31 ret = ctsvc_request_sim_import(0, NULL, NULL);
32 ctsvc_mutex_unlock(CTS_MUTEX_SOCKET_FD);
37 EXPORT_API int contacts_sim_get_initialization_status(bool *completed)
40 WARN(DEPRECATED_STRING_FORMAT, __FUNCTION__);
41 RETV_IF(NULL == completed, CONTACTS_ERROR_INVALID_PARAMETER);
43 ctsvc_mutex_lock(CTS_MUTEX_SOCKET_FD);
44 ret = ctsvc_request_sim_get_initialization_status(0, completed);
45 ctsvc_mutex_unlock(CTS_MUTEX_SOCKET_FD);
50 EXPORT_API int contacts_sim_import_all_contacts_by_sim_slot_no(int sim_slot_no,
51 contacts_sim_import_progress_cb callback, void *user_data)
55 RETV_IF(sim_slot_no < 0, CONTACTS_ERROR_INVALID_PARAMETER);
57 ctsvc_mutex_lock(CTS_MUTEX_SOCKET_FD);
58 ret = ctsvc_request_sim_import(sim_slot_no, callback, user_data);
59 ctsvc_mutex_unlock(CTS_MUTEX_SOCKET_FD);
64 EXPORT_API int contacts_sim_get_initialization_status_by_sim_slot_no(int sim_slot_no, bool *completed)
68 RETV_IF(NULL == completed, CONTACTS_ERROR_INVALID_PARAMETER);
69 RETV_IF(sim_slot_no < 0, CONTACTS_ERROR_INVALID_PARAMETER);
71 ctsvc_mutex_lock(CTS_MUTEX_SOCKET_FD);
72 ret = ctsvc_request_sim_get_initialization_status(sim_slot_no, completed);
73 ctsvc_mutex_unlock(CTS_MUTEX_SOCKET_FD);