OSDN Git Service

Fix LE disconnecting right after pairing
authorJakub Pawlowski <jpawlowski@google.com>
Thu, 27 Apr 2017 11:52:34 +0000 (04:52 -0700)
committerAndre Eisenbach <eisenbach@google.com>
Thu, 27 Apr 2017 18:38:38 +0000 (18:38 +0000)
commit7c8bab231328956d3b7569280cb162be4e345422
tree6cee0078cd2210697494b2819ab17d58816668b3
parent99c34224429dff42761b8629b9161872f1a1ab8d
Fix LE disconnecting right after pairing

When a device connect to android over LE, the default policy is to keep
this connection. If any app "claims" this connnection, and then stop
using it, we'll disconnect from the device after a short timeout.

If pairing is triggered to such device, that is connected but not used
by any app, it will cause disconnect after the pairing is finished. This
is because using SMP over fixed LE L2CAP channel is conseidered as
connecting, using, and disconnecting a channel by the stack. This is
obvious logic error - using fixed channels should not require
"connecting" to them.

As a temporary workaround, do not trigger a timeout when a fixed SMP
channel is closed over LE.

For LE only devices, this means they will stay connected after the
pairing until some app starts using them or they disconnect. For dual
mode devices, Classic connection will be established and SDP will be
performed. The classic connection will be disconnected if no app will
use it, and the LE connection to the device will stay up.

Bug: 37352720
Test: manual
Change-Id: Ic9d688aacf84e0267277b12b28dfa7cc57fdcea6
stack/l2cap/l2c_utils.cc