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.

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 <>

Change-Id: I406da7440736ada8e4aa22ec4e4635d3b44eee8b
Commit-Ready: Shyh-In Hwang <>
Tested-by: Shyh-In Hwang <>
Reviewed-by: Wei-Ning Huang <>
1 file changed