#include <app_control.h>
#include <app_control_internal.h>
#include <efl_extension.h>
+#include <glib.h>
+#include <gio/gio.h>
+#include <gio/giotypes.h>
static void __bluetooth_delete_input_view(struct bt_popup_appdata *ad);
static void __bluetooth_win_del(void *data);
switch (ad->event_type) {
case BT_EVENT_PIN_REQUEST:
- dbus_g_proxy_call_no_reply(ad->agent_proxy,
- "ReplyPinCode",
- G_TYPE_UINT, BT_AGENT_CANCEL,
- G_TYPE_STRING, "", G_TYPE_INVALID,
- G_TYPE_INVALID);
+ g_dbus_proxy_call(ad->agent_proxy,
+ "ReplyPinCode",
+ g_variant_new("(us)", BT_AGENT_CANCEL, ""),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, NULL, NULL, NULL);
break;
case BT_EVENT_PASSKEY_CONFIRM_REQUEST:
- dbus_g_proxy_call_no_reply(ad->agent_proxy,
- "ReplyConfirmation",
- G_TYPE_UINT, BT_AGENT_CANCEL,
- G_TYPE_INVALID, G_TYPE_INVALID);
+ g_dbus_proxy_call(ad->agent_proxy,
+ "ReplyConfirmation",
+ g_variant_new("(u)", BT_AGENT_CANCEL),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, NULL, NULL, NULL);
break;
case BT_EVENT_PASSKEY_REQUEST:
- dbus_g_proxy_call_no_reply(ad->agent_proxy,
- "ReplyPasskey",
- G_TYPE_UINT, BT_AGENT_CANCEL,
- G_TYPE_STRING, "", G_TYPE_INVALID,
- G_TYPE_INVALID);
+ g_dbus_proxy_call(ad->agent_proxy,
+ "ReplyPasskey",
+ g_variant_new("(us)", BT_AGENT_CANCEL, ""),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, NULL, NULL, NULL);
break;
case BT_EVENT_AUTHORIZE_REQUEST:
- dbus_g_proxy_call_no_reply(ad->agent_proxy,
- "ReplyAuthorize",
- G_TYPE_UINT, BT_AGENT_CANCEL,
- G_TYPE_INVALID, G_TYPE_INVALID);
+ g_dbus_proxy_call(ad->agent_proxy,
+ "ReplyAuthorize",
+ g_variant_new("(u)", BT_AGENT_CANCEL),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, NULL, NULL, NULL);
break;
case BT_EVENT_MESSAGE_REQUEST:
case BT_EVENT_EXCHANGE_REQUEST:
- dbus_g_proxy_call_no_reply(ad->agent_proxy,
- "ReplyAuthorize",
- G_TYPE_UINT, BT_AGENT_CANCEL,
- G_TYPE_INVALID, G_TYPE_INVALID);
+ g_dbus_proxy_call(ad->agent_proxy,
+ "ReplyAuthorize",
+ g_variant_new("(u)", BT_AGENT_CANCEL),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, NULL, NULL, NULL);
break;
(response == BT_AGENT_ACCEPT) ? "Accept" : "Cancel");
if (ad->event_type == BT_EVENT_PIN_REQUEST) {
- dbus_g_proxy_call_no_reply(ad->agent_proxy,
- "ReplyPinCode", G_TYPE_UINT, response,
- G_TYPE_STRING, convert_input_text,
- G_TYPE_INVALID, G_TYPE_INVALID);
+ g_dbus_proxy_call(ad->agent_proxy,
+ "ReplyPinCode",
+ g_variant_new("(us)", response, convert_input_text),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, NULL, NULL, NULL);
} else {
- dbus_g_proxy_call_no_reply(ad->agent_proxy,
- "ReplyPasskey", G_TYPE_UINT, response,
- G_TYPE_STRING, convert_input_text,
- G_TYPE_INVALID, G_TYPE_INVALID);
+ g_dbus_proxy_call(ad->agent_proxy,
+ "ReplyPasskey",
+ g_variant_new("(us)", response, convert_input_text),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, NULL, NULL, NULL);
}
__bluetooth_delete_input_view(ad);
const char *event = elm_object_text_get(obj);
if (!g_strcmp0(event, BT_STR_CONFIRM)) {
- dbus_g_proxy_call_no_reply(ad->agent_proxy, "ReplyConfirmation",
- G_TYPE_UINT, BT_AGENT_ACCEPT,
- G_TYPE_INVALID, G_TYPE_INVALID);
+ g_dbus_proxy_call(ad->agent_proxy,
+ "ReplyConfirmation",
+ g_variant_new("(u)", BT_AGENT_ACCEPT),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, NULL, NULL, NULL);
} else {
- dbus_g_proxy_call_no_reply(ad->agent_proxy, "ReplyConfirmation",
- G_TYPE_UINT, BT_AGENT_CANCEL,
- G_TYPE_INVALID, G_TYPE_INVALID);
+ g_dbus_proxy_call(ad->agent_proxy,
+ "ReplyConfirmation",
+ g_variant_new("(u)", BT_AGENT_CANCEL),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, NULL, NULL, NULL);
}
evas_object_del(obj);
reply_val = BT_AGENT_CANCEL;
}
- dbus_g_proxy_call_no_reply(ad->agent_proxy, "ReplyAuthorize",
- G_TYPE_UINT, reply_val,
- G_TYPE_INVALID, G_TYPE_INVALID);
+ g_dbus_proxy_call(ad->agent_proxy,
+ "ReplyAuthorize",
+ g_variant_new("(u)", reply_val),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, NULL, NULL, NULL);
ad->make_trusted = FALSE;
const char *event = elm_object_text_get(obj);
if (!g_strcmp0(event, BT_STR_OK))
- dbus_g_proxy_call_no_reply(ad->obex_proxy, "ReplyAuthorize",
- G_TYPE_UINT, BT_AGENT_ACCEPT,
- G_TYPE_INVALID, G_TYPE_INVALID);
+ g_dbus_proxy_call(ad->obex_proxy,
+ "ReplyAuthorize",
+ g_variant_new("(u)", BT_AGENT_ACCEPT),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, NULL, NULL, NULL);
else
- dbus_g_proxy_call_no_reply(ad->obex_proxy, "ReplyAuthorize",
- G_TYPE_UINT, BT_AGENT_CANCEL,
- G_TYPE_INVALID, G_TYPE_INVALID);
+ g_dbus_proxy_call(ad->obex_proxy,
+ "ReplyAuthorize",
+ g_variant_new("(u)", BT_AGENT_CANCEL),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, NULL, NULL, NULL);
__bluetooth_win_del(ad);
}
return;
if (ad->event_type == BT_EVENT_PIN_REQUEST) {
- dbus_g_proxy_call_no_reply(ad->agent_proxy,
- "ReplyPinCode", G_TYPE_UINT, response,
- G_TYPE_STRING, convert_input_text,
- G_TYPE_INVALID, G_TYPE_INVALID);
+ g_dbus_proxy_call(ad->agent_proxy,
+ "ReplyPinCode",
+ g_variant_new("(us)", response, convert_input_text),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, NULL, NULL, NULL);
+
} else {
- dbus_g_proxy_call_no_reply(ad->agent_proxy,
- "ReplyPasskey", G_TYPE_UINT, response,
- G_TYPE_STRING, convert_input_text,
- G_TYPE_INVALID, G_TYPE_INVALID);
+ g_dbus_proxy_call(ad->agent_proxy,
+ "ReplyPasskey",
+ g_variant_new("(us)", response, convert_input_text),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, NULL, NULL, NULL);
}
__bluetooth_delete_input_view(ad);
free(convert_input_text);
FN_END;
}
-static DBusGProxy* __bluetooth_create_agent_proxy(DBusGConnection *conn,
+static GDBusProxy* __bluetooth_create_agent_proxy(GDBusConnection *conn,
const char *path)
{
- return dbus_g_proxy_new_for_name(conn, "org.projectx.bt", path,
- "org.bluez.Agent1");
+ return g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
+ NULL, "org.projectx.bt",
+ path,
+ "org.bluez.Agent1",
+ NULL, NULL);
}
static void
static void __bluetooth_session_init(struct bt_popup_appdata *ad)
{
- DBusGConnection *conn = NULL;
+ GDBusConnection *conn = NULL;
GError *err = NULL;
#if 0
g_type_init();
#endif
- conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, &err);
+ conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, NULL);
if (!conn) {
BT_ERR("ERROR: Can't get on system bus [%s]",
ad->conn = conn;
- ad->obex_proxy = dbus_g_proxy_new_for_name(conn,
- "org.bluez.frwk_agent",
- "/org/obex/ops_agent",
- "org.openobex.Agent");
+ ad->obex_proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
+ NULL, "org.bluez.frwk_agent",
+ "/org/obex/ops_agent",
+ "org.openobex.Agent",
+ NULL, &err);
+
if (!ad->obex_proxy)
BT_ERR("Could not create obex dbus proxy");
__bluetooth_ime_hide();
if (ad->conn) {
- dbus_g_connection_unref(ad->conn);
+ g_object_unref(ad->conn);
ad->conn = NULL;
}