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
Loading
Please register or sign in to comment