From 4449fea64a582999d9bcf4a5f91832c9fdf1e389 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 4 Sep 2008 17:36:51 +0300 Subject: Disallow HFP connections when the telephony plugin isn't yet initialized --- audio/manager.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'audio/manager.c') diff --git a/audio/manager.c b/audio/manager.c index cb241d76..d824548e 100644 --- a/audio/manager.c +++ b/audio/manager.c @@ -464,12 +464,11 @@ static void auth_cb(DBusError *derr, void *user_data) } else { char hs_address[18]; - headset_set_authorized(device); - ba2str(&device->dst, hs_address); - debug("Accepted headset connection from %s for %s", hs_address, device->path); + + headset_set_authorized(device); } } @@ -510,16 +509,16 @@ static void ag_io_cb(GIOChannel *chan, int err, const bdaddr_t *src, goto drop; } + headset_set_state(device, HEADSET_STATE_CONNECT_IN_PROGRESS); + err = btd_request_authorization(&device->src, &device->dst, uuid, auth_cb, device); if (err < 0) { debug("Authorization denied: %s", strerror(-err)); - headset_close_rfcomm(device); + headset_set_state(device, HEADSET_STATE_DISCONNECTED); return; } - headset_set_state(device, HEADSET_STATE_CONNECT_IN_PROGRESS); - return; drop: -- cgit