################################################################################################
#
# @NOTE:
# Audio Policy Criteria file example for generic device build
#
# Any vendor shall have its own configuration within the corresponding device folder
#
################################################################################################

#########################################################
# Criterion type Example:
# For each criterion, a couple of numerical, literal values must be provided to the PFW.
# The numerical part is not mandatory. If not filled by the user, a default numerical value will be
# automatically provided by audio HAL using the following logic:
#   - Exclusive criterion:
#          * 0 -> first literal value,
#          * 1 -> second literal value,
#               ...
#          * N -> (N+1)th literal value.
#   - Inclusive criterion:
#          * 1 << 0 -> first literal value,
#          * 1 << 1 -> second literal value,
#               ...
#          * 1 << N -> (N+1)th literal value,
#
#########################################################
# Policy {
#    InclusiveCriterionType|ExclusiveCriterionType {
#        <Criterion Name>  [numerical value 1:]<literal value 1>,[numerical value 2:]<literal value 2>,<literal value 3>,...
#    }
# }

#########################################################
# Criterion:
#########################################################
# Policy {
#    Criterion {
#        <Criterion Name> {
#            Type            <Criterion type name>
#            Default         <default value of the criterion>
#        }
#    }
# }

Policy {
    InclusiveCriterionType {
        #
        # DO NOT CHANGE ORDER. This definition must be aligned with the definition of
        # AUDIO_DEVICE_OUT_* within <system/audio.h> file of android.
        #
        OutputDevicesMaskType   Earpiece,Speaker,WiredHeadset,WiredHeadphone,BluetoothSco,BluetoothScoHeadset,BluetoothScoCarkit,BluetoothA2dp,BluetoothA2dpHeadphones,BluetoothA2dpSpeaker,Hdmi,AnlgDockHeadset,DgtlDockHeadset,UsbAccessory,UsbDevice,RemoteSubmix,TelephonyTx,Line,HdmiArc,Spdif,Fm,AuxLine,SpeakerSafe
        #
        # DO NOT CHANGE ORDER. This definition must be aligned with the definition of
        # AUDIO_DEVICE_IN_* within <system/audio.h> file of android.
        # Note also that direction bit will be decimated by AudioHAL in order to allow using a mask
        # with the cardinality of 1 between a bit and an input device.
        #
        InputDevicesMaskType    Communication,Ambient,BuiltinMic,BluetoothScoHeadset,WiredHeadset,Hdmi,TelephonyRx,BackMic,RemoteSubmix,AnlgDockHeadset,DgtlDockHeadset,UsbAccessory,UsbDevice,FmTuner,TvTune,Line,Spdif,BluetoothA2dp,Loopback
    }
    ExclusiveCriterionType {
        #
        # The values of the mode MUST be aligned with the definition of the audio_mode_t
        # from system/audio.h
        #
        AndroidModeType     0:Normal,1:RingTone,2:InCall,3:InCommunication
        #
        # The values of the mode MUST be aligned with the definition of the
        # audio_policy_forced_config_t from system/audio.h
        #
        ForceUseForCommunicationType    0:ForceNone,1:ForceSpeaker,3:ForceBtSco
        #
        # The values of the mode MUST be aligned with the definition of the
        # audio_policy_forced_config_t from system/audio.h
        #
        ForceUseForMediaType            0:ForceNone,1:ForceSpeaker,2:ForceHeadphones,4:ForceBtA2dp,5:ForceWiredAccessory,8:ForceAnalogDock,9:ForceDigitalDock,10:ForceNoBtA2dp
        #
        # The values of the mode MUST be aligned with the definition of the
        # audio_policy_forced_config_t from system/audio.h
        #
        ForceUseForRecordType           0:ForceNone,3:ForceBtSco,5:ForceWiredAccessory
        #
        # The values of the mode MUST be aligned with the definition of the
        # audio_policy_forced_config_t from system/audio.h
        #
        ForceUseForDockType             0:ForceNone,5:ForceWiredAccessory,6:ForceBtCarDock,7:ForceBtDeskDock,8:ForceAnalogDock,9:ForceDigitalDock
        #
        # The values of the mode MUST be aligned with the definition of the
        # audio_policy_forced_config_t from system/audio.h
        #
        ForceUseForSystemType           0:ForceNone,11:ForceSystemEnforced
        #
        # The values of the mode MUST be aligned with the definition of the
        # audio_policy_forced_config_t from system/audio.h
        #
        ForceUseForHdmiSystemAudioType  0:ForceNone,12:ForceHdmiSystemEnforced
        #
        # The values of the mode MUST be aligned with the definition of the
        # audio_policy_forced_config_t from system/audio_policy.h
        #
        ForceUseForEncodedSurroundType  0:ForceNone,13:ForceEncodedSurroundNever,14:ForceEncodedSurroundAlways
    }

    Criterion {
        AvailableInputDevices {
            Type            InputDevicesMaskType
            Default         none
        }
        AvailableOutputDevices {
            Type            OutputDevicesMaskType
            Default         none
        }
        TelephonyMode {
            Type            AndroidModeType
            Default         Normal
        }
        ForceUseForCommunication {
            Type            ForceUseForCommunicationType
            Default         ForceNone
        }
        ForceUseForMedia {
            Type            ForceUseForMediaType
            Default         ForceNone
        }
        ForceUseForRecord {
            Type            ForceUseForRecordType
            Default         ForceNone
        }
        ForceUseForDock {
            Type            ForceUseForDockType
            Default         ForceNone
        }
        ForceUseForSystem {
            Type            ForceUseForSystemType
            Default         ForceNone
        }
        ForceUseForHdmiSystemAudio {
            Type            ForceUseForHdmiSystemAudioType
            Default         ForceNone
        }
        ForceUseForEncodedSurround {
            Type            ForceUseForEncodedSurroundType
            Default         ForceNone
        }
    }
}

