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

Skip to content
Commit b7c96798 authored by Hsin-chen Chuang's avatar Hsin-chen Chuang
Browse files

floss: Refactor btstack initialization order (4/4 BluetoothGatt)

This patch does:
- Move the scattered Gatt initialization (and the profiles depend on it)
  to lib.rs AdapterReady, so:
  - Gatt API ready delay can be removed
  - Bluetooth is now almost not depending on BluetoothGatt
- BluetoothGatt is now optional in Bluetooth. This makes more sense in
  the context of Bluetooth because it inits earlier than Gatt.
- Since BluetoothGatt is init-ed after Bluetooth we can save many
  redundant `Option` in it.

Some backgrounds:
  We want to get rid of the redundant `Option` of the topshim objects
  that is causing many verbosities and confusing snippets (We all know
  we can't do anything without the objects... Then why is it optional?).
  The overall direction is to remove all Bluetooth's dependencies on
  initialization, because the Bluetooth topshim object needs to be
  initialized first before all other topshim objects can be obtained.

Bug: 254870880
Bug: 247093293
Tag: #floss
Test: mmm packages/modules/Bluetooth
Test: bluetooth_AdapterQuickHealth.AVL.all_floss
Test: manual connect LE mouse, BAS works
Test: manual FastPair / SmartLock (GATT)
Test: manual Sphero mini / SPRK+
Test: manual NearbyShare on nami (SW Adv) and guybrush (Ext Adv)
Flag: EXEMPT, Floss-only changes
Change-Id: I14da61138c6baf56173aa88f75c0ef1f3ccd9a0f
parent adb4b458
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