floss: Refactor BAS connection/disconnection
Floss connects to BAS automatically, this means in some cases Floss needs to take responsibility to disconnect it: - A user calls ClientConnect and then expects ClientDisconnect to drop the entire connection. - A peer initiates some profile connections, then Floss connects to BAS. Since Floss is the initiator, the peer might not be disconnecting BAS from their end. This patch does: - Revise Message::OnDeviceConnectionStateChanged: It was not doing what its name told and was only fired in some specific cases - Add Message::ProfileDisconnected: Disconnect BAS when it's the last active profile - Remove BAS logic in ConnectAllEnabledProfiles as we would connect BAS on ACL/bond state changed - Remove BAS logic in DisconnectAllEnabledProfiles as it already disconnects all GATT - Cleanup BAS on GATT disconnected - We would connect BAS to dual device after this patch Bug: 369733365 Tag: #floss Test: mmm packages/modules/Bluetooth Test: Connect Sephero mini through app, then bond through btclient; Disconnecting through app would drop the entire connection after this patch Test: LR10 (dual device), BAS connects and doesn't affect FastPair Test: LE mouse, BAS works fine Test: bluetooth_Adapter{CL,LE,AU}Health.all_floss Test: CTSV Bluetooth LE Client Test Test: SmartLock and FastPair works fine Flag: EXEMPT, Floss-only change Change-Id: I6339e7d649871142c7c55dc2e1a7f3f53d245c18
Loading
Please register or sign in to comment