3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 //#include <contacts-svc.h>
21 #include "utility/sync_util.h"
22 #include "item_change_info.h"
24 #ifndef SYNC_AGENT_LOG
26 #define LOG_TAG "PLUGIN_DA_CONTACT"
29 static int contact_version = 0;
31 int get_contact_version(int mode)
36 return contact_version;
39 contacts_error_e err_connect = contacts_connect2();
40 if (err_connect != CONTACTS_ERROR_NONE) {
41 _DEBUG_ERROR("contacts_connect2() failed");
44 contacts_error_e err = contacts_db_get_current_version(&contact_version);
45 if (err != CONTACTS_ERROR_NONE) {
46 _DEBUG_ERROR("contacts_db_get_current_version() failed");
48 _DEBUG_INFO("contact_version = %d", contact_version);
50 err_connect = contacts_disconnect2();
51 if (err_connect != CONTACTS_ERROR_NONE) {
52 _DEBUG_ERROR("contacts_disconnect2() failed");
56 return contact_version;
59 int set_contact_version(int setting_time)
63 /* Critical Sectioin Start */
64 contact_version = setting_time;
65 /* Critical Section End */