aboutsummaryrefslogtreecommitdiffstats
path: root/binding-bluetooth/bluetooth-agent.c
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-08-29 21:08:52 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-08-29 21:08:52 -0700
commitf4407227caa64017f10c885647ca4087f45b42dd (patch)
treed30abab9757026eb679610b71bd5387ba245eb04 /binding-bluetooth/bluetooth-agent.c
parent6528027bbea699a927f76fcfe842691148596661 (diff)
binding: bluetooth: agent: request for binding to be default agentflounder_5.99.5flounder/5.99.55.99.5
Request for the binding to be the default agent, so phones can initiate pairing exchanges versus just the Settings UI Change-Id: I74844383022774ce713ab55796761f6060a843ba Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding-bluetooth/bluetooth-agent.c')
-rw-r--r--binding-bluetooth/bluetooth-agent.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/binding-bluetooth/bluetooth-agent.c b/binding-bluetooth/bluetooth-agent.c
index 7193ce5..3420167 100644
--- a/binding-bluetooth/bluetooth-agent.c
+++ b/binding-bluetooth/bluetooth-agent.c
@@ -522,6 +522,25 @@ static int create_and_register_agent(const char *capability)
g_variant_unref(value);
+ value = g_dbus_connection_call_sync(system_conn, BLUEZ_SERVICE,
+ AGENT_PATH, AGENT_MANAGER_INTERFACE,
+ "RequestDefaultAgent", g_variant_new("(o)", AGENT_PATH),
+ NULL, G_DBUS_CALL_FLAGS_NONE, DBUS_REPLY_TIMEOUT,
+ NULL, &error);
+
+ if (NULL == value) {
+ LOGE ("RequestDefaultAgent Err: %s", error->message);
+ g_error_free(error);
+
+ g_dbus_interface_skeleton_unexport(
+ G_DBUS_INTERFACE_SKELETON(agnet_interface));
+
+ g_object_unref(system_conn);
+ return -1;
+ }
+
+ g_variant_unref(value);
+
agent_capability = NULL;
agent_registered = TRUE;