Package: android.hardware.audio@4.0

IPrimaryDevice

interface IPrimaryDevice extends IDevice

Properties

TtyMode

enum TtyMode: int32_t
Details
Members
OFF
VCO
HCO
FULL

Rotation

enum Rotation: int32_t
Details
Members
DEG_0
DEG_90
DEG_180
DEG_270

Methods

setVoiceVolume

setVoiceVolume (float volume)
generates (Result retval)

Sets the audio volume of a voice call.

Details
Parameters
volume
1.0f means unity, 0.0f is zero.
Generates
retval
operation completion status.

setMode

setMode (AudioMode mode)
generates (Result retval)

This method is used to notify the HAL about audio mode changes.

Details
Parameters
mode
new mode.
Generates
retval
operation completion status.

setBtScoHeadsetDebugName

setBtScoHeadsetDebugName (string name)
generates (Result retval)

Sets the name of the current BT SCO headset.Calling this method is equivalent to setting legacy "bt_headset_name" parameter.The BT SCO headset name must only be used for debugging purposes.Optional method

Details
Parameters
name
the name of the current BT SCO headset(can be empty).
Generates
retval
operation completion status.

getBtScoNrecEnabled

getBtScoNrecEnabled ()
generates (Result retval, bool enabled)

Gets whether BT SCO Noise Reduction and Echo Cancellation are enabled.Calling this method is equivalent to getting AUDIO_PARAMETER_KEY_BT_NREC on the legacy HAL.

Details
Generates
retval
operation completion status.
enabled
whether BT SCO NR + EC are enabled.

setBtScoNrecEnabled

setBtScoNrecEnabled (bool enabled)
generates (Result retval)

Sets whether BT SCO Noise Reduction and Echo Cancellation are enabled.Calling this method is equivalent to setting AUDIO_PARAMETER_KEY_BT_NREC on the legacy HAL.Optional method

Details
Parameters
enabled
whether BT SCO NR + EC are enabled.
Generates
retval
operation completion status.

getBtScoWidebandEnabled

getBtScoWidebandEnabled ()
generates (Result retval, bool enabled)

Gets whether BT SCO Wideband mode is enabled.Calling this method is equivalent to getting AUDIO_PARAMETER_KEY_BT_SCO_WB on the legacy HAL.

Details
Generates
retval
operation completion status.
enabled
whether BT Wideband is enabled.

setBtScoWidebandEnabled

setBtScoWidebandEnabled (bool enabled)
generates (Result retval)

Sets whether BT SCO Wideband mode is enabled.Calling this method is equivalent to setting AUDIO_PARAMETER_KEY_BT_SCO_WB on the legacy HAL.Optional method

Details
Parameters
enabled
whether BT Wideband is enabled.
Generates
retval
operation completion status.

getBtHfpEnabled

getBtHfpEnabled ()
generates (Result retval, bool enabled)

Gets whether BT HFP(Hands-Free Profile)is enabled.Calling this method is equivalent to getting "hfp_enable" parameter value on the legacy HAL.

Details
Generates
retval
operation completion status.
enabled
whether BT HFP is enabled.

setBtHfpEnabled

setBtHfpEnabled (bool enabled)
generates (Result retval)

Sets whether BT HFP(Hands-Free Profile)is enabled.Calling this method is equivalent to setting "hfp_enable" parameter on the legacy HAL.Optional method

Details
Parameters
enabled
whether BT HFP is enabled.
Generates
retval
operation completion status.

setBtHfpSampleRate

setBtHfpSampleRate (uint32_t sampleRateHz)
generates (Result retval)

Sets the sampling rate of BT HFP(Hands-Free Profile). Calling this method is equivalent to setting "hfp_set_sampling_rate" parameter on the legacy HAL.Optional method

Details
Parameters
sampleRateHz
sample rate in Hz.
Generates
retval
operation completion status.

setBtHfpVolume

setBtHfpVolume (float volume)
generates (Result retval)

Sets the current output volume Hz for BT HFP(Hands-Free Profile). Calling this method is equivalent to setting "hfp_volume" parameter value on the legacy HAL(except that legacy HAL implementations expect an integer value in the range from 0 to 15 .)Optional method

Details
Parameters
volume
1.0f means unity, 0.0f is zero.
Generates
retval
operation completion status.

getTtyMode

getTtyMode ()
generates (Result retval, TtyMode mode)

Gets current TTY mode selection.Calling this method is equivalent to getting AUDIO_PARAMETER_KEY_TTY_MODE on the legacy HAL.

Details
Generates
retval
operation completion status.
mode
TTY mode.

setTtyMode

setTtyMode (TtyMode mode)
generates (Result retval)

Sets current TTY mode.Calling this method is equivalent to setting AUDIO_PARAMETER_KEY_TTY_MODE on the legacy HAL.

Details
Parameters
mode
TTY mode.
Generates
retval
operation completion status.

getHacEnabled

getHacEnabled ()
generates (Result retval, bool enabled)

Gets whether Hearing Aid Compatibility - Telecoil(HAC-T)mode is enabled.Calling this method is equivalent to getting AUDIO_PARAMETER_KEY_HAC on the legacy HAL.

Details
Generates
retval
operation completion status.
enabled
whether HAC mode is enabled.

setHacEnabled

setHacEnabled (bool enabled)
generates (Result retval)

Sets whether Hearing Aid Compatibility - Telecoil(HAC-T)mode is enabled.Calling this method is equivalent to setting AUDIO_PARAMETER_KEY_HAC on the legacy HAL.Optional method

Details
Parameters
enabled
whether HAC mode is enabled.
Generates
retval
operation completion status.

updateRotation

updateRotation (Rotation rotation)
generates (Result retval)

Updates HAL on the current rotation of the device relative to natural orientation.Calling this method is equivalent to setting legacy parameter "rotation".

Details
Parameters
rotation
rotation in degrees relative to natural device orientation.
Generates
retval
operation completion status.