a2dp: Fix not detecting transport connection collision 66/283666/1 accepted/tizen/unified/20221103.165739
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 16 Sep 2022 21:35:28 +0000 (14:35 -0700)
committerAnuj Jain <anuj01.jain@samsung.com>
Tue, 1 Nov 2022 06:53:30 +0000 (12:23 +0530)
commit3b60fc1cbc72873b811e1bf27886e3d8a7216614
tree7e9171126a8fde81a3336b7f8b70119cd7ad9846
parentc78e21da92e64650960dd417951f23f8d65ade42
a2dp: Fix not detecting transport connection collision

Some headsets appears to attempt to connect back after receiving
AVDTP_Open which would cause unexpected transitions since setup->io
and stream->io would not be in sync:

> ACL Data RX: Handle 70 flags 0x02 dlen 6
      Channel: 64 len 2 [PSM 25 mode Basic (0x00)] {chan 0}
      AVDTP: Open (0x06) Response Accept (0x02) type 0x00 label 2 nosp 0
< ACL Data TX: Handle 70 flags 0x00 dlen 12
      L2CAP: Connection Request (0x02) ident 6 len 4
        PSM: 25 (0x0019)
        Source CID: 67
> ACL Data RX: Handle 70 flags 0x02 dlen 12
      L2CAP: Connection Request (0x02) ident 10 len 4
        PSM: 25 (0x0019)
        Source CID: 68
< ACL Data TX: Handle 70 flags 0x00 dlen 16
      L2CAP: Connection Response (0x03) ident 10 len 8
        Destination CID: 68
        Source CID: 68
        Result: Connection pending (0x0001)
        Status: Authorization pending (0x0002)
< ACL Data TX: Handle 70 flags 0x00 dlen 16
      L2CAP: Connection Response (0x03) ident 10 len 8
        Destination CID: 68
        Source CID: 68
        Result: Connection successful (0x0000)
        Status: No further information available (0x0000)
> ACL Data RX: Handle 70 flags 0x02 dlen 16
      L2CAP: Connection Response (0x03) ident 6 len 8
        Destination CID: 69
        Source CID: 67
        Result: Connection successful (0x0000)
        Status: No further information available (0x0000)

Fixes: https://github.com/bluez/bluez/issues/327
Change-Id: Ifb7f3014cb73701e591cead934f0ce04bab4ca1c
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
profiles/audio/a2dp.c