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/4.0/IStream.hal b/audio/4.0/IStream.hal
index 62b8d03..306152b 100644
--- a/audio/4.0/IStream.hal
+++ b/audio/4.0/IStream.hal
@@ -88,7 +88,7 @@
*
* @return mask channel mask.
*/
- getChannelMask() generates (AudioChannelMask mask);
+ getChannelMask() generates (bitfield<AudioChannelMask> mask);
/**
* Return supported channel masks of the stream. Calling this method is
@@ -101,7 +101,7 @@
* @return masks supported audio masks.
*/
getSupportedChannelMasks(AudioFormat format)
- generates (Result retval, vec<AudioChannelMask> masks);
+ generates (Result retval, vec<bitfield<AudioChannelMask>> masks);
/**
* Sets the channel mask of the stream. Calling this method is equivalent to
@@ -111,7 +111,7 @@
* @param format audio format.
* @return retval operation completion status.
*/
- setChannelMask(AudioChannelMask mask) generates (Result retval);
+ setChannelMask(bitfield<AudioChannelMask> mask) generates (Result retval);
/**
* Return the audio format of the stream.
@@ -148,7 +148,7 @@
* @return format audio format.
*/
getAudioProperties() generates (
- uint32_t sampleRateHz, AudioChannelMask mask, AudioFormat format);
+ uint32_t sampleRateHz, bitfield<AudioChannelMask> mask, AudioFormat format);
/**
* Applies audio effect to the stream.
@@ -183,7 +183,7 @@
* @return retval operation completion status: OK or NOT_SUPPORTED.
* @return device set of device(s) which this stream is connected to.
*/
- getDevice() generates (Result retval, AudioDevice device);
+ getDevice() generates (Result retval, bitfield<AudioDevice> device);
/**
* Connects the stream to the device.