diff options
| author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-10-24 15:20:36 +0300 | 
|---|---|---|
| committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-10-24 15:20:36 +0300 | 
| commit | 06082049381e6b5f95aca2047942db67b1c7fa29 (patch) | |
| tree | a0e6ecc231aa1314ce7178b9e28c695c117e9f22 | |
| parent | 6813a4d8d8ca7dc3d341f56a830fa90dadb90269 (diff) | |
Fix manager_allow_headset_connection count check
| -rw-r--r-- | audio/manager.c | 6 | 
1 files changed, 4 insertions, 2 deletions
| diff --git a/audio/manager.c b/audio/manager.c index 816e6821..8661dcca 100644 --- a/audio/manager.c +++ b/audio/manager.c @@ -453,8 +453,10 @@ static void ag_io_cb(GIOChannel *chan, int err, const bdaddr_t *src,  	if (!device)  		goto drop; -	if (!manager_allow_headset_connection(&device->src)) +	if (!manager_allow_headset_connection(&device->src)) { +		debug("Refusing headset: too many existing connections");  		goto drop; +	}  	if (!device->headset)  		btd_device_add_uuid(device->btd_dev, remote_uuid); @@ -1091,7 +1093,7 @@ gboolean manager_allow_headset_connection(bdaddr_t *src)  		if (headset_get_state(dev) > HEADSET_STATE_DISCONNECTED)  			connected++; -		if (connected > max_connected_headsets) +		if (connected >= max_connected_headsets)  			return FALSE;  	} | 
