summaryrefslogtreecommitdiffstats
path: root/audio/manager.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-09-04 17:36:51 +0300
committerJohan Hedberg <johan.hedberg@nokia.com>2008-09-04 17:36:51 +0300
commit4449fea64a582999d9bcf4a5f91832c9fdf1e389 (patch)
treed8b35d60c34107985d5c00d80e3ea4be6181b917 /audio/manager.c
parentde6c33d2666072676a7e2afc8b9be6f2804242c1 (diff)
Disallow HFP connections when the telephony plugin isn't yet initialized
Diffstat (limited to 'audio/manager.c')
-rw-r--r--audio/manager.c11
1 files changed, 5 insertions, 6 deletions
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: