From e32c8dcd38b8e2282559a325c59fd6b7fa187d2f Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 24 Oct 2008 12:19:47 +0300 Subject: Limit the amount of connected HSP/HFP devices and make it configurable It's very tricky to get the multiple connected HSP/HFP devices use case right. E.g. in the case of in-band ringtone the specification mandates us to open SCO to the HFP before sending RING indications. So, in the case of multiple connected devices we would have to open multimple simultaneous SCO connections which simply isn't a wise thing to do. --- audio/headset.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'audio/headset.c') diff --git a/audio/headset.c b/audio/headset.c index 77498d73..0a7f18ed 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -1466,6 +1466,10 @@ static DBusMessage *hs_connect(DBusConnection *conn, DBusMessage *msg, return g_dbus_create_error(msg, ERROR_INTERFACE ".NotReady", "Telephony subsystem not ready"); + if (!manager_allow_headset_connection(&device->src)) + return g_dbus_create_error(msg, ERROR_INTERFACE ".NotAllowed", + "Too many connected devices"); + err = rfcomm_connect(device, NULL, NULL, NULL); if (err < 0) return g_dbus_create_error(msg, ERROR_INTERFACE -- cgit