audio: Fix audio service state 78/51478/1
authorBharat Panda <bharat.panda@samsung.com>
Tue, 10 Nov 2015 04:59:40 +0000 (10:29 +0530)
committerBharat Panda <bharat.panda@samsung.com>
Tue, 10 Nov 2015 04:59:40 +0000 (10:29 +0530)
When profile .disconnect is called the state of the service
is already set to disconnecting this is make no sense to
call btd_service_connect_complete as it will do nothing and
the state will never be updated to disconnected as it should.

git repo link:
http://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=e316a77f5a5fd4675c5b1f0da8a52fc253233054

Change-Id: I9780763b6265d27b4a6957a18fb0b352b3d72a9c

profiles/audio/sink.c
profiles/audio/source.c

index 78a6887..750b710 100644 (file)
@@ -441,7 +441,7 @@ int sink_disconnect(struct btd_service *service)
        if (sink->connect_id > 0) {
                a2dp_cancel(sink->connect_id);
                sink->connect_id = 0;
-               btd_service_connecting_complete(sink->service, -ECANCELED);
+               btd_service_connecting_complete(sink->service, 0);
 
                avdtp_unref(sink->session);
                sink->session = NULL;
index b235a7d..43c20c2 100644 (file)
@@ -398,7 +398,7 @@ int source_disconnect(struct btd_service *service)
        if (source->connect_id > 0) {
                a2dp_cancel(source->connect_id);
                source->connect_id = 0;
-               btd_service_connecting_complete(source->service, -ECANCELED);
+               btd_service_connecting_complete(source->service, 0);
 
                avdtp_unref(source->session);
                source->session = NULL;