summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorKevin Rocard <krocard@google.com>2018-10-22 15:30:07 -0700
committerKevin Rocard <krocard@google.com>2018-12-03 14:49:55 -0800
commit0fecc8ded06e087bfdefa4551e293e1d4e19638d (patch)
tree3fd2be2b7bf0d97948090bd517102b448d2bf46a /audio
parent2dc552a75505f748ddfdf7080225f1b624bdcc91 (diff)
downloadplatform_hardware_interfaces-0fecc8ded06e087bfdefa4551e293e1d4e19638d.tar.gz
platform_hardware_interfaces-0fecc8ded06e087bfdefa4551e293e1d4e19638d.tar.bz2
platform_hardware_interfaces-0fecc8ded06e087bfdefa4551e293e1d4e19638d.zip
Audio V5 XSD: Allow vendor extension for audio devices
Without this patch vendors can not do any vendor extension extending the audio enums as it would fails the XSD validation. Long term, the config xml parsing should be moved in the HAL, until then allow extension if they are prefixed with EX_. Test: xmllint --noout --schema hardware/interfaces/audio/5.0/config/audio_policy_configuration.xsd --xinclude out/target/product/*/vendor/etc/audio_policy_configuration.xml Bug: 117967786 Change-Id: Ie44490824b5b50fdebb50a82299ea348d2a34b84 Signed-off-by: Kevin Rocard <krocard@google.com>
Diffstat (limited to 'audio')
-rw-r--r--audio/5.0/config/audio_policy_configuration.xsd20
1 files changed, 18 insertions, 2 deletions
diff --git a/audio/5.0/config/audio_policy_configuration.xsd b/audio/5.0/config/audio_policy_configuration.xsd
index 311b9c1a83..b0927b25d4 100644
--- a/audio/5.0/config/audio_policy_configuration.xsd
+++ b/audio/5.0/config/audio_policy_configuration.xsd
@@ -281,6 +281,19 @@
<xs:enumeration value="AUDIO_DEVICE_IN_STUB"/>
</xs:restriction>
</xs:simpleType>
+ <xs:simpleType name="vendorExtension">
+ <!-- Vendor extension names must be prefixed by "VX_" to distinguish them from AOSP values.
+ Vendor are encouraged to namespace their module names to avoid conflicts.
+ Example for an hypothetical Google virtual reality device:
+ <devicePort tagName="VR" type="VX_GOOGLE_VR" role="sink">
+ -->
+ <xs:restriction base="xs:string">
+ <xs:pattern value="VX_[_a-zA-Z0-9]+"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="extendableAudioDevice">
+ <xs:union memberTypes="audioDevice vendorExtension"/>
+ </xs:simpleType>
<!-- Enum values of audio_format_t in audio.h
TODO: generate from hidl to avoid manual sync. -->
<xs:simpleType name="audioFormat">
@@ -353,6 +366,9 @@
<xs:enumeration value="AUDIO_FORMAT_AAC_ADTS_XHE"/>
</xs:restriction>
</xs:simpleType>
+ <xs:simpleType name="extendableAudioFormat">
+ <xs:union memberTypes="audioFormat vendorExtension"/>
+ </xs:simpleType>
<!-- Enum values of audio::common::4_0::AudioUsage
TODO: generate from HIDL to avoid manual sync. -->
<xs:simpleType name="audioUsage">
@@ -395,7 +411,7 @@
</xs:simpleType>
<xs:complexType name="profile">
<xs:attribute name="name" type="xs:token" use="optional"/>
- <xs:attribute name="format" type="audioFormat" use="optional"/>
+ <xs:attribute name="format" type="extendableAudioFormat" use="optional"/>
<xs:attribute name="samplingRates" type="samplingRates" use="optional"/>
<xs:attribute name="channelMasks" type="channelMask" use="optional"/>
</xs:complexType>
@@ -432,7 +448,7 @@
<xs:element name="gains" type="gains" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="tagName" type="xs:token" use="required"/>
- <xs:attribute name="type" type="audioDevice" use="required"/>
+ <xs:attribute name="type" type="extendableAudioDevice" use="required"/>
<xs:attribute name="role" type="role" use="required"/>
<xs:attribute name="address" type="xs:string" use="optional" default=""/>
<!-- Note that XSD 1.0 can not check that a type only has one default. -->