CHROMIUM: Bluetooth: Remove the assumption on the Adv state in connection event

This removes the assumption where ALL controllers will stop advertising
when initiating a LE connection. This is an Eve only change.

A non-recoverable error would occur in the following scenario.
If kernel does not send a LE set advertise enable command with 0x00 before
sending a LE create connection command, the advertisement can be going
when initiating the connection. However, in the complete event of LE create
connection, the HCI_LE_ADV has been cleared based on the assumption that
controllers will always stop advertising upon establishing connection. So
that kernel ends up with the out-of-sync state due to mis-setting the
HCI_LE_ADV flag which cause the following advertising rescheduling to fail.

BUG=chromium:776423
TEST=Intentionally skip adding the command to disable advertising before
LE create connection and verify that the HCI_LE_ADV flag does not go out
of sync with the actual advertising status.

Change-Id: I443619909cc3c61a800fcac64f5d715f0ed6438b
Signed-off-by: Miao-chen Chou <mcchou@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/734322
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Dmitry Grinberg <dmitrygr@google.com>
1 file changed