If the stream goes IDLE while we have an outstanding request, connect_id
stays non-zero and is never cleared via a completion callback. As a
consequence, the profile on this device will never be connected
successfully again until BlueZ restarts.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
case AVDTP_STATE_IDLE:
btd_service_disconnecting_complete(source->service, 0);
+ if (source->connect_id > 0) {
+ a2dp_cancel(source->connect_id);
+ source->connect_id = 0;
+ }
+
if (source->disconnect_id > 0) {
a2dp_cancel(source->disconnect_id);
source->disconnect_id = 0;