#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))
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("+");
/*TODO: Initialize Obexd Event receiver */
+ /* Initialize event receiver for flight mode */
+ _bt_hal_register_vconf_handler();
+
event_cb = cb;
DBG("-");