Audio policy config: allow vendor to extend module name

Vendor are currently not allowed to extend the XML format.
As some enumeration are allowed to be extended, this mean that
the format must allow some extension mechanism.

This patch relaxes the definition of the module name field.
AOSP names are still allowed, but a vendor can add its own name
if prefixed with "vx_". Eg:
    <module name="vx_google_vr" halVersion="3.0">

Test: xmllint --xinclude --noout --schema hardware/interfaces/audio/2.0/config/audio_policy_configuration.xsd audio_policy_configuration.xml
      with audio_policy_configuration.xml containing a module named vx_google_vr
Test: vts-tradefed run commandAndExit vts --module VtsHalAudioV2_0Target -t CheckConfig.audioPolicyConfigurationValidation
      on Pixel 2
Bug: 69442986
Signed-off-by: Kevin Rocard <krocard@google.com>

Merged-In: I4ead38535cce89bb8fe44cf23fa1146acd1271d6
Change-Id: I4ead38535cce89bb8fe44cf23fa1146acd1271d6
(cherry picked from commit 7558e8c6e41fe8ab6eed7d1a3463a9f99a3548ef)
diff --git a/audio/2.0/config/audio_policy_configuration.xsd b/audio/2.0/config/audio_policy_configuration.xsd
index eb59152..8c05763 100644
--- a/audio/2.0/config/audio_policy_configuration.xsd
+++ b/audio/2.0/config/audio_policy_configuration.xsd
@@ -73,14 +73,28 @@
     <!-- Enum values of IDevicesFactory::Device
          TODO: generate from hidl to avoid manual sync. -->
     <xs:simpleType name="halName">
-        <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: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>
+                <!-- 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: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>