[bt-audio] Fix dbus method reply for audio connect 47/139447/1
authorAnurag Biradar <biradar.a@samsung.com>
Wed, 19 Jul 2017 04:10:50 +0000 (09:40 +0530)
committerAnurag Biradar <biradar.a@samsung.com>
Wed, 19 Jul 2017 04:10:50 +0000 (09:40 +0530)
commit7e573392efaa50e04ddc5fc6cee01ca7c15e3125
tree50ddbdcdee0dae285dc09edb6a699ace11e9a05b
parentdcd710867a5737e8193cfe78671868cfa010abb5
[bt-audio] Fix dbus method reply for audio connect

Application is showing as Connecting and never came back to
Disconnected or Connected state(Application didn't got dbus
reply for audio connect method call)

We were overwriting the global data which stores request id to which
we need to reply. Because of which bt-service will not able to reply
to dbus request. For Ex. Already Headset A is connected, Applications
sends connection request for Headset B, than bt-service initiates
disconnection for Headset A and Stores Headset B in global wait data.
And When Headset A's HFP profile is connected, Application sends
connection request for Headset C, than bt-service initiates disconnection
for Headset B and overwrite the global wait data with that of Headset C.

Measure: Before checking if any device is connected or not check first
if any device is in connecting state with type. If any device is in
connecting state than return IN_PROGRESS error no need to handle.

Change-Id: I1e721f2e2660274ecef2c3cf551377572e557b3b
bt-service/bt-service-audio.c