Audio V4: Use string to identify audio Device
The name of an audio device is an opaque string that the
framework does not interpret (there are exceptions, see documentation)
and only uses as an ID to link
the audio_policy_configuration.xml and the audio device factory.
Previously it was an enum which meant that the vendors
could not implement the interface more than a set number of time
and that generic meaningless (secondary, auxiliary) names had
to be introduced.
Bug: 38184704
Test: compile
Change-Id: I9f3ac1928de8116974257951e016108c5820eded
Merged-In: I9f3ac1928de8116974257951e016108c5820eded
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
diff --git a/audio/4.0/config/audio_policy_configuration.xsd b/audio/4.0/config/audio_policy_configuration.xsd
index 924fb47..e5b4449 100644
--- a/audio/4.0/config/audio_policy_configuration.xsd
+++ b/audio/4.0/config/audio_policy_configuration.xsd
@@ -66,35 +66,6 @@
<xs:complexType name="globalConfiguration">
<xs:attribute name="speaker_drc_enabled" type="xs:boolean" use="required"/>
</xs:complexType>
- <!-- Enum values of IDevicesFactory::Device
- TODO: generate from hidl to avoid manual sync. -->
- <xs:simpleType name="halName">
- <xs:union>
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:enumeration value="primary"/>
- <xs:enumeration value="a2dp"/>
- <xs:enumeration value="usb"/>
- <xs:enumeration value="r_submix"/>
- <xs:enumeration value="codec_offload"/>
- <xs:enumeration value="stub"/>
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType>
- <xs:annotation>
- <xs:documentation xml:lang="en">
- Vendor eXtension names must be in the vx namespace.
- Vendor are encouraged to namespace their module names.
- Example for an hypothetical Google virtual reality HAL:
- <module name="vx_google_vr" halVersion="3.0"/>
- </xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:string">
- <xs:pattern value="vx_[_a-zA-Z0-9]+"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:union>
- </xs:simpleType>
<xs:complexType name="modules">
<xs:annotation>
<xs:documentation xml:lang="en">
@@ -133,7 +104,7 @@
<xs:element name="devicePorts" type="devicePorts" minOccurs="0"/>
<xs:element name="routes" type="routes" minOccurs="0"/>
</xs:sequence>
- <xs:attribute name="name" type="halName" use="required"/>
+ <xs:attribute name="name" type="xsd:string" use="required"/>
<xs:attribute name="halVersion" type="halVersion" use="required"/>
</xs:complexType>
<xs:unique name="mixPortNameUniqueness">