OSDN Git Service

android/A2DP: Change to connected state when a transport open
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 15 Jan 2014 13:01:01 +0000 (15:01 +0200)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 16 Jan 2014 14:01:40 +0000 (16:01 +0200)
This changes the connected state to be only sent once a transport is
open, before this was done right after the signalling was connected but
this reflect in the audio HAL side attempting to open a stream while
with possible no transport available.

android/a2dp.c

index a36e9a3..e3e425c 100644 (file)
@@ -403,8 +403,6 @@ static void signaling_connect_cb(GIOChannel *chan, GError *err,
                }
        }
 
-       bt_a2dp_notify_state(dev, HAL_A2DP_STATE_CONNECTED);
-
        return;
 
 failed:
@@ -546,6 +544,8 @@ static void transport_connect_cb(GIOChannel *chan, GError *err,
                g_io_channel_unref(dev->io);
                dev->io = NULL;
        }
+
+       bt_a2dp_notify_state(dev, HAL_A2DP_STATE_CONNECTED);
 }
 
 static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data)