UPSTREAM: shared/gatt-client: Fix not detecting BT_ATT_SECURITY_AUTO

Using bt_gatt_security cannot detect if BT_ATT_SECURITY_AUTO is enabled
since it actually checks the current level when operating over L2CAP, so
instead use io_sec_level internal field to detect the security level in
which ATT is supposed to be operating.

BUG=chromium:483275,chromium:478308
TEST=Use a BLE keyboard to pair with a chromebook.
The BLE keyboard should be ready to use after successful pairing.

(cherry picked from commit 064f48ad6dd0eb4becb94f5492b6c78218065f19)
Signed-off-by: Joseph Hwang <josephsih@chromium.org>

Change-Id: I406da7440736ada8e4aa22ec4e4635d3b44eee8b
Reviewed-on: https://chromium-review.googlesource.com/331452
Commit-Ready: Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Shyh-In Hwang <josephsih@chromium.org>
Reviewed-by: Wei-Ning Huang <wnhuang@chromium.org>
1 file changed