Audio V4: bitfield enum now use the bitfield class
The audio HAL has lots of enums were each value is a specific bit
pattern (usually a single bit) and are expected to be used as a
combination of value (kind of like a bitfield).
Nevertheless the 2.0 methods only had the enums themselves in their
signatures which leads the HIDL API checkers to warn that invalid values
were passed.
Currently, there are no way to express a value which is a combination
of enum values. The closest thing is the bitfield type.
Thus transition all enums combination to bitfield.
Note that AudioDevice as NOT been transition systematically
as both the enums and the combination are meaningful:
- the enum is one device
- the combination is a list of device.
Test: none
Bug: 38184704
Change-Id: I155cf7bc5d88fc5cf8954903d55aa8d7ca458a4b
Signed-off-by: Kevin Rocard <krocard@google.com>
diff --git a/audio/effect/4.0/IVirtualizerEffect.hal b/audio/effect/4.0/IVirtualizerEffect.hal
index b98ad3f..52038ca 100644
--- a/audio/effect/4.0/IVirtualizerEffect.hal
+++ b/audio/effect/4.0/IVirtualizerEffect.hal
@@ -47,7 +47,8 @@
getStrength() generates (Result retval, uint16_t strength);
struct SpeakerAngle {
- AudioChannelMask mask; // speaker channel mask (1 bit set).
+ /** Speaker channel mask */
+ bitfield<AudioChannelMask> mask;
// all angles are expressed in degrees and
// are relative to the listener.
int16_t azimuth; // 0 is the direction the listener faces
@@ -60,7 +61,7 @@
* Retrieves virtual speaker angles for the given channel mask on the
* specified device.
*/
- getVirtualSpeakerAngles(AudioChannelMask mask, AudioDevice device)
+ getVirtualSpeakerAngles(bitfield<AudioChannelMask> mask, AudioDevice device)
generates (Result retval, vec<SpeakerAngle> speakerAngles);
/**