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