From 0c369c0ddb7e04d040de768e29e7a0bb3cf04e04 Mon Sep 17 00:00:00 2001 From: Anupam Roy Date: Sat, 23 Jul 2016 19:46:02 +0530 Subject: [PATCH] [Adapt: HAL] Handle TODO cases in authorization request from Stack 1/ Reject incoming authorization request if device is not 'Paired' or 'Trusted' 2/ Reject authorization if device proxy fetch is failed 3/ Reject authorization if device address is NULL 4/ Accept authorization if device is already 'Trusted' Change-Id: Iad991d7f258342c545bc34f62bba2a8603104098 Signed-off-by: Anupam Roy --- bt-oal/bluez_hal/src/bt-hal-agent.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bt-oal/bluez_hal/src/bt-hal-agent.c b/bt-oal/bluez_hal/src/bt-hal-agent.c index 2a4e8e5..08e7e93 100644 --- a/bt-oal/bluez_hal/src/bt-hal-agent.c +++ b/bt-oal/bluez_hal/src/bt-hal-agent.c @@ -586,11 +586,11 @@ static gboolean __bt_hal_authorize_request(GapAgentPrivate *agent, GDBusProxy *d GVariant *reply_temp = NULL; GVariant *tmp_value; - DBG("Authorize Request from Bluez STack: UUID [%s]", uuid); + DBG("Authorize Request from Bluez Stack: UUID [%s]", uuid); reply_temp = __bt_hal_service_getall(device, BT_HAL_DEVICE_INTERFACE); if (reply_temp == NULL) { - /* TODO Reject Authorization request */ + gap_agent_reply_authorize(agent, GAP_AGENT_REJECT, NULL); goto done; } @@ -600,7 +600,7 @@ static gboolean __bt_hal_authorize_request(GapAgentPrivate *agent, GDBusProxy *d g_variant_get(tmp_value, "s", &address); G_VARIANT_UNREF(tmp_value); if (!address) { - /* TODO Reject Authorization request */ + gap_agent_reply_authorize(agent, GAP_AGENT_REJECT, NULL); goto done; } @@ -619,7 +619,7 @@ static gboolean __bt_hal_authorize_request(GapAgentPrivate *agent, GDBusProxy *d G_VARIANT_UNREF(tmp_value); if ((paired == FALSE) && (trust == FALSE)) { ERR("No paired & No trusted device"); - /* TODO Reject Authorization request */ + gap_agent_reply_authorize(agent, GAP_AGENT_REJECT, NULL); goto done; } @@ -627,7 +627,7 @@ static gboolean __bt_hal_authorize_request(GapAgentPrivate *agent, GDBusProxy *d if (trust) { INFO("Trusted device, so authorize\n"); - /* TODO Accept Authorization request */ + gap_agent_reply_authorize(agent, GAP_AGENT_ACCEPT, NULL); goto done; } -- 2.7.4