aboutsummaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothLeCallControl.java
diff options
context:
space:
mode:
authorJakub Tyszkowski <tyszkowski@google.com>2022-08-18 09:05:52 +0000
committerJakub Tyszkowski <tyszkowski@google.com>2022-11-04 15:36:37 +0000
commitb3dd2ce47f4125669f58f6ed61fbc4dd52e9cb6b (patch)
treee2505cc495a03c4b1cc739cf5955affe41dcfc10 /framework/java/android/bluetooth/BluetoothLeCallControl.java
parentac5bdeddc2e0b8e4579374eb001a3d215b7da81e (diff)
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 Merged-In: Ib4454b8c21e7bf4a2debcc5a1c37dc1526efa66f (cherry picked from commit 97f2d3a8ac040041a1eb0a99670575f103e45ca7)
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothLeCallControl.java')
0 files changed, 0 insertions, 0 deletions