diff options
author | Baptiste DURAND <baptiste.durand@open.eurogiciel.org> | 2013-12-10 15:03:01 +0100 |
---|---|---|
committer | Baptiste DURAND <baptiste.durand@open.eurogiciel.org> | 2013-12-10 15:03:01 +0100 |
commit | 6f9f9e5f8a42883973889da883bdc72b03df783a (patch) | |
tree | 0f3ec89259c864409de9f3d6c4e4ec08bfa6fc5c | |
parent | 5cdc2874cdc9b3cdcdb2289330403f192fcdfae0 (diff) | |
download | vconf-6f9f9e5f8a42883973889da883bdc72b03df783a.tar.gz vconf-6f9f9e5f8a42883973889da883bdc72b03df783a.tar.bz2 vconf-6f9f9e5f8a42883973889da883bdc72b03df783a.zip |
PTREL 471:Merge from tizen2.2 branch from git repository framework/appfw/vconf
- Vconf Keys for HID and PAN Devices
- Rework Event management (don't copy list for all events)
- /tmp/vconf-init mechanism is conditional to VCONF_CHECK_IS_INITIALIZED
Change-Id: I288a9d47d84fdbec9b6dabef30334103fe5eb660
Signed-off-by: Baptiste DURAND <baptiste.durand@open.eurogiciel.org>
-rwxr-xr-x | include/vconf-keys.h | 23 | ||||
-rwxr-xr-x | packaging/vconf.spec | 4 | ||||
-rwxr-xr-x | vconf-kdb.c | 70 | ||||
-rwxr-xr-x | vconf.c | 35 |
4 files changed, 87 insertions, 45 deletions
diff --git a/include/vconf-keys.h b/include/vconf-keys.h index 8df0778..ce54463 100755 --- a/include/vconf-keys.h +++ b/include/vconf-keys.h @@ -167,25 +167,32 @@ enum { * @brief Bluetooth Connected status * * 0x0000 : Not connected \n - * 0x0004 : Headset connected \n - * 0x0010 : A2DP headset connected \n - * 0x0020 : SAP connected \n - * 0x0040 : PBAP connected \n + * 0x0001 : Headset connected \n + * 0x0002 : A2DP headset connected \n + * 0x0004 : HID connected \n + * 0x0008 : PAN connected \n + * 0x0010 : SAP connected \n + * 0x0020 : PBAP connected \n */ #define VCONFKEY_BT_DEVICE "memory/bluetooth/device" enum { /** Not connected */ VCONFKEY_BT_DEVICE_NONE = 0x0000, /** Headset connected */ - VCONFKEY_BT_DEVICE_HEADSET_CONNECTED = 0x0004, + VCONFKEY_BT_DEVICE_HEADSET_CONNECTED = 0x0001, /** A2DP headset connected */ - VCONFKEY_BT_DEVICE_A2DP_HEADSET_CONNECTED = 0x0010, + VCONFKEY_BT_DEVICE_A2DP_HEADSET_CONNECTED = 0x0002, + /** HID connected */ + VCONFKEY_BT_DEVICE_HID_CONNECTED = 0x0004, + /** PAN connected */ + VCONFKEY_BT_DEVICE_PAN_CONNECTED = 0x0008, /** SAP connected */ - VCONFKEY_BT_DEVICE_SAP_CONNECTED = 0x0020, + VCONFKEY_BT_DEVICE_SAP_CONNECTED = 0x0010, /** PBAP connected */ - VCONFKEY_BT_DEVICE_PBAP_CONNECTED = 0x0040 + VCONFKEY_BT_DEVICE_PBAP_CONNECTED = 0x0020 }; + /* Media sound path for BT */ enum { /** Media Player Select Speaker */ diff --git a/packaging/vconf.spec b/packaging/vconf.spec index 6631f40..d4e60e6 100755 --- a/packaging/vconf.spec +++ b/packaging/vconf.spec @@ -1,7 +1,7 @@ Name: vconf Summary: Configuration system library -Version: 0.2.45 -Release: 3 +Version: 0.2.51 +Release: 1 Group: System/Libraries License: Apache-2.0 Source0: %{name}-%{version}.tar.gz diff --git a/vconf-kdb.c b/vconf-kdb.c index d0e6c5d..1d5ed1f 100755 --- a/vconf-kdb.c +++ b/vconf-kdb.c @@ -139,50 +139,50 @@ static gboolean _vconf_kdb_gio_cb(GIOChannel *src, GIOCondition cond, gpointer d while (r > 0) { //INFO("read event from GIOChannel. pid : %d", getpid()); - pthread_mutex_lock(&_kdb_g_ns_mutex); - l_notilist = _vconf_copy_noti_list(g_notilist); - pthread_mutex_unlock(&_kdb_g_ns_mutex); + if (ie.mask & INOTY_EVENT_MASK) { + pthread_mutex_lock(&_kdb_g_ns_mutex); + l_notilist = _vconf_copy_noti_list(g_notilist); + pthread_mutex_unlock(&_kdb_g_ns_mutex); - if (l_notilist) { + if (l_notilist) { - struct noti_node *t = NULL; - GList *noti_list = NULL; + struct noti_node *t = NULL; + GList *noti_list = NULL; - if (!(ie.mask & INOTY_EVENT_MASK)) { - INFO("Invalid argument: ie.mask(%d), ie.len(%d)", ie.mask, ie.len); - return TRUE; - } + noti_list = g_list_first(l_notilist); + + while (noti_list) { + t = noti_list->data; - noti_list = g_list_first(l_notilist); - - while (noti_list) { - t = noti_list->data; - - keynode_t* keynode = _vconf_keynode_new(); - retvm_if(keynode == NULL, TRUE, "key malloc fail"); - - if( (t) && (t->wd == ie.wd) ) { - if ((ie.mask & IN_DELETE_SELF)) { - INFO("Notify that key(%s) is deleted", t->keyname); - _vconf_keynode_set_keyname(keynode, (const char *)t->keyname); - _vconf_keynode_set_null(keynode); - t->cb(keynode, t->cb_data); - _vconf_kdb_del_notify(t->keyname, t->cb); - } else { - _vconf_keynode_set_keyname(keynode, t->keyname); - _vconf_get_key(keynode); - t->cb(keynode, t->cb_data); - INFO("key(%s) is changed. cb called", t->keyname); + keynode_t* keynode = _vconf_keynode_new(); + if (keynode == NULL) { + ERR("key malloc fail"); + break; + } + + if( (t) && (t->wd == ie.wd) ) { + if ((ie.mask & IN_DELETE_SELF)) { + INFO("Notify that key(%s) is deleted", t->keyname); + _vconf_keynode_set_keyname(keynode, (const char *)t->keyname); + _vconf_keynode_set_null(keynode); + t->cb(keynode, t->cb_data); + _vconf_kdb_del_notify(t->keyname, t->cb); + } else { + _vconf_keynode_set_keyname(keynode, t->keyname); + _vconf_get_key(keynode); + INFO("key(%s) is changed. cb(%p) called", t->keyname, t->cb); + t->cb(keynode, t->cb_data); + } } - } - _vconf_keynode_free(keynode); + _vconf_keynode_free(keynode); - noti_list = g_list_next(noti_list); - } + noti_list = g_list_next(noti_list); + } - _vconf_free_noti_list(l_notilist); + _vconf_free_noti_list(l_notilist); + } } if (ie.len > 0) @@ -1035,6 +1035,14 @@ static int _vconf_set_key_filesys(keynode_t *keynode, int prefix) ret = _vconf_get_key_path(keynode->keyname, path); retv_if(ret != VCONF_OK, ret); + +#ifdef VCONF_CHECK_IS_INITIALIZED + if(prefix == VCONF_BACKEND_MEMORY && VCONF_NOT_INITIALIZED) { + func_ret = VCONF_ERROR_NOT_INITIALIZED; + goto out_return; + } +#endif + #ifdef VCONF_USE_BACKUP_TRANSACTION if(prefix == VCONF_BACKEND_DB && keynode->type == VCONF_TYPE_STRING) { _vconf_get_backup_path(keynode->keyname, backup_path); @@ -1209,7 +1217,17 @@ static int _vconf_set_key(keynode_t *keynode) is_busy_err = 0; retry++; +#ifdef VCONF_CHECK_INITIALIZED + if(VCONF_NOT_INITIALIZED) + { + ERR("%s : vconf is not initialized\n", keynode->keyname); + is_busy_err = 1; + } + else if(ret == VCONF_ERROR_FILE_OPEN) +#else + if(ret == VCONF_ERROR_FILE_OPEN) +#endif { switch (errno) { @@ -1700,6 +1718,14 @@ static int _vconf_get_key_filesys(keynode_t *keynode, int prefix) ret = _vconf_get_key_path(keynode->keyname, path); retv_if(ret != VCONF_OK, ret); +#ifdef VCONF_CHECK_INITIALIZED + if(prefix == VCONF_BACKEND_MEMORY && VCONF_NOT_INITIALIZED) + { + func_ret = VCONF_ERROR_NOT_INITIALIZED; + goto out_return; + } +#endif + #ifdef VCONF_USE_BACKUP_TRANSACTION if(prefix == VCONF_BACKEND_DB) { _vconf_get_backup_path(keynode->keyname, backup_path); @@ -1894,7 +1920,16 @@ int _vconf_get_key(keynode_t *keynode) is_busy_err = 0; retry++; +#ifdef VCONF_CHECK_INITIALIZED + if(VCONF_NOT_INITIALIZED) + { + ERR("%s : vconf is not initialized\n", keynode->keyname); + is_busy_err = 1; + } + else if(ret == VCONF_ERROR_FILE_OPEN) +#else if(ret == VCONF_ERROR_FILE_OPEN) +#endif { switch (errno) { |