#define BT_SHARE_FRWK_INTERFACE "User.Bluetooth.FRWK"
#define BT_SHARE_FRWK_SIGNAL_DEINIT "deinit"
+#define BT_CORE_NAME "org.projectx.bt_core"
+#define BT_CORE_PATH "/org/projectx/bt_core"
+#define BT_CORE_INTERFACE "org.projectx.btcore"
+
#define BT_IPC_STRING_SIZE 256
#define BT_ADDR_STR_LEN_MAX 18
#define BT_MIME_TYPE_MAX_LEN 20
char *filepath, char *type,
unsigned int size, int status);
+int _bt_set_eventsystem_transfer_value(gboolean value);
+
#ifdef __cplusplus
}
#endif
#include "vconf-keys.h"
#include "applog.h"
#include "bt-share-common.h"
+#include "bt-share-ipc.h"
+#if 0
static int __bt_eventsystem_set_value(const char *event, const char *key, const char *value)
{
int ret;
return ret;
}
+#endif
int _bt_share_block_sleep(gboolean is_block)
{
DBG("event_value: %s", event_val);
+ if (_bt_set_eventsystem_transfer_value(state) != BT_SHARE_ERROR_NONE)
+ ERR("Fail to set value");
+
+#if 0
if (__bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_TRANSFERING_STATE,
event_val) != ES_R_OK)
ERR("Fail to set value");
+#endif
ret = vconf_set_int(VCONFKEY_BT_STATUS, bt_device_state);
if (ret != 0) {
#include <aul.h>
#include <vconf.h>
#include <bundle_internal.h>
+#include <gio/gio.h>
#include "applog.h"
#include "bluetooth-api.h"
GSList *bt_transfer_list = NULL;
DBusConnection *dbus_connection = NULL;
+static GDBusConnection *system_gconn = NULL;
+static GDBusProxy *core_proxy = NULL;
extern struct bt_appdata *app_state;
}
return;
}
+
+GDBusConnection *__bt_init_system_gconn(void)
+{
+ if (system_gconn == NULL)
+ system_gconn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, NULL);
+
+ return system_gconn;
+}
+
+GDBusConnection *__bt_get_system_gconn(void)
+{
+ return (system_gconn) ? system_gconn : __bt_init_system_gconn();
+}
+
+GDBusProxy *__bt_init_core_proxy(void)
+{
+ GDBusProxy *proxy;
+ GDBusConnection *conn;
+
+ conn = __bt_get_system_gconn();
+ if (!conn)
+ return NULL;
+
+ proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ BT_CORE_NAME,
+ BT_CORE_PATH,
+ BT_CORE_INTERFACE,
+ NULL, NULL);
+
+ if (!proxy)
+ return NULL;
+
+ core_proxy = proxy;
+
+ return proxy;
+}
+
+static GDBusProxy *__bt_get_core_proxy(void)
+{
+ return (core_proxy) ? core_proxy : __bt_init_core_proxy();
+}
+
+int _bt_set_eventsystem_transfer_value(gboolean value)
+{
+ GDBusProxy *proxy;
+ GError *error = NULL;
+ GVariant *reply;
+ int ret = BT_SHARE_ERROR_NONE;
+
+ DBG("+");
+
+ proxy = __bt_get_core_proxy();
+ if (!proxy)
+ return BT_SHARE_FAIL;
+
+ reply = g_dbus_proxy_call_sync(proxy, "SetTransferValue",
+ g_variant_new("(b)", value),
+ G_DBUS_CALL_FLAGS_NONE, -1,
+ NULL, &error);
+
+ if (reply == NULL) {
+ ERR("Failed to Set tranfer value by bt core");
+ ret = BT_SHARE_FAIL;
+ if (error) {
+ ERR("Error %s", error->message);
+ g_error_free(error);
+ }
+ }
+ g_variant_unref(reply);
+
+ return ret;
+}