1################################################################################################
2#
3# @NOTE:
4# Audio Policy Criteria file example for generic device build
5#
6# Any vendor shall have its own configuration within the corresponding device folder
7#
8################################################################################################
9
10#########################################################
11# Criterion type Example:
12# For each criterion, a couple of numerical, literal values must be provided to the PFW.
13# The numerical part is not mandatory. If not filled by the user, a default numerical value will be
14# automatically provided by audio HAL using the following logic:
15#   - Exclusive criterion:
16#          * 0 -> first literal value,
17#          * 1 -> second literal value,
18#               ...
19#          * N -> (N+1)th literal value.
20#   - Inclusive criterion:
21#          * 1 << 0 -> first literal value,
22#          * 1 << 1 -> second literal value,
23#               ...
24#          * 1 << N -> (N+1)th literal value,
25#
26#########################################################
27# Policy {
28#    InclusiveCriterionType|ExclusiveCriterionType {
29#        <Criterion Name>  [numerical value 1:]<literal value 1>,[numerical value 2:]<literal value 2>,<literal value 3>,...
30#    }
31# }
32
33#########################################################
34# Criterion:
35#########################################################
36# Policy {
37#    Criterion {
38#        <Criterion Name> {
39#            Type            <Criterion type name>
40#            Default         <default value of the criterion>
41#        }
42#    }
43# }
44
45Policy {
46    InclusiveCriterionType {
47        #
48        # DO NOT CHANGE ORDER. This definition must be aligned with the definition of
49        # AUDIO_DEVICE_OUT_* within <system/audio.h> file of android.
50        #
51        OutputDevicesMaskType   Earpiece,Speaker,WiredHeadset,WiredHeadphone,BluetoothSco,BluetoothScoHeadset,BluetoothScoCarkit,BluetoothA2dp,BluetoothA2dpHeadphones,BluetoothA2dpSpeaker,Hdmi,AnlgDockHeadset,DgtlDockHeadset,UsbAccessory,UsbDevice,RemoteSubmix,TelephonyTx,Line,HdmiArc,Spdif,Fm,AuxLine,SpeakerSafe
52        #
53        # DO NOT CHANGE ORDER. This definition must be aligned with the definition of
54        # AUDIO_DEVICE_IN_* within <system/audio.h> file of android.
55        # Note also that direction bit will be decimated by AudioHAL in order to allow using a mask
56        # with the cardinality of 1 between a bit and an input device.
57        #
58        InputDevicesMaskType    Communication,Ambient,BuiltinMic,BluetoothScoHeadset,WiredHeadset,Hdmi,TelephonyRx,BackMic,RemoteSubmix,AnlgDockHeadset,DgtlDockHeadset,UsbAccessory,UsbDevice,FmTuner,TvTune,Line,Spdif,BluetoothA2dp,Loopback
59    }
60    ExclusiveCriterionType {
61        #
62        # The values of the mode MUST be aligned with the definition of the audio_mode_t
63        # from system/audio.h
64        #
65        AndroidModeType     0:Normal,1:RingTone,2:InCall,3:InCommunication
66        #
67        # The values of the mode MUST be aligned with the definition of the
68        # audio_policy_forced_config_t from system/audio.h
69        #
70        ForceUseForCommunicationType    0:ForceNone,1:ForceSpeaker,3:ForceBtSco
71        #
72        # The values of the mode MUST be aligned with the definition of the
73        # audio_policy_forced_config_t from system/audio.h
74        #
75        ForceUseForMediaType            0:ForceNone,1:ForceSpeaker,2:ForceHeadphones,4:ForceBtA2dp,5:ForceWiredAccessory,8:ForceAnalogDock,9:ForceDigitalDock,10:ForceNoBtA2dp
76        #
77        # The values of the mode MUST be aligned with the definition of the
78        # audio_policy_forced_config_t from system/audio.h
79        #
80        ForceUseForRecordType           0:ForceNone,3:ForceBtSco,5:ForceWiredAccessory
81        #
82        # The values of the mode MUST be aligned with the definition of the
83        # audio_policy_forced_config_t from system/audio.h
84        #
85        ForceUseForDockType             0:ForceNone,5:ForceWiredAccessory,6:ForceBtCarDock,7:ForceBtDeskDock,8:ForceAnalogDock,9:ForceDigitalDock
86        #
87        # The values of the mode MUST be aligned with the definition of the
88        # audio_policy_forced_config_t from system/audio.h
89        #
90        ForceUseForSystemType           0:ForceNone,11:ForceSystemEnforced
91        #
92        # The values of the mode MUST be aligned with the definition of the
93        # audio_policy_forced_config_t from system/audio.h
94        #
95        ForceUseForHdmiSystemAudioType  0:ForceNone,12:ForceHdmiSystemEnforced
96    }
97
98    Criterion {
99        AvailableInputDevices {
100            Type            InputDevicesMaskType
101            Default         none
102        }
103        AvailableOutputDevices {
104            Type            OutputDevicesMaskType
105            Default         none
106        }
107        TelephonyMode {
108            Type            AndroidModeType
109            Default         Normal
110        }
111        ForceUseForCommunication {
112            Type            ForceUseForCommunicationType
113            Default         ForceNone
114        }
115        ForceUseForMedia {
116            Type            ForceUseForMediaType
117            Default         ForceNone
118        }
119        ForceUseForRecord {
120            Type            ForceUseForRecordType
121            Default         ForceNone
122        }
123        ForceUseForDock {
124            Type            ForceUseForDockType
125            Default         ForceNone
126        }
127        ForceUseForSystem {
128            Type            ForceUseForSystemType
129            Default         ForceNone
130        }
131        ForceUseForHdmiSystemAudio {
132            Type            ForceUseForHdmiSystemAudioType
133            Default         ForceNone
134        }
135    }
136}
137
138