1<?xml version="1.0" encoding="UTF-8"?>
2<ComponentTypeSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3              xmlns:xi="http://www.w3.org/2001/XInclude"
4              xsi:noNamespaceSchemaLocation="Schemas/ComponentTypeSet.xsd">
5    <!-- Output devices definition as a bitfield for the supported devices per output
6    profile. It must match with the output device enum parameter.
7    -->
8     <!--#################### GLOBAL COMPONENTS BEGIN ####################-->
9     <!-- Common Types defintion -->
10     <xi:include href="PolicySubsystem-Volume.xml"/>
11
12     <!--#################### GLOBAL COMPONENTS END ####################-->
13
14    <ComponentType Name="OutputDevicesMask" Description="32th bit is not allowed as dedicated
15                                                     for input devices detection">
16        <BitParameterBlock Name="mask" Size="32">
17            <BitParameter Name="earpiece" Size="1" Pos="0"/>
18            <BitParameter Name="speaker" Size="1" Pos="1"/>
19            <BitParameter Name="wired_headset" Size="1" Pos="2"/>
20            <BitParameter Name="wired_headphone" Size="1" Pos="3"/>
21            <BitParameter Name="bluetooth_sco" Size="1" Pos="4"/>
22            <BitParameter Name="bluetooth_sco_headset" Size="1" Pos="5"/>
23            <BitParameter Name="bluetooth_sco_carkit" Size="1" Pos="6"/>
24            <BitParameter Name="bluetooth_a2dp" Size="1" Pos="7"/>
25            <BitParameter Name="bluetooth_a2dp_headphones" Size="1" Pos="8"/>
26            <BitParameter Name="bluetooth_a2dp_speaker" Size="1" Pos="9"/>
27            <BitParameter Name="hdmi" Size="1" Pos="10"/>
28            <BitParameter Name="angl_dock_headset" Size="1" Pos="11"/>
29            <BitParameter Name="dgtl_dock_headset" Size="1" Pos="12"/>
30            <BitParameter Name="usb_accessory" Size="1" Pos="13"/>
31            <BitParameter Name="usb_device" Size="1" Pos="14"/>
32            <BitParameter Name="remote_submix" Size="1" Pos="15"/>
33            <BitParameter Name="telephony_tx" Size="1" Pos="26"/>
34            <BitParameter Name="line" Size="1" Pos="17"/>
35            <BitParameter Name="hdmi_arc" Size="1" Pos="18"/>
36            <BitParameter Name="spdif" Size="1" Pos="19"/>
37            <BitParameter Name="fm" Size="1" Pos="20"/>
38            <BitParameter Name="aux_line" Size="1" Pos="21"/>
39            <BitParameter Name="speaker_safe" Size="1" Pos="22"/>
40        </BitParameterBlock>
41    </ComponentType>
42
43    <!-- Input devices definition as a bitfield for the supported devices per Input
44    profile. It must match with the Input device enum parameter.
45    -->
46    <ComponentType Name="InputDevicesMask">
47        <BitParameterBlock Name="mask" Size="32">
48            <BitParameter Name="communication" Size="1" Pos="0"/>
49            <BitParameter Name="ambient" Size="1" Pos="1"/>
50            <BitParameter Name="builtin_mic" Size="1" Pos="2"/>
51            <BitParameter Name="bluetooth_sco_headset" Size="1" Pos="3"/>
52            <BitParameter Name="wired_headset" Size="1" Pos="4"/>
53            <BitParameter Name="hdmi" Size="1" Pos="5"/>
54            <BitParameter Name="telephony_rx" Size="1" Pos="6"/>
55            <BitParameter Name="back_mic" Size="1" Pos="7"/>
56            <BitParameter Name="remote_submix" Size="1" Pos="8"/>
57            <BitParameter Name="anlg_dock_headset" Size="1" Pos="9"/>
58            <BitParameter Name="dgtl_dock_headset" Size="1" Pos="10"/>
59            <BitParameter Name="usb_accessory" Size="1" Pos="11"/>
60            <BitParameter Name="usb_device" Size="1" Pos="12"/>
61            <BitParameter Name="fm_tuner" Size="1" Pos="13"/>
62            <BitParameter Name="tv_tuner" Size="1" Pos="14"/>
63            <BitParameter Name="line" Size="1" Pos="15"/>
64            <BitParameter Name="spdif" Size="1" Pos="16"/>
65            <BitParameter Name="bluetooth_a2dp" Size="1" Pos="17"/>
66            <BitParameter Name="loopback" Size="1" Pos="18"/>
67            <BitParameter Name="in" Size="1" Pos="31"/>
68        </BitParameterBlock>
69    </ComponentType>
70
71    <ComponentType Name="OutputFlags"
72                   Description="the audio output flags serve two purposes:
73                    - when an AudioTrack is created they indicate a wish to be connected to an
74                      output stream with attributes corresponding to the specified flags.
75                    - when present in an output profile descriptor listed for a particular audio
76                      hardware module, they indicate that an output stream can be opened that
77                      supports the attributes indicated by the flags.
78                    The audio policy manager will try to match the flags in the request
79                    (when getOuput() is called) to an available output stream.">
80        <BitParameterBlock Name="mask" Size="32">
81            <BitParameter Name="direct" Size="1" Pos="0"/>
82            <BitParameter Name="primary" Size="1" Pos="1"/>
83            <BitParameter Name="fast" Size="1" Pos="2"/>
84            <BitParameter Name="deep_buffer" Size="1" Pos="3"/>
85            <BitParameter Name="compress_offload" Size="1" Pos="4"/>
86            <BitParameter Name="non_blocking" Size="1" Pos="5"/>
87            <BitParameter Name="hw_av_sync" Size="1" Pos="6"/>
88        </BitParameterBlock>
89    </ComponentType>
90
91    <ComponentType Name="InputFlags"
92                   Description="The audio input flags are analogous to audio output flags.
93                                Currently they are used only when an AudioRecord is created,
94                                to indicate a preference to be connected to an input stream with
95                                attributes corresponding to the specified flags.">
96        <BitParameterBlock Name="mask" Size="32">
97            <BitParameter Name="fast" Size="1" Pos="0"/>
98            <BitParameter Name="hw_hotword" Size="1" Pos="2"/>
99        </BitParameterBlock>
100    </ComponentType>
101
102    <ComponentType Name="InputSourcesMask" Description="The audio input source is also known
103                                                        as the use case.">
104        <BitParameterBlock Name="mask" Size="32">
105            <BitParameter Name="default" Size="1" Pos="0"/>
106            <BitParameter Name="mic" Size="1" Pos="1"/>
107            <BitParameter Name="voice_uplink" Size="1" Pos="2"/>
108            <BitParameter Name="voice_downlink" Size="1" Pos="3"/>
109            <BitParameter Name="voice_call" Size="1" Pos="4"/>
110            <BitParameter Name="camcorder" Size="1" Pos="5"/>
111            <BitParameter Name="voice_recognition" Size="1" Pos="6"/>
112            <BitParameter Name="voice_communication" Size="1" Pos="7"/>
113            <BitParameter Name="remote_submix" Size="1" Pos="8"/>
114            <BitParameter Name="fm_tuner" Size="1" Pos="9"/>
115            <BitParameter Name="hotword" Size="1" Pos="10"/>
116        </BitParameterBlock>
117    </ComponentType>
118
119    <!-- Routing Strategy definition as an enumeration. Numerical value must match the value
120         of the routing strategy in policy header file. -->
121    <ComponentType Name="Strategy">
122        <EnumParameter Name="strategy" Size="32">
123            <ValuePair Literal="media" Numerical="0"/>
124            <ValuePair Literal="phone" Numerical="1"/>
125            <ValuePair Literal="sonification" Numerical="2"/>
126            <ValuePair Literal="sonification_respectful" Numerical="3"/>
127            <ValuePair Literal="dtmf" Numerical="4"/>
128            <ValuePair Literal="enforced_audible" Numerical="5"/>
129            <ValuePair Literal="transmitted_through_speaker" Numerical="6"/>
130            <ValuePair Literal="accessibility" Numerical="7"/>
131            <ValuePair Literal="rerouting" Numerical="8"/>
132        </EnumParameter>
133    </ComponentType>
134
135    <!--#################### STRATEGY COMMON TYPES BEGIN ####################-->
136
137    <ComponentType Name="StrategyConfig" Mapping="Strategy:'%1'">
138        <Component Name="selected_output_devices" Type="OutputDevicesMask"/>
139    </ComponentType>
140
141    <!--#################### STRATEGY COMMON TYPES END ####################-->
142
143    <!--#################### STREAM COMMON TYPES BEGIN ####################-->
144
145    <ComponentType Name="Stream">
146        <Component Name="applicable_strategy" Type="Strategy" Mapping="Stream:'%1'"/>
147        <Component Name="volume_profiles" Type="VolumeCurvesCategories"
148                   Description="A volume profile is refered by the stream type."/>
149    </ComponentType>
150
151    <!--#################### STREAM COMMON TYPES END ####################-->
152
153    <!--#################### USAGE COMMON TYPES BEGIN ####################-->
154
155    <ComponentType Name="Usage">
156        <Component Name="applicable_strategy" Type="Strategy" Mapping="Usage:'%1'"/>
157    </ComponentType>
158
159    <!--#################### USAGE COMMON TYPES END ####################-->
160
161    <!--#################### INPUT SOURCE COMMON TYPES BEGIN ####################-->
162
163    <ComponentType Name="InputSource">
164        <Component Name="applicable_input_device" Type="InputDevicesMask"
165                   Mapping="InputSource:'%1'" Description="Selected Input device"/>
166    </ComponentType>
167
168    <!--#################### INPUT SOURCE COMMON TYPES END ####################-->
169
170</ComponentTypeSet>
171