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

Skip to content
Commit 122e077f authored by Jack He's avatar Jack He
Browse files

HFP: Redesign HeadsetStateMachine

* Remove unused variables and unused states for single connected device
* Remove unnecessary default values
* Use final keyword whenever we could
* Move state transition broadcasts into enter() method of states
* Created Disconnecting, AudioConnecting, AudioDisconnecting state to be
  more explicit about state tracking
* Create HeadsetStateBase class to implement methods shared among all
  states such as state aware logging, previous state tracking and
  crash on illegal state transitions
* Created ConnectedBase class to implement sharable methods among four
  connected states: Connected, AudioConnecting, AudioOn,
  AudioDisconnecting. They share common handler for functional messages
  besides connection events.
* Created helper methods to translate event value to string
* Created unit tests to verify every individual state transitions based
  on the state diagram drawn offline

Bug: 68952425
Test: make, runtest bluetooth
Change-Id: If2c8878e86a4c34fcc27b625dcd7a3153e8e0daa
parent d32a5219
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