Reland "CHROMIUM: Bluetooth: Optimize the LE connection sequence"

This reland commit 3ae30eac2507ebbeffc66284c0ffb892cbe753ee.

Diff: move the skip to connect logic after the existence check of the
`conn` object to avoid repeatedly connecting to the same device.

Original change's description:
> CHROMIUM: Bluetooth: Optimize the LE connection sequence
>
> This patch allows the extra scan when connecting to LE devices to be
> skipped if the following conditions are met:
>
> 1. A device doesn't use an Irk, so a new adv sample is not necessary.
> 2. A recent adv sample has been received in the last 2 seconds implying
> that an rpa is likely to be current.
>
> A manual inspection has demonstrated a ~300ms improvement to the
> connection latency of the smart lock and tethering features.  This patch
> is submitted as a chromium patch to gether additional field data through
> metrics before suggesting upstream.
>
> BUG=b:191003297
> TEST=Manually validated using bluetoothctl and ConnectLE as well as
> bluetooth_AdapterQuickHealth
>
> Signed-off-by: Alain Michaud <alainm@chromium.org>
> Change-Id: Icac3f49f9fe209193439e48d6109e183fd3c789e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2964735
> Reviewed-by: Miao-chen Chou <mcchou@chromium.org>

BUG=b:191003297, b:191805908
TEST=CTSV:Bluetooth LE CoC Insecure Client Test

Change-Id: Ie5d3b57d7da3cf0697581e2b2aad54ff6e650609
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/3078984
Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
Commit-Queue: Michael Sun <michaelfsun@google.com>
Tested-by: Michael Sun <michaelfsun@google.com>
(cherry picked from commit 5940edc0ca1ce6cdbe0aa80cc9d0c585c7b85e96)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/3083044
3 files changed