Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 84a18be4 authored by Jesse Melhuish's avatar Jesse Melhuish Committed by Hsin-chen Chuang
Browse files

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
parent f4bac114
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment