Package: android.hardware.bluetooth.a2dp@1.0

IBluetoothAudioOffload

interface IBluetoothAudioOffload

HAL interface for Bluetooth A2DP Offload functionality where the encoding of the A2DP data packets is offloaded to platform specific encoders.The A2DP control path is maintained in the Bluetooth stack.

This interface is from HAL client to HAL server.

The HAL client must provide the handle of IBluetoothAudioHost as well as codec configuration to the HAL server, when its connected to an active A2DP Sink device.HAL Server, based on the feedback from the Audio framework must call into the commands provided by the IBluetoothAudioHost.HAL client must call into IBluetoothAudioOffload to provide the status of these commands.Once the device becomes inactive, the HAL client must call the endSession to terminate the session with the HAL server.

Methods

startSession

startSession (IBluetoothAudioHost hostIf, CodecConfiguration codecConfig)
generates (Status status)

Indicates that the HAL client is connected to an A2DP Sink device and is ready to stream audio.This function is also used to register the BluetoothAudioHost interface and the provide the current negotiated codec.

|endSession| must be called to unregister the interface.

Details
Parameters
hostIf
interface used to request stream control
codecConfig
Codec configuration as negotiated with the A2DP Sink device
Generates
status
one of the following SUCCESS if HAL server successfully initializes the platform with the given codec configuration UNSUPPORTED_CODEC_CONFIGURATION if HAL server cannot initialize the platform with the given codec configuration FAILURE if HAL server cannot initialize the platform for any other reason

streamStarted

oneway streamStarted (Status status)

Updates status for start stream request.The HAL client may need to communicate to Bluetooth Controller and remote Sink device, in which case it must update with PENDING status.Once the operation is completed, it must return with either SUCCESS or FAILURE.

Details
RPC mode
oneway
Parameters
status
SUCCESS, FAILURE or PENDING

streamSuspended

oneway streamSuspended (Status status)

Updates status for suspend stream request.The HAL client may need to communicate to Bluetooth Controller and remote device, in which case it must update with PENDING status.Once the operation is completed, it must return with either SUCCESS or FAILURE.

Details
RPC mode
oneway
Parameters
status
SUCCESS, FAILURE or PENDING

endSession

oneway endSession ()

Ends the current A2DP offload session and unregisters the BluetoothAudioHost interface.

Details
RPC mode
oneway