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

Skip to content
Commit 97f2d3a8 authored by Jakub Tyszkowski's avatar Jakub Tyszkowski
Browse files

LeAudio: Remove boilerplate code around the context type usage

This eliminates the quirky static casts and type conversions making the
code around context types a bit more readable. By introducing stronger
types we can be sure if a particular part of the API expects a single
type or multiple context types. Previously there was to many ways of
passing multiple contexts: ORed enum class values (where the ored value
was not part of the enum value), integers, list of enums, raw bitsets,
and a type alias to bitset. It turned out the integer or bitset was
sometimes actually passing a single context. There could also be a case
where one parameter is passed as something completely different due to
compatible types. The explicit constructors should prevent any unwanted
conversions, while the additionall operators allows for clearly defined
type interactions.

Bug: 249737696
Tag: #refactor
Test: atest --host bluetooth_le_audio_test bluetooth_le_audio_client_test bluetooth_test_broadcaster bluetooth_test_broadcaster_state_machine  --no-bazel-mode
Change-Id: Ib4454b8c21e7bf4a2debcc5a1c37dc1526efa66f
parent d3b8e9f2
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