X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bt-oal%2Fbluez_hal%2Fsrc%2Fbt-hal-event-receiver.c;h=6193d99042f6ed18bfa20373a8993e09199053c5;hb=373bbbb8cd7c3aacbf6f53e1b38841c7fcad6a8e;hp=316a792b00659ef42104b7be2a4ecb88fe0ba571;hpb=d59bb7c9d10e4718ac1d7c3cc09a36f7e06c7222;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git diff --git a/bt-oal/bluez_hal/src/bt-hal-event-receiver.c b/bt-oal/bluez_hal/src/bt-hal-event-receiver.c index 316a792..6193d99 100644 --- a/bt-oal/bluez_hal/src/bt-hal-event-receiver.c +++ b/bt-oal/bluez_hal/src/bt-hal-event-receiver.c @@ -39,6 +39,7 @@ #include "bt-hal-adapter-le.h" #include "bt-hal-gatt-server.h" #include "bt-hal-gatt-client.h" +#include "bt-hal-adapter-dbus-handler.h" #define BASELEN_PROP_CHANGED (sizeof(struct hal_ev_adapter_props_changed) \ + sizeof(struct hal_property)) @@ -486,6 +487,43 @@ static void __bt_hal_adapter_property_changed_event(GVariant *msg) DBG("-"); } +static void __bt_hal_flight_ps_mode_cb(keynode_t *node, void *data) +{ + gboolean flight_mode = FALSE; + int type; + DBG_SECURE("HAL callback hit"); + DBG_SECURE("key=%s", vconf_keynode_get_name(node)); + type = vconf_keynode_get_type(node); + if (type == VCONF_TYPE_BOOL) { + flight_mode = vconf_keynode_get_bool(node); + if (flight_mode != TRUE) { + ERR("Ignore the event"); + return; + } + else { + ERR("Flight Mode == TRUE"); + } + } else { + ERR("Invaild vconf key type : %d", type); + return; + } + DBG("Enabling core now"); + _bt_hal_enable_core(); +} + +static void _bt_hal_register_vconf_handler(void) +{ + DBG("+"); + + if (vconf_notify_key_changed(VCONFKEY_TELEPHONY_FLIGHT_MODE, + (vconf_callback_fn)__bt_hal_flight_ps_mode_cb, NULL) < 0) + ERR("Unable to register key handler"); + DBG("Telephony is disabled"); + if (vconf_notify_key_changed(VCONFKEY_SETAPPL_PSMODE, + (vconf_callback_fn)__bt_hal_flight_ps_mode_cb, NULL) < 0) + ERR("Unable to register key handler"); +} + void _bt_hal_handle_adapter_event(GVariant *msg, const char *member) { DBG("+"); @@ -1455,6 +1493,9 @@ int _bt_hal_initialize_event_receiver(handle_stack_msg cb) /*TODO: Initialize Obexd Event receiver */ + /* Initialize event receiver for flight mode */ + _bt_hal_register_vconf_handler(); + event_cb = cb; DBG("-");