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

Skip to content
Commit 878639ee authored by Abhishek Pandit-Subedi's avatar Abhishek Pandit-Subedi
Browse files

floss: Refactor manager state machine

The manager state machine was lacking for a few reasons:
* Missing adapter present indicator
* Missing floss enabled indicator
* Logic distributed in multiple locations

This refactor aims to do a few things:
* Make sure the state machine is aware of HCI device presence when
  making state decisions.
* Make sure the state machine is aware of whether floss is enabled.
* Centralize logic to the state machine internals and improve tests.

A few major changes here:
* BluetoothManagerContext was removed entirely (superfluous).
* ManagerStateMachine was renamed StateMachineInternal.
* Floss enabled was moved into StateMachineInternal.
* New action handler was added: action_on_hci_presence_changed.
* Several actions were refactored to care about presence and
  floss_enabled.

Bug: 226644782
Bug: 228905413
Tag: #floss
Test: Unit tests ran and manually verified on ChromeOS.
Change-Id: Icd416b7e8d8f690c832f8c67c6c1bf6d8352cc99
parent cf537fee
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